Skip to content
Merged
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
31 changes: 13 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
branches: ["master", "level12"]

jobs:
test:
Expand All @@ -25,26 +25,21 @@ jobs:
- {python: "pypy3.10", os: "ubuntu-24.04"}
steps:
- uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python }}"
uses: actions/setup-python@v5

# https://docs.astral.sh/uv/guides/integration/github/#multiple-python-versions
- name: Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python }}
- name: "Install dependencies"
run: |
python -m pip install pytest
python -m pip install build
python -m pip install "setuptools>=75"
- name: "Build and test"
python-version: ${{ matrix.python-version }}

- name: "Run nox"
run: |
python -m build --no-isolation
pip install dist/dominate*.tar.gz
pytest --ignore=tests/community
uv run --only-group nox nox

- name: Coveralls
# Only push coverage on the project's repo (no forks) and when tests have passed
if: github.repository == 'Knio/dominate' && success()
env:
COVERAGE_RCFILE: ".github/workflows/.coveragerc"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python -m pip install coverage
python -m pip install coveralls
coverage run --source=dominate -m pytest --ignore=tests/community
python -m coveralls --service=github || true
uv run --only-group coverage -- coveralls --service=github || true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ nosetests.xml
.idea/
.venv/
.envrc
.vscode
8 changes: 8 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[env]
PROJECT_SLUG = '{{ config_root | basename | slugify }}'

_.python.venv.path = '{% if env.UV_PROJECT_ENVIRONMENT %}{{ env.UV_PROJECT_ENVIRONMENT }}{% else %}.venv{% endif %}'
_.python.venv.create = true

PYTHONUNBUFFERED = '1'

29 changes: 29 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from pathlib import Path

import nox


package_path = Path.cwd()
nox.options.default_venv_backend = 'uv'


def latest_dist():
files = sorted(Path('./dist').glob('dominate*.tar.gz'))
return files[-1].resolve()


@nox.session
def build_and_test(session: nox.Session):
session.run('uv', 'sync', '--active', '--no-dev', '--group', 'tests')
session.run('python', '-m', 'build', '--no-isolation')
session.run('uv', 'pip', 'install', latest_dist())
session.run(
'pytest',
'-ra',
'--tb=native',
'--strict-markers',
'--cov=dominate',
'--cov-config=.github/workflows/.coveragerc',
'--no-cov-on-fail',
*session.posargs,
)
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,22 @@ packages = ["dominate"]

[tool.setuptools.dynamic]
version = {attr = "dominate.version.version"}

[dependency-groups]
coverage = [
"coveralls>=4.0.1",
]
dev = [
{include-group = "tests"},
{include-group = "nox"},
]
nox = [
"nox>=2025.5.1",
]
tests = [
"build>=1.2.2.post1",
"coverage>=7.8.2",
"pytest>=8.3.5",
"pytest-cov>=6.1.1",
"setuptools>=80.9.0",
]
Loading