-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for multiple requirement input files
- Loading branch information
Showing
6 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
load("@rules_python//python:pip.bzl", "compile_pip_requirements") | ||
|
||
compile_pip_requirements( | ||
name = "requirements", | ||
extra_args = [ | ||
"--allow-unsafe", | ||
"--resolver=backtracking", | ||
], | ||
requirements_in = [ | ||
"requirements_1.in", | ||
"requirements_2.in", | ||
], | ||
requirements_txt = "requirements.txt", | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ignore_root_user_errors | ||
There are cases when we have to run Python targets with root, e.g., in Docker containers, requiring setting `ignore_root_user_error = True` when registering Python toolchain. This test makes sure that rules_python works in this case. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
workspace(name = "multiple_requirements_in") | ||
|
||
local_repository( | ||
name = "rules_python", | ||
path = "../..", | ||
) | ||
|
||
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") | ||
|
||
py_repositories() | ||
|
||
load("@rules_python//python/pip_install:repositories.bzl", "pip_install_dependencies") | ||
|
||
pip_install_dependencies() | ||
|
||
python_register_toolchains( | ||
name = "python39", | ||
python_version = "3.9", | ||
) |
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
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_requirements_in:requirements.update | ||
# | ||
attrs==22.2.0 \ | ||
--hash=sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836 \ | ||
--hash=sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99 | ||
# via -r tests/multiple_requirements_in/requirements_2.in | ||
urllib3==1.26.14 \ | ||
--hash=sha256:076907bf8fd355cde77728471316625a4d2f7e713c125f51953bb5b3eecf4f72 \ | ||
--hash=sha256:75edcdc2f7d85b137124a6c3c9fc3933cdeaa12ecb9a6a959f22797a0feca7e1 | ||
# via -r tests/multiple_requirements_in/requirements_1.in |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
urllib3 ~= 1.26 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
attrs ~= 22.2 |