-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnoxfile.py
More file actions
26 lines (20 loc) · 807 Bytes
/
noxfile.py
File metadata and controls
26 lines (20 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import nox
import os
import glob
@nox.session(python=['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3'])
def tests(session):
session.run("pdm", "build")
session.install("pytest")
# Find the whl packages. We're going to sort by newest to oldest
# so for testing we can install the freshest copy
package_files = sorted(
glob.glob("dist/swampyer-*.whl"),
key=os.path.getmtime,
reverse=True
)
if not package_files:
raise FileNotFoundError("No swampyer-VERSION.whl package found in the 'dist' directory.")
# Install the built package
session.install("--force-reinstall", package_files[0]+"[all]")
# Run tests
session.run("pytest", "--log-cli-level=WARN", "-s")