File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 taplo validate --colors never --no-schema
4343 taplo fmt --colors never --check
4444
45- - uses : astral-sh/setup-uv@v5
46- with :
47- enable-cache : true
45+ - uses : astral-sh/setup-uv@v6
4846 - run : uv sync --only-group=list_and_test
4947
5048 - name : ruff
6866 steps :
6967 - uses : actions/checkout@v4
7068
71- - uses : astral-sh/setup-uv@v5
69+ - uses : astral-sh/setup-uv@v6
7270 with :
7371 enable-cache : true
7472 python-version : ${{ matrix.py }}
8684 steps :
8785 - uses : actions/checkout@v4
8886
89- - uses : astral-sh/setup-uv@v5
87+ - uses : astral-sh/setup-uv@v6
9088 with :
91- enable-cache : true
9289 python-version : ${{ matrix.py }}
9390
9491 - name : mypy
@@ -107,12 +104,9 @@ jobs:
107104 steps :
108105 - uses : actions/checkout@v4
109106
110- - uses : astral-sh/setup-uv@v5
107+ - uses : astral-sh/setup-uv@v6
111108 with :
112- enable-cache : true
113109 python-version : ${{ matrix.py }}
114110
115111 - name : stubtest
116- run : >
117- uv run --no-dev --active -p ${{ matrix.py }}
118- tool/stubtest.py
112+ run : uv run --active -p ${{ matrix.py }} tool/stubtest.py
Original file line number Diff line number Diff line change 3030CWD = Path .cwd ()
3131TOOL_DIR = Path (__file__ ).parent
3232SITE_DIR = Path (sysconfig .get_paths ()["purelib" ])
33- ROOT_DIR = TOOL_DIR .parent
34-
3533
36- ROOT_SITE_DIR = (
37- ROOT_DIR / ".venv" / "Lib" / "site-packages"
38- if sys .platform == "win32"
39- else next ((ROOT_DIR / ".venv" / "lib" ).glob ("*/site-packages" ))
40- )
34+ ROOT_DIR = TOOL_DIR .parent
35+ __root_site : Path | None
36+ if (ROOT_DIR / ".venv" ).is_dir ():
37+ __root_venv = ROOT_DIR / ".venv"
38+ __root_site = (
39+ __root_venv / "Lib" / "site-packages"
40+ if sys .platform == "win32"
41+ else next ((__root_venv / "lib" ).glob ("*/site-packages" ))
42+ )
43+ else :
44+ __root_site = None
45+ ROOT_SITE_DIR = __root_site
4146
4247ALLOWLISTS = [
4348 "common.txt" ,
@@ -130,9 +135,10 @@ def _rewrite_mypy_output(line: bytes, /) -> bytes:
130135 if package_lib in line :
131136 line = line .replace (package_lib , package_src )
132137
133- site_dir = str (SITE_DIR ).encode ()
134- if site_dir in line :
135- line = line .replace (site_dir , str (ROOT_SITE_DIR .relative_to (CWD )).encode ())
138+ if ROOT_SITE_DIR is not None :
139+ site_dir = str (SITE_DIR ).encode ()
140+ if site_dir in line :
141+ line = line .replace (site_dir , str (ROOT_SITE_DIR .relative_to (CWD )).encode ())
136142
137143 return line
138144
You can’t perform that action at this time.
0 commit comments