Skip to content

Can't easily initialize pip repos from a macro due to load() restriction #137

Closed

Description

@tmc

example: https://github.com/tmc/pbrtest

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)

Activity

  1. tmc commented on Nov 27, 2018

    @tmc
    Author

    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.

  2. changed the title [-]multiple pip_import seems to break requires[/-] [+]multiple pip_import seems to break requirements[/+] on Nov 27, 2018
  3. brandjon commented on Nov 13, 2019

    @brandjon
    Contributor

    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.

  4. 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
  5. github-actions commented on Apr 14, 2021

    @github-actions
    Contributor

    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!

  6. added
    Can Close?
    on Apr 14, 2021
  7. removed
    Can Close?
    on Apr 19, 2021
  8. groodt commented on Jul 3, 2022

    @groodt
    Contributor

    Closing. pip_import and piptool.py mentioned in the issue and stackoverflow link have been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions