Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renovations, 2024 #31

Merged
merged 5 commits into from
May 28, 2024
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
30 changes: 16 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,49 @@ jobs:
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os: ['ubuntu-22.04']
python-version: ['3.7', '3.8', '3.9']
os: ['ubuntu-latest']
python-version: ['3.8', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python-version }}'
cache: pip
cache-dependency-path: |
pyproject.toml
requirements*txt
- run: pip install tox-gh-actions tox
- run: pip install tox-gh-actions tox tox-uv
- run: tox
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
with:
directory: .tox/coverage
Lint:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
cache-dependency-path: |
pyproject.toml
requirements*txt
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
cache: pip
cache-dependency-path: |
pyproject.toml
requirements*txt
- run: 'pip install build'
- run: python -m build .
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.261
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
hooks:
- id: ruff
args:
- --fix

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.10.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
24 changes: 19 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@ dynamic = ["version"]
description = "Paikkavarauskala"
readme = "README.md"
license = "MIT"
requires-python = ">=3.7"
requires-python = ">=3.8"
authors = [
{ name = "Aarni Koskela", email = "[email protected]" },
]
dependencies = [
"Django>=3.0",
"Django>=4.2",
]

[project.optional-dependencies]
printing = [
"reportlab >= 3.0",
]
dev = [
"pytest",
"pytest-cov",
"pytest-django~=4.5",
]

[project.urls]
Homepage = "https://github.com/kcsry/paikkala"
Expand Down Expand Up @@ -47,6 +52,9 @@ doctest_optionflags = ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL", "ALLOW
filterwarnings = ["ignore:.*default_app_config.*"]

[tool.ruff]
line-length = 120

[tool.ruff.lint]
exclude = [
"migrations",
"tests",
Expand All @@ -55,7 +63,6 @@ ignore = [
"ANN101",
"ANN401",
]
line-length = 120
select = [
"ANN",
"C9",
Expand All @@ -65,13 +72,20 @@ select = [
"I",
]

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 10

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"*/views.py" = [
"ANN001",
"ANN002",
"ANN003",
"ANN201",
]
"*/tests/*.py" = [
"ANN",
]
"*/migrations/*.py" = [
"ANN",
"E501",
]
3 changes: 0 additions & 3 deletions requirements-dev.in

This file was deleted.

23 changes: 0 additions & 23 deletions requirements-dev.txt

This file was deleted.

25 changes: 15 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
[tox]
isolated_build = True
envlist =
{py37,py38,py39}-django{30,31,32}
py39-django{42}
py38-django{42}
py{310,311,312}-django{50}

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
commands = py.test -ra -vvv --cov=paikkala --cov-report=term-missing
extras = printing
commands =
# We need to put all of the coverage reports into the same directory, so we can tell
# the `codecov` action to look there. The files need to be named after one of the
# patterns in the uploader, see https://github.com/codecov/codecov-cli/blob/7432bad76c619e34d6617b578e039e7d733e3f00/codecov_cli/services/upload/file_finder.py#L11-L36
# We use the `coverage-{envname}.xml` pattern, so we can use the `envname` variable here.
py.test -ra -vvv --cov=paikkala --cov-report=term-missing --cov-report=xml:{toxworkdir}/coverage/coverage-{envname}.xml {posargs}
extras =
dev
printing
deps =
-rrequirements-dev.txt
django30: Django~=3.0.0
django31: Django~=3.1.0
django32: Django~=3.2.0
django42: Django~=4.2.0
django50: Django~=5.0.0
Loading