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

Use poetry for python dependency management #838

Merged
merged 11 commits into from
Mar 26, 2024

Conversation

dchiller
Copy link
Collaborator

@dchiller dchiller commented Mar 20, 2024

This PR changes the way Cantus Ultimus handles dependencies. In the process, it closes #734.

Change introduced:

  • python dependencies are managed with the poetry package. These are now configured in the pyproject.toml file and locked with the poetry.lock file. A dev dependency group is introduced that includes python dependencies useful for development when installed outside the app container but unnecessary for deployment; these can now be standardized across development environments. The README is updated to account for these changes.
  • The build process of the app container has been adjusted to account for the use of poetry.
  • Previously, python dependencies were installed as part of the nginx container build in order to collect Django-managed static files to a location in that container. This PR removes the need for python in the nginx container build process by collecting static files in the app container, and sharing them via a new volume with the nginx container. As I result, I'm going to say this closes Optimize nginx container build #552. No other optimizations currently seem available.

NOTE: The django-extensions (and by extension, its dependency Werkzeug) are in fact development dependencies, but need to be installed in the app container. I've opened #839 to address this at a later date.

@dchiller dchiller force-pushed the python-dependency-management branch from 679d06e to 68e8709 Compare March 22, 2024 02:52
Collect static files in app container and pass to nginx container
with a volume. This removes the need for python dependencies in the
nginx container build.
@dchiller dchiller marked this pull request as ready for review March 22, 2024 11:23
app/install-packages.sh Outdated Show resolved Hide resolved
Copy link

@jacobdgm jacobdgm left a comment

Choose a reason for hiding this comment

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

I don't know enough about Poetry for my approval to carry any weight, but I've looked through it and there don't seem to be any egregious errors.

@dchiller dchiller merged commit 68bd70e into DDMAL:main Mar 26, 2024
2 checks passed
@dchiller dchiller deleted the python-dependency-management branch March 26, 2024 13:59
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.

Separate out development and production python dependencies Optimize nginx container build
3 participants