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 pip-tools for managing dependencies #281

Merged
merged 8 commits into from
Nov 18, 2023
Merged

Conversation

amstilp
Copy link
Contributor

@amstilp amstilp commented Nov 18, 2023

This will pin the exact versions of the packages we are using, which will let us identify updates to packages that are not directly specified in the requirements file but are dependencies.

  • Move requirements into three files:
    • requirements.in: base requirements, used for production
    • test-requirements.in: additional requirements for testing on top of base/rpod
    • dev-requirements.in: additional requirements on top of base/prod and test for local development
  • Update CI to work with new requirements files

Note: to create the initial requirements files:

  • Copy the output of pip freeze on the staging server to requirements.txt
  • Copy the output of pip freeze on my dev machine to test-requirements.txt and dev-requirements.txt
  • Run pip-compile on base requirements: pip-compile requirements.in
  • Run pip-compile on test requirements: pip-compile test-requirements.in
  • Run pip-compile on dev requirements: pip-compile dev-requirements.in

These steps preserve the package versions that we have installed on the staging server as much as possible, so that we can address any package updates via dependabot after this branch is merged.

This is in preparation for using pip-tools -- pip-compile will
try to use the versions in this file if possible. We want to start
with the same versions that are installed on the staging server.
Add package requirements to requirements.in using base.txt and
stripping versions. Then compile requirements.txt using pip-compile.
Because requirements.txt already had all the staging server package
versions pinnned, this step should not have changed any versions -
just added packages required by pip-tools or removed packages that
were not in the base requirements.
Add a test-requirements.in and companion test-requirements.txt
file. For test-requirements.txt, start with the pip freeze versions
that I have in my current dev setup.
Add both the dev-requirements.in and compiled dev-requirements.txt
files. For dev-requirements.txt, start with the pinned versions
that were installed in my dev environment; this way, it's the closest
to what I've been developing with.
Copy link

codecov bot commented Nov 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7bd8987) 98.26% compared to head (2a2abee) 98.26%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #281   +/-   ##
=======================================
  Coverage   98.26%   98.26%           
=======================================
  Files         231      231           
  Lines       17786    17786           
=======================================
  Hits        17478    17478           
  Misses        308      308           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amstilp amstilp marked this pull request as ready for review November 18, 2023 01:06
@amstilp amstilp merged commit dcb49fd into main Nov 18, 2023
6 checks passed
@amstilp amstilp mentioned this pull request Nov 30, 2023
@amstilp amstilp deleted the maint/pip-tools branch February 6, 2024 18:36
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.

1 participant