File tree Expand file tree Collapse file tree 2 files changed +21
-21
lines changed Expand file tree Collapse file tree 2 files changed +21
-21
lines changed Original file line number Diff line number Diff line change 42
42
taplo validate --colors never --no-schema
43
43
taplo fmt --colors never --check
44
44
45
- - uses : astral-sh/setup-uv@v5
46
- with :
47
- enable-cache : true
45
+ - uses : astral-sh/setup-uv@v6
48
46
- run : uv sync --only-group=list_and_test
49
47
50
48
- name : ruff
68
66
steps :
69
67
- uses : actions/checkout@v4
70
68
71
- - uses : astral-sh/setup-uv@v5
69
+ - uses : astral-sh/setup-uv@v6
72
70
with :
73
71
enable-cache : true
74
72
python-version : ${{ matrix.py }}
86
84
steps :
87
85
- uses : actions/checkout@v4
88
86
89
- - uses : astral-sh/setup-uv@v5
87
+ - uses : astral-sh/setup-uv@v6
90
88
with :
91
- enable-cache : true
92
89
python-version : ${{ matrix.py }}
93
90
94
91
- name : mypy
@@ -107,12 +104,9 @@ jobs:
107
104
steps :
108
105
- uses : actions/checkout@v4
109
106
110
- - uses : astral-sh/setup-uv@v5
107
+ - uses : astral-sh/setup-uv@v6
111
108
with :
112
- enable-cache : true
113
109
python-version : ${{ matrix.py }}
114
110
115
111
- 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 30
30
CWD = Path .cwd ()
31
31
TOOL_DIR = Path (__file__ ).parent
32
32
SITE_DIR = Path (sysconfig .get_paths ()["purelib" ])
33
- ROOT_DIR = TOOL_DIR .parent
34
-
35
33
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
41
46
42
47
ALLOWLISTS = [
43
48
"common.txt" ,
@@ -130,9 +135,10 @@ def _rewrite_mypy_output(line: bytes, /) -> bytes:
130
135
if package_lib in line :
131
136
line = line .replace (package_lib , package_src )
132
137
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 ())
136
142
137
143
return line
138
144
You can’t perform that action at this time.
0 commit comments