-
Notifications
You must be signed in to change notification settings - Fork 68
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
Split dependencies #237
Conversation
c4eae37
to
a29aa78
Compare
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.
a29aa78
to
14a5126
Compare
|
||
e.g. (inside your virtualenv or whatever) | ||
|
||
pip install -r requirements.txt | ||
[uv] pip install -r requirements.prod.txt -r requirements.dev.txt |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
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