Skip to content

Commit

Permalink
Align Tox, GH Actions, setup.cfg (py312,dj42,dj51)
Browse files Browse the repository at this point in the history
Includes:
- align pyproject.toml files
- align build.yml files
- align setup.cfg (somewhat)
- add Python 3.12 support
- add Django 5.1 support, tests
- drop Python 3.11 support
- drop Django 5.0 support
- fix (some) typos
  • Loading branch information
JonathanWillitts committed Sep 5, 2024
1 parent bc20f94 commit aaf5e3c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ on: [push, pull_request]

jobs:
build:
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
name: |
build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}, ${{ matrix.database-engine }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ['3.11']
django-version: ['4.1', '4.2', 'dev']
python-version: ['3.12']
django-version: ['4.2', '5.1', 'dev']
database-engine: ["mysql", "postgres"]

services:
mysql:
image: mysql:latest
Expand All @@ -22,6 +25,17 @@ jobs:
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Install pycups and words dependency
Expand Down Expand Up @@ -55,7 +69,6 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/tox.txt
- name: Tox tests
run: |
tox -v
Expand Down
25 changes: 12 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=60", "setuptools-scm>=8.0"]

[tool.setuptools_scm]
write_to = "_version.py"
version_file="_version.py"

[tool.black]
line-length = 95
target-version = ["py310"]
target-version = ["py312"]
extend-exclude = '''^(.*\/)*\b(migrations)\b($|\/.*$)'''

[tool.isort]
profile = "black"
py_version = "310"
py_version = "312"
skip = [".tox", ".eggs", "migrations"]

[tool.coverage.run]
Expand All @@ -28,37 +27,37 @@ show_missing = true
skip_covered = true
omit = ["requirements.txt"]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"pragma: no cover",
"if TYPE_CHECKING:",
]

[tool.tox]
legacy_tox_ini = """
[tox]
envlist =
py{311}-dj{41,42,dev},
py{312}-dj{42,51,dev},
lint
isolated_build = true
[gh-actions]
python =
3.11: py311, lint
3.12: py312, lint
[gh-actions:env]
DJANGO =
4.1: dj41
4.2: dj42, lint
dev: djdev
4.2: dj42
5.1: dj51
dev: djdev, lint
[testenv]
deps =
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/tox.txt
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/test_utils.txt
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/edc.txt
-r https://raw.githubusercontent.com/clinicedc/edc/develop/requirements.tests/third_party_dev.txt
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<5.0
dj51: Django>=5.1,<5.2
djdev: https://github.com/django/django/tarball/main
commands =
Expand Down
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ keywords = django Edc health economics, clinicedc, clinical trials
classifiers =
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 4.1
Framework :: Django :: 4.2
Framework :: Django :: 5.1
Intended Audience :: Developers
Intended Audience :: Science/Research
Operating System :: OS Independent
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
License :: OSI Approved :: GNU General Public License v3 (GPLv3)

[options]
python_requires = >=3.11
python_requires = >=3.12
zip_safe = False
include_package_data = True
packages = find:
Expand Down

0 comments on commit aaf5e3c

Please sign in to comment.