Skip to content
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

Switch to pyproject.toml #648

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

Switch to pyproject.toml #648

wants to merge 2 commits into from

Conversation

pmarr
Copy link

@pmarr pmarr commented Feb 3, 2025

This PR converts from setup.py to pyproject.toml and removes setup.py

It enables support of other pip backends besides setuptools like poetry or uv

Adds optional dependency groups allowing conditional installs of plugin dependencies.

If interested, I can submit a PR with our production Dockerfile. We build the coldfront project with uv in a minimal, unprivileged container.

Is there any reason upstream would want to stay with setup.py?

@pmarr pmarr marked this pull request as ready for review February 3, 2025 19:19
@aebruno
Copy link
Member

aebruno commented Mar 7, 2025

@pmarr Thanks for the PR. We're definitely interested in converting fully to pyproject.toml. This looks like a great start. Testing this now and will provide any feedback.

If interested, I can submit a PR with our production Dockerfile. We build the coldfront project with uv in a minimal, unprivileged container.

This would be great. We're testing out uv now and will likely start using it more in the future. Would be very interested in your Dockerfile if you're willing to share. Thanks!

pmarr and others added 2 commits March 7, 2025 17:16
Converts from setup.py to pyproject.toml and removes setup.py

Adds ldap authentication deps to optional "auth" group

Signed-off-by: pmarr <[email protected]>
The container image uses the python alpine image and uv to compile the
project deps then the project itself. These are copied into a minimal,
unprivileged stage.

docker/podman compose is used to spin up the resulting container.

We use uv in the Dockerfile for dependency resolution and faster builds.
A combination of pyproject.toml and uv.lock replaces the need for pip
and manually managing venv environement variables.

Run `uv lock` to regenerate lockfile from pyproject.toml

Start with

    podman compose -f compose.yml up -d

Stop with

    podman compose down

Helpful commands

    podman compose logs app
    podman exec -it app sh
    podman exec -it app coldfront initial_setup

Dockerfile - Replace upstream with uv based multi-stage build
@pmarr
Copy link
Author

pmarr commented Mar 7, 2025

Rebased from main and added multi-stage uv Dockerfile and requisite uv.lock file. Commit message has build instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants