Skip to content
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

Error with rules_python-0.13.0 #69

Closed
ph03 opened this issue Oct 14, 2022 · 3 comments
Closed

Error with rules_python-0.13.0 #69

ph03 opened this issue Oct 14, 2022 · 3 comments

Comments

@ph03
Copy link

ph03 commented Oct 14, 2022

Upgrading to rules_python-0.13.0 results in

external/mypy_integration/mypy/BUILD:3:10: no such package '@mypy_integration_pip_deps_mypy//': The repository '@mypy_integration_pip_deps_mypy' could not be resolved: Repository '@mypy_integration_pip_deps_mypy' is not defined and referenced by '@mypy_integration//mypy:mypy'

which is likely due to bazelbuild/rules_python#807 which suggest to change to pip_parse instead of pip_install.

@cristifalcas
Copy link

you can add this after loading the repo:

pip_parse(
    name = "mypy_integration_pip_deps",
    python_interpreter_target = python_interpreter,
    requirements_lock = "//path/to/local/lock_file/mypy:requirements3.lock.txt",
)

load("@mypy_integration_pip_deps//:requirements.bzl", install_deps_mypy="install_deps")

install_deps_mypy()

@ph03
Copy link
Author

ph03 commented Oct 27, 2022

Works great, thanks! Only additional step that was missing was adding additional dependencies of mypy, e.g.,

tomli==2.0.1
typing-extensions==4.4.0
mypy-extensions==0.4.3

to the requirements lock file (I was only using mypy==0.981 before - unsure how they were pulled in automatically before?)

@adzenith
Copy link
Collaborator

adzenith commented Feb 3, 2024

We've got a couple open PRs now that are upgrading the Python rules, so I'm going to close this in favor of those:

@adzenith adzenith closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants