Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@


name: tests
permissions:
contents: read

on:
push:
Expand All @@ -12,12 +14,18 @@ on:

jobs:
test:
name: 'Python ${{ matrix.python-version }}'
name: 'Python ${{ matrix.python-version }} Django ${{ matrix.django-version }}'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.13', '3.12', '3.11']
python-version: ['3.14', '3.13', '3.12', '3.11']
django-version: ['5.2', '5.1', '4.2']
exclude:
- python-version: '3.14'
django-version: '5.1'
- python-version: '3.14'
django-version: '4.2'
steps:
- name: Checkout
run: |
Expand Down Expand Up @@ -51,12 +59,12 @@ jobs:
run: |
./manage.py pip_audit

- name: 'Python ${{ matrix.python-version }}'
- name: 'Python ${{ matrix.python-version }} Django ${{ matrix.django-version }}'
env:
PYTHONUNBUFFERED: 1
PYTHONWARNINGS: always
run: |
./manage.py test
./manage.py nox -e "tests-${{ matrix.python-version }}(django='${{ matrix.django-version }}')"

- name: 'Upload coverage report'
uses: codecov/codecov-action@v5
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ To make a new release, do this:
[comment]: <> (✂✂✂ auto generated history start ✂✂✂)

* [**dev**](https://github.com/jedie/PyInventory/compare/v0.23.0...main)
* 2025-11-28 - Use nox
* 2025-11-28 - Update README.md
* 2025-11-28 - Add logo
* [v0.23.0](https://github.com/jedie/PyInventory/compare/v0.22.1...v0.23.0)
* 2025-11-25 - Enhance 'Change category for selected items' and add tests for it
Expand Down
45 changes: 45 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# https://github.com/wntrblm/nox/
# Documentation: https://nox.thea.codes/
#
import nox
from nox.sessions import Session


PYTHON_VERSIONS = ('3.14', '3.13', '3.12', '3.11')
DJANGO_VERSIONS = ('5.2', '5.1', '4.2')

# Python 3.14 needs Django 5.2+
EXCLUDED_COMBINATIONS = [
('3.14', '5.1'),
('3.14', '4.2'),
]


@nox.session(
python=PYTHON_VERSIONS,
venv_backend='uv',
download_python='auto',
)
@nox.parametrize('django', DJANGO_VERSIONS)
def tests(session: Session, django: str):
if (session.python, django) in EXCLUDED_COMBINATIONS:
session.skip('Python 3.14 needs Django 5.2+')

session.install('uv')
session.run(
'uv',
'sync',
'--all-extras',
'--python',
session.python,
env={'UV_PROJECT_ENVIRONMENT': session.virtualenv.location},
)
session.run(
'uv',
'pip',
'install',
f'django>={django},<={django}.999',
env={'UV_PROJECT_ENVIRONMENT': session.virtualenv.location},
)
session.run('python', '-m', 'coverage', 'run', '--context', f'py{session.python}-django{django}')
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dev = [
"hatchling", # https://github.com/pypa/hatch/tree/master/backend
"playwright", # https://github.com/microsoft/playwright-python
"tblib", # https://github.com/ionelmc/python-tblib
# TODO: "nox", # https://github.com/wntrblm/nox
"nox", # https://github.com/wntrblm/nox
"coverage", # https://github.com/nedbat/coveragepy
"ruff", # https://github.com/astral-sh/ruff
"codespell", # https://github.com/codespell-project/codespell
Expand Down Expand Up @@ -97,7 +97,6 @@ version_module_name = "inventory" # Used by "update-readme-history" pre-commit h


[tool.cli_base.pip_audit]
requirements=["requirements.dev.txt"]
strict=true
require_hashes=true
ignore-vuln=[]
Expand Down Expand Up @@ -169,6 +168,7 @@ applied_migrations = [
"b3e0624", # 2025-05-01T00:07:45+02:00
"46497a1", # 2025-09-05T08:45:19+02:00
"38082ef", # 2025-10-16T10:28:32+02:00
"95a3003", # 2025-11-28T22:00:56+01:00
]

[manageprojects.cookiecutter_context.cookiecutter]
Expand Down
59 changes: 59 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading