Closed
Description
Bug Report
I'm running into some issues in some scripting where we have a local repository of stubs that generally sits in the repository at some path relative to the python code in the project. Our linting scripts might look something like:
MYPYPATH=${PWD}/../stubs
This seems to be causing some issues in
Lines 816 to 842 in 3c7e216
Would it be problematic to normalize the paths before doing the p.startswith(...)
check?
To Reproduce
- Find a python file that you want to check by itself.
- change your working directory to be the same directory as the file to check
- Run something like
MYPYPATH=${PWD}/../any_sibling_directory mypy file_to_check.py
(edit as necessary if you don't usebash
:)
Expected Behavior
I would expect mypy to be able to check this file without any problems.
Actual Behavior
mypy basically just says it won't check the file and exits (with a non-successful exit status)
Your Environment
- Mypy version used: 0.971
- Mypy command-line flags: reproduced with/without
--strict
- Mypy configuration options from
mypy.ini
(and other config files): - Python version used: python3.8
- Operating system and version: Linux (ubuntu 20.04)