bazel-mypy-integration icon indicating copy to clipboard operation
bazel-mypy-integration copied to clipboard

no such package '@mypy_integration_pip_deps//pypi__typed_ast' when using mypy_version >= 0.900

Open mhansen opened this issue 4 years ago β€’ 3 comments

Hi, just reporting this as FYI. It's not really causing me any trouble, I'm happy on mypy version 0.812, just thought I'd start a thread in case this is impacting others.

If I change my mypy_version.txt file to contain:

mypy==0.900

Then I get this error when I try to build a mypy_test

ERROR: /private/var/tmp/_bazel_mark/c85e0696457b3a2f404f0721275052b4/external/mypy_integration/mypy/BUILD:3:10: no such package '@mypy_integration_pip_deps//pypi__typed_ast': BUILD file not found in directory 'pypi__typed_ast' of external repository @mypy_integration_pip_deps. Add a BUILD file to a directory to mark it as a package. and referenced by '@mypy_integration//mypy:mypy'

I wonder if this is something to do with the release notes of mypy 0.900: http://mypy-lang.org/news.html

The next mypy release will no longer bundle stubs for third-party libraries. Read this blog post if you are interested in what this means to mypy users and why we are doing this.

mhansen avatar Aug 01 '21 01:08 mhansen

Just remove these lines: https://github.com/thundergolfer/bazel-mypy-integration/blob/061dd0b869f8f1d9ba28a5bd43bcf077f0cc19bc/mypy/BUILD#L11-L14 They aren't needed, since transitive dependencies are automatically brought in when you depend on requirement("mypy").

The reason this results in an error is because mypy no longer depends on typed_ast in Python >= 3.9. So the pip_install here does not download it. That's what the error message you're getting is trying to tell you.

ender-wieczorek avatar Oct 19 '21 03:10 ender-wieczorek

Sounds good. Would you like to send a pull request proposing that change?

On Tue, 19 Oct 2021 at 14:36, ender-wieczorek @.***> wrote:

Just remove these lines: https://github.com/thundergolfer/bazel-mypy-integration/blob/061dd0b869f8f1d9ba28a5bd43bcf077f0cc19bc/mypy/BUILD#L11-L14 They aren't needed, since transitive dependencies are automatically brought in when you depend on requirement("mypy").

The reason this results in an error is because mypy no longer depends on typed_ast in Python >= 3.9. So the pip_install here https://github.com/thundergolfer/bazel-mypy-integration/blob/061dd0b869f8f1d9ba28a5bd43bcf077f0cc19bc/repositories/py_repositories.bzl#L18 does not download it. That's what the error message you're getting is trying to tell you.

β€” You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/thundergolfer/bazel-mypy-integration/issues/41#issuecomment-946339698, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAZYOIAUSHUZ6MTCWYQDHTUHTRSTANCNFSM5BKSLCWQ .

mhansen avatar Oct 19 '21 05:10 mhansen

Here you go: https://github.com/thundergolfer/bazel-mypy-integration/pull/45

robbrit avatar Dec 09 '21 22:12 robbrit