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

Refactor dependency pinning to use requirements.in and pip-compile #4

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

rohanpm
Copy link
Member

@rohanpm rohanpm commented Jul 22, 2020

It makes sense to pin dependencies in requirements.txt, but the
naive method of parsing that file from setup.py meant that it was
not possible to use continuation lines (ending with backslash).
This breaks tools such as pip-compile which make it easier to deal
with pinned dependencies.

Refactor it slightly so that:

  • top-level requirements, unpinned, can be listed in requirements.in
  • all requirements, pinned, are listed in requirements.txt which can
    be generated/updated using pip-compile
  • setup.py uses requirements.in
  • CI uses requirements.txt (so tests are repeatable)

Later, container image building would also be expected to use
requirements.txt.

It makes sense to pin dependencies in requirements.txt, but the
naive method of parsing that file from setup.py meant that it was
not possible to use continuation lines (ending with backslash).
This breaks tools such as pip-compile which make it easier to deal
with pinned dependencies.

Refactor it slightly so that:

- top-level requirements, unpinned, can be listed in requirements.in
- all requirements, pinned, are listed in requirements.txt which can
  be generated/updated using pip-compile
- setup.py uses requirements.in
- CI uses requirements.txt (so tests are repeatable)

Later, container image building would also be expected to use
requirements.txt.
@rohanpm rohanpm marked this pull request as ready for review July 22, 2020 06:20
@rohanpm rohanpm requested a review from negillett as a code owner July 22, 2020 06:20
Copy link
Contributor

@lmilbaum lmilbaum left a comment

Choose a reason for hiding this comment

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

LGTM

@rohanpm rohanpm merged commit 9fcffd8 into release-engineering:master Jul 22, 2020
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.

None yet

4 participants