Skip to content

Commit 6c83def

Browse files
committed
add nox
1 parent 56b791b commit 6c83def

File tree

7 files changed

+118
-10
lines changed

7 files changed

+118
-10
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ on:
1212

1313
jobs:
1414
test:
15-
name: 'Python ${{ matrix.python-version }}'
15+
name: 'Python ${{ matrix.python-version }} Django ${{ matrix.django-version }}'
1616
runs-on: ubuntu-latest
1717
strategy:
1818
fail-fast: false
1919
matrix:
2020
python-version: ['3.13', '3.12', '3.11']
21+
# Stay with Django v5.1.x until https://github.com/radiac/django-tagulous/issues/187 is fixed
22+
django-version: ['5.1']
2123
steps:
2224
- name: Checkout
2325
run: |
@@ -51,12 +53,12 @@ jobs:
5153
run: |
5254
./manage.py pip_audit
5355
54-
- name: 'Python ${{ matrix.python-version }}'
56+
- name: 'Python ${{ matrix.python-version }} Django ${{ matrix.django-version }}'
5557
env:
5658
PYTHONUNBUFFERED: 1
5759
PYTHONWARNINGS: always
5860
run: |
59-
./manage.py test
61+
./manage.py nox -e "tests-${{ matrix.python-version }}(django='${{ matrix.django-version }}')"
6062
6163
- name: 'Upload coverage report'
6264
uses: codecov/codecov-action@v5

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ __pycache__
99
!.github
1010
!.run
1111
!.editorconfig
12-
!.flake8
1312
!.gitignore
1413
!.pre-commit-config.yaml
1514
!.pre-commit-hooks.yaml
@@ -20,8 +19,8 @@ __pycache__
2019
!/backups/.gitkeep
2120

2221
# from test projects:
23-
**/static/*
24-
**/media/*
22+
/static/
23+
/media/
2524
*.sqlite3
2625
*.json
2726

.run/manage.py nox.run.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="manage.py nox" type="PythonConfigurationType" factoryName="Python">
3+
<module name="PyInventory" />
4+
<option name="ENV_FILES" value="" />
5+
<option name="INTERPRETER_OPTIONS" value="" />
6+
<option name="PARENT_ENVS" value="true" />
7+
<envs>
8+
<env name="PYTHONUNBUFFERED" value="1" />
9+
</envs>
10+
<option name="SDK_HOME" value="" />
11+
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
12+
<option name="IS_MODULE_SDK" value="true" />
13+
<option name="ADD_CONTENT_ROOTS" value="false" />
14+
<option name="ADD_SOURCE_ROOTS" value="false" />
15+
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
16+
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/manage.py" />
17+
<option name="PARAMETERS" value="nox" />
18+
<option name="SHOW_COMMAND_LINE" value="false" />
19+
<option name="EMULATE_TERMINAL" value="true" />
20+
<option name="MODULE_MODE" value="false" />
21+
<option name="REDIRECT_INPUT" value="false" />
22+
<option name="INPUT_FILE" value="" />
23+
<method v="2" />
24+
</configuration>
25+
</component>

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ To make a new release, do this:
166166

167167
[comment]: <> (✂✂✂ auto generated history start ✂✂✂)
168168

169+
* [**dev**](https://github.com/jedie/PyInventory/compare/v0.21.4...main)
170+
* 2025-09-21 - add nox
169171
* [v0.21.4](https://github.com/jedie/PyInventory/compare/v0.21.3...v0.21.4)
170172
* 2025-09-21 - Because of PyPi download errors: release as v0.21.4
171173
* [v0.21.3](https://github.com/jedie/PyInventory/compare/v0.21.2...v0.21.3)
@@ -183,12 +185,12 @@ To make a new release, do this:
183185
* [v0.21.2](https://github.com/jedie/PyInventory/compare/v0.21.1...v0.21.2)
184186
* 2025-09-09 - Update project, e.g.: Darker -> Ruff and fix tests
185187
* 2025-05-01 - Fix local dev server: Don't enforce https
186-
* [v0.21.1](https://github.com/jedie/PyInventory/compare/v0.21.0...v0.21.1)
187-
* 2025-05-01 - Replace setuptools with hatchling
188-
* 2025-04-30 - Update requirements and some small code parts
189188

190189
<details><summary>Expand older history entries ...</summary>
191190

191+
* [v0.21.1](https://github.com/jedie/PyInventory/compare/v0.21.0...v0.21.1)
192+
* 2025-05-01 - Replace setuptools with hatchling
193+
* 2025-04-30 - Update requirements and some small code parts
192194
* [v0.21.0](https://github.com/jedie/PyInventory/compare/v0.20.1...v0.21.0)
193195
* 2025-03-23 - Bugfix publish: setuptools missing
194196
* 2025-03-23 - Migrate "pip-tools" -> "uv" and remove tox

noxfile.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import nox
2+
from nox.sessions import Session
3+
4+
5+
PYTHON_VERSIONS = ['3.13', '3.12', '3.11']
6+
7+
# Stay with Django v5.1.x until https://github.com/radiac/django-tagulous/issues/187 is fixed
8+
DJANGO_VERSIONS = ['5.1']
9+
10+
11+
@nox.session(python=PYTHON_VERSIONS)
12+
@nox.parametrize('django', DJANGO_VERSIONS)
13+
def tests(session: Session, django: str):
14+
session.install('uv')
15+
session.run(
16+
'uv',
17+
'sync',
18+
'--all-extras',
19+
'--python',
20+
session.python,
21+
env={'UV_PROJECT_ENVIRONMENT': session.virtualenv.location},
22+
)
23+
session.run(
24+
'uv',
25+
'pip',
26+
'install',
27+
f'django>={django},<={django}.999',
28+
env={'UV_PROJECT_ENVIRONMENT': session.virtualenv.location},
29+
)
30+
session.run('python', '-m', 'coverage', 'run', '--context', f'py{session.python}-django{django}')

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dev = [
4747
"hatchling", # https://github.com/pypa/hatch/tree/master/backend
4848
"playwright", # https://github.com/microsoft/playwright-python
4949
"tblib", # https://github.com/ionelmc/python-tblib
50-
# TODO: "nox", # https://github.com/wntrblm/nox
50+
"nox", # https://github.com/wntrblm/nox
5151
"coverage", # https://github.com/nedbat/coveragepy
5252
"ruff", # https://github.com/astral-sh/ruff
5353
"codespell", # https://github.com/codespell-project/codespell
@@ -170,6 +170,7 @@ applied_migrations = [
170170
"a36dd75", # 2025-03-23T11:39:23+01:00
171171
"b3e0624", # 2025-05-01T00:07:45+02:00
172172
"46497a1", # 2025-09-05T08:45:19+02:00
173+
"ae399b9", # 2025-09-21T09:34:36+02:00
173174
]
174175

175176
[manageprojects.cookiecutter_context.cookiecutter]

uv.lock

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)