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

Split dependencies #237

Merged
merged 4 commits into from
Jun 2, 2024
Merged

Split dependencies #237

merged 4 commits into from
Jun 2, 2024

Conversation

ghickman
Copy link
Contributor

I can't see any prod configuration in the repo, so the only change we'd need to make to deploy this is s/requirements.txt/requirements.prod.txt/, and then we'd be installing several fewer packages.

Locally, a user can now run make compile to get updated requirements files. I'll look at scripting this further in the future so the compiled files and when to update them become an implementation detail, but for now, this moves us along nicely!

Fix: #198

This breaks up requirements.in into two files.  The dev spec file,
requirements.dev.txt, has a constraint on the compiled prod file so that
we can both avoid duplicating requirements between the files but also
avoid conflicting requirements.

By doing a compile on new files we're going to get brand new versions,
effectively doing an upgrade to everything.  So this commit maintains
the existing requirements.txt purely to constrain the compilation and
avoid this situation.
Now that we've generated the split compiled files using the old
requirements.txt as a constraint, we can remove that file, the
constraint, and re-compile.  This removes requirements.txt and updates
the formatting for all requirements without bumping versions.
Note: pip-tools is making --strip-extras the default in 8.0, which uv
has copied by default.

This change also ensures a user has uv installed in the local venv so
the tooling works, and can take advantage of the python that venv is
using.
README.markdown Show resolved Hide resolved

e.g. (inside your virtualenv or whatever)

pip install -r requirements.txt
[uv] pip install -r requirements.prod.txt -r requirements.dev.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Perhaps we should be recommending make build here instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think there's a lot we can do here with a scripted stack to remove the need for most of this type of documentation and also use the same stack in CI. For example, [just|make] test would run the pytest installed in the correct venv in a way that a user could pass options to it locally.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool OK -- I'll leave that for the readme fix!

README.markdown Show resolved Hide resolved
@ghickman ghickman mentioned this pull request May 26, 2024
@meshy meshy merged commit d68ae31 into main Jun 2, 2024
1 check passed
@meshy meshy deleted the split-dependencies branch June 2, 2024 10:17
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.

Split prod and dev requirements
2 participants