Skip to content

Commit

Permalink
Remove base path from MYPYPATH
Browse files Browse the repository at this point in the history
After python/mypy#11143, the search path for
mypy has changed, resulting in the current path being present.

Explicitly adding in the base path results in an error about the
directory from the search_path (cwd) being present in `MYPYPATH`.

Removing the base path from `MYPYPATH` and relying on just `pyinfo` to
load the current path in appears to work as expected.
  • Loading branch information
DamianZaremba committed Jul 20, 2022
1 parent e3ce0bf commit c10b039
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
2 changes: 0 additions & 2 deletions pytest_mypy_plugins/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,6 @@ def _collect_mypy_path(self, rootdir: Optional[Path]) -> None:
existing_mypy_path = os.environ.get("MYPYPATH")
if existing_mypy_path:
mypy_path_parts.append(existing_mypy_path)
if self.base_ini_fpath:
mypy_path_parts.append(os.path.dirname(self.base_ini_fpath))
mypy_path_key = self.environment_variables.get("MYPYPATH")
if mypy_path_key:
mypy_path_parts.append(maybe_to_abspath(mypy_path_key, rootdir))
Expand Down
29 changes: 0 additions & 29 deletions pytest_mypy_plugins/tests/test-paths-from-env.yml

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

dependencies = [
"pytest>=6.0.0",
"mypy>=0.900",
"mypy>=0.971",
"decorator",
"pyyaml",
"chevron",
Expand Down

0 comments on commit c10b039

Please sign in to comment.