-
-
Notifications
You must be signed in to change notification settings - Fork 677
fix: pip_compile to handle multiple generated requirements.in #909
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4dd16ed
fix: pip_compile to handle multiple generated requirements.in
f0rmiga 1868304
fix: only use requirements.in absolute when generated
f0rmiga bd75379
fix: use hermetic toolchain to lock the requirements
f0rmiga 1eeabd8
fix: tests on CI
f0rmiga 0175da8
fix: windows path separator madness
f0rmiga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
File renamed without changes.
This file contains hidden or 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 file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| test --test_output=errors | ||
|
|
||
| # Windows requires these for multi-python support: | ||
| build --enable_runfiles | ||
| startup --windows_enable_symlinks |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| bazel-* |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| load("@rules_python//python:pip.bzl", "compile_pip_requirements") | ||
|
|
||
| genrule( | ||
| name = "generate_requirements_extra_in", | ||
| srcs = [], | ||
| outs = ["requirements_extra.in"], | ||
| cmd = "echo 'setuptools~=65.6.3' > $@", | ||
| ) | ||
|
|
||
| genrule( | ||
| name = "generate_requirements_in", | ||
| srcs = [], | ||
| outs = ["requirements.in"], | ||
| cmd = """ | ||
| cat > $@ <<EOF | ||
| -r requirements_extra.in | ||
| pip~=22.3.1 | ||
| EOF | ||
| """, | ||
| ) | ||
|
|
||
| compile_pip_requirements( | ||
| name = "pip_dependencies", | ||
| data = [ | ||
| "requirements_extra.in", | ||
| ], | ||
| extra_args = [ | ||
| "--allow-unsafe", | ||
| "--resolver=backtracking", | ||
| ], | ||
| requirements_in = "requirements.in", | ||
| requirements_txt = "requirements_lock.txt", | ||
| ) |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # compile_pip_requirements | ||
|
|
||
| This test ensures that generated requirements.in can be used by compile_pip_requirements. |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| local_repository( | ||
| name = "rules_python", | ||
| path = "../..", | ||
| ) | ||
|
|
||
| load("@rules_python//python/pip_install:repositories.bzl", "pip_install_dependencies") | ||
|
|
||
| pip_install_dependencies() | ||
|
|
||
| load("@rules_python//python:repositories.bzl", "python_register_toolchains") | ||
|
|
||
| python_register_toolchains( | ||
| name = "python39", | ||
| python_version = "3.9", | ||
| ) |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # | ||
| # This file is autogenerated by pip-compile with python 3.9 | ||
| # To update, run: | ||
| # | ||
| # bazel run //:pip_dependencies.update | ||
| # | ||
|
|
||
| # The following packages are considered to be unsafe in a requirements file: | ||
| pip==22.3.1 \ | ||
| --hash=sha256:65fd48317359f3af8e593943e6ae1506b66325085ea64b706a998c6e83eeaf38 \ | ||
| --hash=sha256:908c78e6bc29b676ede1c4d57981d490cb892eb45cd8c214ab6298125119e077 | ||
| # via -r ./requirements.in | ||
| setuptools==65.6.3 \ | ||
| --hash=sha256:57f6f22bde4e042978bcd50176fdb381d7c21a9efa4041202288d3737a0c6a54 \ | ||
| --hash=sha256:a7620757bf984b58deaf32fc8a4577a9bbc0850cf92c20e1ce41c38c19e5fb75 | ||
| # via -r ./requirements_extra.in |
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.
Uh oh!
There was an error while loading. Please reload this page.