-
-
Notifications
You must be signed in to change notification settings - Fork 750
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 PEP 440 style requirements #5673
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds support for PEP 440 requirements instead of using the pip-specific VCS format. see: https://peps.python.org/pep-0440/#direct-references This facilitates using newer tooling that does not support using the legacy pip VCS format. I adjusted the dist_utils.py functions to maintain the same functionality. Note however that I plan to use pants to replace all the python packaging bits, including dist_utils.py. So the dist_utils.py changes are a stop-gap to keep things working until we get the rest of the pants changes in.
Adding `platform_system=="Linux"` makes some development on MacOS X possible. It at least makes it possible to build a virtualenv.
This is not needed during `make wheelhouse` in st2-packages. But, rpmbuild runs fixate-requirements again when running build_os_package.sh in a new rpmbuild venv that does not have pip-20 yet. So, this makes that corner case in our circleci workflow work like.
rush-skills
approved these changes
Jul 19, 2022
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.
LGTM
amanda11
approved these changes
Jul 25, 2022
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.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
external dependency
pantsbuild
refactor
size/L
PR that changes 100-499 lines. Requires some effort to review.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for PEP 440 requirements instead of using the pip-specific VCS format.
see: https://peps.python.org/pep-0440/#direct-references
This facilitates using newer tooling that does not support using the legacy pip VCS format.
Summary of changes:
*requirements.txt
: reformat 6 requirements repeated across 11 files (this is the primary part of the PR, everything else supports it)dist_utils.py
scripts/fixate-requirements.py
*requirements.txt
So, this change moves from this legacy pip VCS format:
st2/requirements.txt
Lines 23 to 25 in be437e9
to this PEP 440 direct reference format:
st2/requirements.txt
Lines 69 to 71 in 4d46a28
logshipper
is one of the VCS requirements that we convert to PEP 440. It is linux-only and cannot be installed on MacOS X. So, this also addsplatform_system=="Linux"
to the logshipper dep (which was already done for logshipper's pyinotify dep) to allow building a virtualenv on MacOS X. That looks like this:st2/requirements.txt
Line 31 in 4d46a28
And it standardizes the markers format (space before and after
;
) of thepyinotify
dep which is required by logshipper.dist_utils.py
I adjusted the
dist_utils.py
functions to maintain the same functionality. Note however that I plan to use pants to replace all the python packaging bits, including dist_utils.py. So the dist_utils.py changes are a stop-gap to keep things working until we get the rest of the pants changes in. I added these lines to 20 copies of thedist_utils.py
file:st2/scripts/dist_utils.py
Lines 125 to 130 in 2b0cd75
fixate-requirements.py
I also had to make a slight adjustment to
fixate-requirements.py
. This codepath is only used on CircleCI during package build when rpmbuild runs a make target that runs fixate-requirements. It does not run normally because we use pip 20, but rpmbuild runs the script before pipis updated from 19 to 20. So, this makes that corner case in our circleci workflow work like everywhere else we run fixate-requirements. Here is the new code infixate-requirements.py
:st2/scripts/fixate-requirements.py
Lines 228 to 235 in 97dd34f
This depends on StackStorm/st2-packages#722