Skip to content

Commit

Permalink
waht
Browse files Browse the repository at this point in the history
  • Loading branch information
PedramNavid committed Aug 9, 2024
1 parent 70f26b4 commit 8a0603a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions scripts/run-pyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,15 @@ def map_paths_to_envs(paths: Sequence[str]) -> Mapping[str, Sequence[str]]:
env_path_map: Dict[str, List[str]] = {}
for path in paths:
if os.path.isdir(path) or os.path.splitext(path)[1] in [".py", ".pyi"]:
try:
env = next(
(
env_path_spec["env"]
for env_path_spec in env_path_specs
if match_path(path, env_path_spec)
)
)
except StopIteration:
print(f"Trying to match path: {path}") # Debug print
for env_path_spec in env_path_specs:
print(f" Checking env: {env_path_spec['env']}") # Debug print
if match_path(path, env_path_spec):
print(" Matched!") # Debug print
env_path_map.setdefault(env_path_spec["env"], []).append(path)
break
else:
raise Exception(f"Could not find environment that matched path: {path}.")
env_path_map.setdefault(env, []).append(path)
return env_path_map


Expand Down

0 comments on commit 8a0603a

Please sign in to comment.