You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't easily initialize pip repos from a macro due to load() restriction #137
ERROR: /Users/tmc/go/src/github.com/tmc/pbrtest/BUILD.bazel:7:1: no such package '@pypi__pbr_1_8_0//': The repository could not be resolved and referenced by '//:x'
ERROR: Analysis of target '//:x' failed; build aborted: no such package '@pypi__pbr_1_8_0//': The repository could not be resolved
INFO: Elapsed time: 0.203s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 0 targets configured)
For what it's worth I came across https://stackoverflow.com/a/50478606 -- should pip_import grow support for multiple requirements files? AFAICT this would decrease burden of repeating dependencies across repository boundaries.
In the example repo you linked, you appear to load pip_install twice but only call it once, for the second repo. You can add a call to pip_install after its first import. For readability, it's probably also a good idea to rename the symbol when loading it, to distinguish which repo it's from.
With #256, the wheel repo names for multiple pip_imports will no longer conflict, so you should be able to have multiple pip_imports that behave independently of each other even when they use the same wheels. Note that you'll get redundant re-downloading of these wheels though.
Let's repurpose this bug to track the issue of not having a convenient way to initialize pip repos within a macro, which I believe is at the heart of the linked SO thread.
changed the title [-]multiple pip_import seems to break requirements[/-][+]Can't easily initialize pip repos from a macro due to load() restriction[/+]on Nov 13, 2019
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!
Activity
tmc commentedon Nov 27, 2018
For what it's worth I came across https://stackoverflow.com/a/50478606 -- should pip_import grow support for multiple requirements files? AFAICT this would decrease burden of repeating dependencies across repository boundaries.
[-]multiple pip_import seems to break requires[/-][+]multiple pip_import seems to break requirements[/+]brandjon commentedon Nov 13, 2019
In the example repo you linked, you appear to load
pip_installtwice but only call it once, for the second repo. You can add a call topip_installafter its first import. For readability, it's probably also a good idea to rename the symbol when loading it, to distinguish which repo it's from.With #256, the wheel repo names for multiple
pip_importswill no longer conflict, so you should be able to have multiplepip_importsthat behave independently of each other even when they use the same wheels. Note that you'll get redundant re-downloading of these wheels though.Let's repurpose this bug to track the issue of not having a convenient way to initialize pip repos within a macro, which I believe is at the heart of the linked SO thread.
[-]multiple pip_import seems to break requirements[/-][+]Can't easily initialize pip repos from a macro due to load() restriction[/+]github-actions commentedon Apr 14, 2021
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!
groodt commentedon Jul 3, 2022
Closing.
pip_importandpiptool.pymentioned in the issue and stackoverflow link have been removed.