Skip to content

Add buildpack for pyproject.toml to configure container image #1444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rgaiacs
Copy link
Contributor

@rgaiacs rgaiacs commented Aug 16, 2025

Related to #1427

This is not yet ready for review!

The code is based on the Pipfile buildpack. We probably want to refactor some portions to avoid code duplication.

@rgaiacs rgaiacs force-pushed the 1427-support-pyproject branch from 83b5f11 to 577cb1b Compare August 18, 2025 12:24
@rgaiacs rgaiacs marked this pull request as ready for review August 18, 2025 12:26
@rgaiacs rgaiacs changed the title Add for pyproject.yml to configure container image Add for pyproject.toml to configure container image Aug 18, 2025
@rgaiacs
Copy link
Contributor Author

rgaiacs commented Aug 18, 2025

577cb1b implements a minimal working version. It was tested with https://github.com/rgaiacs/binder-examples-pyproject.

Required changes before merge

  • To parse the pyproject.toml, we require tomllib that is part of Python 3.11 standard library. This means that we will have to change the minimal version of Python required by repo2docker to Python 3.11 or later.

Changes that can be done in another pull request

@rgaiacs rgaiacs requested a review from minrk August 18, 2025 12:33
Comment on lines 129 to 131
"""PATH="${KERNEL_PYTHON_PREFIX}/bin:$PATH" \\
pip install --no-cache-dir --editable .
""",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do:

Suggested change
"""PATH="${KERNEL_PYTHON_PREFIX}/bin:$PATH" \\
pip install --no-cache-dir --editable .
""",
"${KERNEL_PYTHON_PREFIX}/bin/python3 -m pip install --no-cache-dir --editable .",

to be even more explicit than relying on $PATH?

@rgaiacs rgaiacs changed the title Add for pyproject.toml to configure container image Add buildpack for pyproject.toml to configure container image Aug 19, 2025
since Python 3.9 is no longer supported as it does not have tomllib.
@rgaiacs rgaiacs requested a review from minrk August 19, 2025 07:37
because now repo2docker requires Python >= 3.11 given the requirement of tomllib.
@rgaiacs
Copy link
Contributor Author

rgaiacs commented Aug 19, 2025

All tests are passing after support to Python < 3.11 was dropped.

@manics
Copy link
Member

manics commented Aug 19, 2025

We probably want to refactor some portions to avoid code duplication.

I've got a PR that refactors the handling of runtime.txt
#1428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants