-
-
Notifications
You must be signed in to change notification settings - Fork 594
feat: update compile_pip_requirements
to support multiple input files
#1067
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
rickeylev
merged 16 commits into
bazel-contrib:main
from
cj81499:multiple-requirements-in
Aug 15, 2024
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d1e0b52
add support for multiple requirement input files
cj81499 c78e39a
update src -> srcs in `CHANGELOG.md`
cj81499 8ead158
Merge remote-tracking branch 'upstream/main' into multiple-requiremen…
cj81499 4fdb093
Merge remote-tracking branch 'upstream/main' into multiple-requiremen…
cj81499 66aad4f
Merge remote-tracking branch 'upstream/main' into multiple-requiremen…
cj81499 68da5c0
Merge remote-tracking branch 'upstream/main' into multiple-requiremen…
cj81499 8913365
fix failing tests
cj81499 a976ed3
fix failing `compile_pip_requirements` on windows
cj81499 9eb1914
try `@@platforms`...?
cj81499 9a5653c
use `src` rather than `srcs` when only one requirements file is needed
cj81499 2f80e2b
review feedback
cj81499 4f2aaaa
Merge branch 'bazelbuild:main' into multiple-requirements-in
cj81499 c781e35
Merge branch 'main' into multiple-requirements-in
aignas 1f12338
Update python/private/pypi/pip_compile.bzl
aignas fc1fb12
cleanup the code and fix the indentation
aignas a10e9e8
typo: windows -> Windows
rickeylev 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
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,30 @@ | ||
load("@rules_python//python:pip.bzl", "compile_pip_requirements") | ||
|
||
compile_pip_requirements( | ||
name = "multiple_requirements_in", | ||
srcs = [ | ||
"requirements_1.in", | ||
"requirements_2.in", | ||
], | ||
requirements_txt = "multiple_requirements_in.txt", | ||
) | ||
|
||
compile_pip_requirements( | ||
name = "multiple_pyproject_toml", | ||
srcs = [ | ||
"a/pyproject.toml", | ||
"b/pyproject.toml", | ||
], | ||
requirements_txt = "multiple_pyproject_toml.txt", | ||
) | ||
|
||
compile_pip_requirements( | ||
name = "multiple_inputs", | ||
srcs = [ | ||
cj81499 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"a/pyproject.toml", | ||
"b/pyproject.toml", | ||
"requirements_1.in", | ||
"requirements_2.in", | ||
], | ||
requirements_txt = "multiple_inputs.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 @@ | ||
# multiple_inputs | ||
|
||
Test that `compile_pip_requirements` works as intended when using more than one input file. |
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 @@ | ||
[project] | ||
name = "multiple_inputs_1" | ||
version = "0.0.0" | ||
|
||
dependencies = ["urllib3"] |
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 @@ | ||
[project] | ||
name = "multiple_inputs_2" | ||
version = "0.0.0" | ||
|
||
dependencies = ["attrs"] |
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,18 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.11 | ||
# by the following command: | ||
# | ||
# bazel run //tests/multiple_inputs:multiple_inputs.update | ||
# | ||
attrs==23.1.0 \ | ||
--hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ | ||
--hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 | ||
# via | ||
# -r tests/multiple_inputs/requirements_2.in | ||
# multiple_inputs_2 (tests/multiple_inputs/b/pyproject.toml) | ||
urllib3==2.0.7 \ | ||
--hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \ | ||
--hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e | ||
# via | ||
# -r tests/multiple_inputs/requirements_1.in | ||
# multiple_inputs_1 (tests/multiple_inputs/a/pyproject.toml) |
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,14 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.11 | ||
# by the following command: | ||
# | ||
# bazel run //tests/multiple_inputs:multiple_pyproject_toml.update | ||
# | ||
attrs==23.1.0 \ | ||
--hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ | ||
--hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 | ||
# via multiple_inputs_2 (tests/multiple_inputs/b/pyproject.toml) | ||
urllib3==2.0.7 \ | ||
--hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \ | ||
--hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e | ||
# via multiple_inputs_1 (tests/multiple_inputs/a/pyproject.toml) |
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,14 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.11 | ||
# by the following command: | ||
# | ||
# bazel run //tests/multiple_inputs:multiple_requirements_in.update | ||
# | ||
attrs==23.1.0 \ | ||
--hash=sha256:1f28b4522cdc2fb4256ac1a020c78acf9cba2c6b461ccd2c126f3aa8e8335d04 \ | ||
--hash=sha256:6279836d581513a26f1bf235f9acd333bc9115683f14f7e8fae46c98fc50e015 | ||
# via -r tests/multiple_inputs/requirements_2.in | ||
urllib3==2.0.7 \ | ||
--hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \ | ||
--hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e | ||
# via -r tests/multiple_inputs/requirements_1.in |
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 @@ | ||
urllib3 |
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 @@ | ||
attrs |
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.