4
4
5
5
import nox # type: ignore
6
6
7
- PYTHON_ALL_VERSIONS = ["3.8 " , "3.9 " , "3.10" , "3.11 " ]
8
- PYTHON_DEFAULT_VERSION = "3.11 "
7
+ PYTHON_ALL_VERSIONS = ["3.12 " , "3.11 " , "3.10" , "3.9" , "3.8 " ]
8
+ PYTHON_DEFAULT_VERSION = "3.12 "
9
9
DOC_DEPENDENCIES = ["." , "jinja2" , "mkdocs" , "mkdocs-material" ]
10
10
MAN_DEPENDENCIES = ["." , "argparse-manpage[setuptools]" ]
11
11
LINT_DEPENDENCIES = [
12
- "black==23.10.1" ,
13
- "mypy==1.6.1" ,
12
+ "mypy==1.7.1" ,
14
13
"packaging>=20.0" ,
15
- "ruff==0.1.3 " ,
14
+ "ruff==0.1.6 " ,
16
15
"types-jinja2" ,
17
16
]
18
17
# Packages whose dependencies need an intact system PATH to compile
@@ -51,11 +50,7 @@ def prebuild_wheels(session, prebuild_dict):
51
50
52
51
def has_changes ():
53
52
status = (
54
- subprocess .run (
55
- "git status --porcelain" , shell = True , check = True , stdout = subprocess .PIPE
56
- )
57
- .stdout .decode ()
58
- .strip ()
53
+ subprocess .run ("git status --porcelain" , shell = True , check = True , stdout = subprocess .PIPE ).stdout .decode ().strip ()
59
54
)
60
55
return len (status ) > 0
61
56
@@ -103,7 +98,7 @@ def tests_with_options(session, net_pypiserver):
103
98
if net_pypiserver :
104
99
pypiserver_option = ["--net-pypiserver" ]
105
100
else :
106
- session .install ("pypiserver[passlib]" )
101
+ session .install ("pypiserver[passlib]" , 'setuptools; python_version>="3.12"' )
107
102
refresh_packages_cache (session )
108
103
pypiserver_option = []
109
104
@@ -152,16 +147,14 @@ def cover(session):
152
147
def lint (session ):
153
148
session .run ("python" , "-m" , "pip" , "install" , "--upgrade" , "pip" )
154
149
session .install (* LINT_DEPENDENCIES )
155
- files = [str (Path ("src" ) / "pipx" ), "tests" , "scripts" ] + [
156
- str (p ) for p in Path ("." ).glob ("*.py" )
157
- ]
150
+ files = [str (Path ("src" ) / "pipx" ), "tests" , "scripts" ] + [str (p ) for p in Path ("." ).glob ("*.py" )]
158
151
session .run ("ruff" , * files )
159
- session .run ("black" , "--check" , * files )
160
152
session .run (
161
153
"mypy" ,
162
154
"--strict-equality" ,
163
155
"--no-implicit-optional" ,
164
156
"--warn-unused-ignores" ,
157
+ "--check-untyped-defs" ,
165
158
* files ,
166
159
)
167
160
@@ -170,7 +163,7 @@ def lint(session):
170
163
def develop (session ):
171
164
session .run ("python" , "-m" , "pip" , "install" , "--upgrade" , "pip" )
172
165
session .install (* DOC_DEPENDENCIES , * LINT_DEPENDENCIES )
173
- session .install ("-e" , "." )
166
+ session .install ("-e" , "." , "pytest" , "pypiserver[passlib]" , 'setuptools; python_version>="3.12"' )
174
167
175
168
176
169
@nox .session (python = PYTHON_DEFAULT_VERSION )
@@ -196,9 +189,7 @@ def build_docs(session):
196
189
site_dir = session .posargs or ["site/" ]
197
190
session .run ("python" , "-m" , "pip" , "install" , "--upgrade" , "pip" )
198
191
session .install (* DOC_DEPENDENCIES )
199
- session .env [
200
- "PIPX__DOC_DEFAULT_PYTHON"
201
- ] = "typically the python used to execute pipx"
192
+ session .env ["PIPX__DOC_DEFAULT_PYTHON" ] = "typically the python used to execute pipx"
202
193
session .run ("python" , "scripts/generate_docs.py" )
203
194
session .run ("mkdocs" , "build" , "--strict" , "--site-dir" , * site_dir )
204
195
@@ -214,9 +205,7 @@ def watch_docs(session):
214
205
def build_man (session ):
215
206
session .run ("python" , "-m" , "pip" , "install" , "--upgrade" , "pip" )
216
207
session .install (* MAN_DEPENDENCIES )
217
- session .env [
218
- "PIPX__DOC_DEFAULT_PYTHON"
219
- ] = "typically the python used to execute pipx"
208
+ session .env ["PIPX__DOC_DEFAULT_PYTHON" ] = "typically the python used to execute pipx"
220
209
session .run ("python" , "scripts/generate_man.py" )
221
210
222
211
@@ -247,17 +236,14 @@ def post_release(session):
247
236
session .run ("git" , "--no-pager" , "diff" , external = True )
248
237
print ("" )
249
238
session .log (
250
- "If `git diff` above looks ok, execute the following command:\n \n "
251
- " git commit -a -m 'Post-release.'\n "
239
+ "If `git diff` above looks ok, execute the following command:\n \n " " git commit -a -m 'Post-release.'\n "
252
240
)
253
241
254
242
255
243
@nox .session (python = PYTHON_ALL_VERSIONS )
256
244
def create_test_package_list (session ):
257
245
session .run ("python" , "-m" , "pip" , "install" , "--upgrade" , "pip" )
258
- output_dir = (
259
- session .posargs [0 ] if session .posargs else str (PIPX_TESTS_PACKAGE_LIST_DIR )
260
- )
246
+ output_dir = session .posargs [0 ] if session .posargs else str (PIPX_TESTS_PACKAGE_LIST_DIR )
261
247
session .run (
262
248
"python" ,
263
249
"scripts/list_test_packages.py" ,
0 commit comments