Skip to content

importing latest commit doesnt appear to have pip3_import rules #264

@Chronojam

Description

@Chronojam

Hello,

Hopefully this is the correct place to ask this;
I noticed that you've added some pip3_import rules for us to use - this is amazing, thanks!

Unfortunately im having some issues getting them to run from the latest commit on master (9467740)

Consider the following (snipped) WORKSPACE file

http_archive(
    name = "rules_python",
    url = "https://github.com/bazelbuild/rules_python/archive/94677401bc56ed5d756f50b441a6a5c7f735a6d4.tar.gz",
    strip_prefix = "rules_python-94677401bc56ed5d756f50b441a6a5c7f735a6d4",
    sha256 = "acbd018f11355ead06b250b352e59824fbb9e77f4874d250d230138231182c1c",
)


load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()

load("@rules_python//python:pip.bzl", "pip_repositories", "pip_import")
pip_repositories()

pip_import(
    name = "pip",
    requirements = "//:requirements.txt",
)

load("@pip//:requirements.bzl", "pip_install")

pip_install()

This works correctly, however if you change the references to pip3_import, then things start to break down:

load("@rules_python//python:pip.bzl", "pip_repositories", "pip3_import")
pip3_import(
    name = "pip",
    requirements = "//:requirements.txt",
)
bazel query @pip//:all
INFO: Writing tracer profile to '/home/chronojam/.cache/bazel/_bazel_chronojam/6ef540f26ddde2130d00e03d444521ab/command.profile.gz'
ERROR: /home/chronojam/src/github.com/LakaHQ/drogo/WORKSPACE:102:1: file '@rules_python//python:pip.bzl' does not contain symbol 'pip3_import' (did you mean 'pip_import'
?)
ERROR: /home/chronojam/src/github.com/LakaHQ/drogo/WORKSPACE:106:1: name 'pip3_import' is not defined (did you mean 'cc_import'?)
ERROR: Error evaluating WORKSPACE file

Adding python_interpreter = "python3" into the pip_import statement also does not work.

I know you shouldnt really do this, but changing rules_python to rules_python_new causes things to get a little further:

*snip*
//external:pip_pypi__six_1_13_0: no such attribute 'python_interpreter' in 'whl_library' rule
... for each dependency.

Some part of me feels like a caching issue (perhaps caching an old version of rules_python - but this persists through a bazel clean --expunge).

I dont have this issue with other external dependencies which is why im posting here, understand that it could be in the wrong place, but thank you for taking the time to read, and any advice you could offer would be greatly appreciated, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions