Open mcowpert opened 2 years ago
This is what I get when running on a package that doesn't exist (happens if I run on a mix of packages that do or don't exist):
λ mypy -p doesnotexist
Can't find package 'doesnotexist'
Could you provide a clearer repro? Feel free to re-open once you do
Thanks for looking at this. My team is just starting out on upgrading our Python from 3.6 to 3.10. This is the first chance I've had to reproduce the above with mypy 1.5.
The following is what I encountered when trying to reproduce. This command line ought to work, I think, as evidenced by the package listing.
$ pip list | grep rad
rad.rpi 3.0.0 /home/$REPO/rad_rpi
rad.util 3.0.0 /home/$REPO/rad_util
$ mypy -p rad.util
mypy: can't find package 'rad.util'
All of our packages are namespace-based (PEP420); could that be where the problem lies? mypy -p pip
scans that package as expected.
Until I get past the above, I can't reproduce the problem originally described.
Incidentally, I've corrected an error in the original description; there were two uses of the word "type" that should have been "typo".
Feature
When the command line is issued specifying scan targets using
-p
or-m
, verify that a package is importable under that name and fail if not.Pitch
I was scanning two related packages using:
mypy --namespace_packages -p namesp.pkg1 -p namesp_pkg2
The second was a typo, the folder name for the (namespace) package that was a child of$PWD
. I got error messages, but they were very confusing, about a file being found in two locations (where the "same" command line, as I thought, had worked properly just two days before). I didn't figure out it was a typo for quite some time. But obviously, there is no packagenamesp_pkg2
and an error to that effect would have saved me some time.