Skip to content

Commit e89ed4b

Browse files
authored
Improve DX and CI (#131)
2 parents fd44788 + dd6ff9c commit e89ed4b

File tree

8 files changed

+75
-48
lines changed

8 files changed

+75
-48
lines changed

.coveragerc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
pull_request:
88
branches: [master]
99

10+
env:
11+
FORCE_COLOR: "1"
12+
1013
jobs:
1114
build:
1215
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})

.pre-commit-config.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
ci:
2+
autoupdate_schedule: monthly
3+
14
repos:
25
- repo: https://github.com/pre-commit/pre-commit-hooks
36
rev: v4.4.0
47
hooks:
5-
- id: check-yaml
68
- id: end-of-file-fixer
79
- id: trailing-whitespace
810
- id: mixed-line-ending
11+
- id: check-toml
12+
- id: check-yaml
913
- repo: https://github.com/asottile/pyupgrade
1014
rev: v3.7.0
1115
hooks:
@@ -25,3 +29,15 @@ repos:
2529
- id: python-no-log-warn
2630
- id: rst-backticks
2731
- id: rst-directive-colons
32+
- repo: https://github.com/asottile/setup-cfg-fmt
33+
rev: v2.3.0
34+
hooks:
35+
- id: setup-cfg-fmt
36+
- repo: https://github.com/tox-dev/pyproject-fmt
37+
rev: "0.12.1"
38+
hooks:
39+
- id: pyproject-fmt
40+
- repo: https://github.com/tox-dev/tox-ini-fmt
41+
rev: "1.2.0"
42+
hooks:
43+
- id: tox-ini-fmt

pyproject.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
[build-system]
2-
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
2+
build-backend = "setuptools.build_meta"
3+
requires = [
4+
"setuptools>=42",
5+
"setuptools_scm[toml]>=3.4",
6+
]
37

48
[tool.setuptools_scm]
59
# this empty section means: use_scm_version=True
610
version_scheme = "guess-next-dev"
711
local_scheme = "no-local-version"
12+
13+
[tool.coverage.run]
14+
source = [
15+
"simple_menu",
16+
]
17+
plugins = ["covdefaults"]
18+
19+
[tool.coverage.report]
20+
fail_under = 85

setup.cfg

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
11
[metadata]
2-
name = django-simple-menu
2+
name = django_simple_menu
3+
description = Simple, yet powerful, code-based menus for Django applications
4+
long_description = file: README.rst
5+
long_description_content_type = text/x-rst
36
url = https://github.com/jazzband/django-simple-menu
47
author = Evan Borgstrom
58
author_email = [email protected]
6-
description = Simple, yet powerful, code-based menus for Django applications
7-
long_description = file: README.rst
8-
license = BSD 2-Clause "Simplified" License
9+
license = BSD-2-Clause
10+
license_files = LICENSE
911
classifiers =
1012
Development Status :: 5 - Production/Stable
1113
Framework :: Django
1214
Framework :: Django :: 3.2
1315
Framework :: Django :: 4.0
1416
Framework :: Django :: 4.1
17+
Framework :: Django :: 4.2
1518
Intended Audience :: Developers
1619
License :: OSI Approved :: BSD License
1720
Natural Language :: English
1821
Operating System :: OS Independent
19-
Topic :: Software Development :: Libraries
20-
Topic :: Software Development :: Libraries :: Python Modules
2122
Programming Language :: Python
22-
Programming Language :: Python :: 3
2323
Programming Language :: Python :: 3 :: Only
2424
Programming Language :: Python :: 3.6
2525
Programming Language :: Python :: 3.7
2626
Programming Language :: Python :: 3.8
2727
Programming Language :: Python :: 3.9
2828
Programming Language :: Python :: 3.10
2929
Programming Language :: Python :: 3.11
30+
Programming Language :: Python :: 3.12
31+
Topic :: Software Development :: Libraries
32+
Topic :: Software Development :: Libraries :: Python Modules
3033

3134
[options]
3235
packages =
3336
simple_menu
3437
menu
35-
include_package_data = True
36-
python_requires = >=3.6,<4.0
3738
install_requires =
3839
Django>=2.2
39-
importlib_metadata; python_version < '3.8'
40+
importlib-metadata;python_version < '3.8'
41+
python_requires = >=3.6,<4.0
42+
include_package_data = True
4043
setup_requires =
41-
setuptools_scm
44+
setuptools-scm

setup.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

simple_menu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
try:
1111
__version__ = version("django-simple-menu")
12-
except PackageNotFoundError:
12+
except PackageNotFoundError: # pragma: no cover
1313
# package is not installed
1414
__version__ = None
1515

tox.ini

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
[tox]
2-
usedevelop = true
3-
; https://docs.djangoproject.com/en/dev/faq/install/#what-python-version-can-i-use-with-django
42
envlist =
5-
py3{6,7,8,9,10}-dj32
6-
py3{8,9,10}-dj40
7-
py3{8,9,10,11}-dj41
8-
py3{8,9,10,11}-dj42
9-
py3{10,11,12}-djmain
3+
py3{11, 10, 9, 8}-dj42
4+
py3{11, 10, 9, 8}-dj41
5+
py3{10, 9, 8}-dj40
6+
py3{10, 9, 8, 7, 6}-dj32
7+
py3{12, 11, 10}-djmain
8+
isolated_build = true
9+
10+
[testenv]
11+
deps =
12+
covdefaults
13+
coverage[toml]
14+
dj32: Django~=3.2.16
15+
dj40: Django~=4.0.8
16+
dj41: Django~=4.1.3
17+
dj42: Django~=4.2.1
18+
djmain: https://github.com/django/django/tarball/main
19+
pass_env =
20+
FORCE_COLOR
21+
NO_COLOR
22+
setenv =
23+
DJANGO_SETTINGS_MODULE = simple_menu.test_settings
24+
commands =
25+
coverage run -m django test -v2 {posargs:simple_menu}
26+
coverage report
27+
coverage xml
1028

1129
[gh-actions]
1230
python =
@@ -19,25 +37,9 @@ python =
1937
3.12: py312
2038

2139
[gh-actions:env]
22-
DJANGO =
40+
django =
2341
3.2: dj32
2442
4.0: dj40
2543
4.1: dj41
2644
4.2: dj42
2745
main: djmain
28-
29-
[testenv]
30-
usedevelop = true
31-
deps =
32-
coverage
33-
dj32: Django~=3.2.16
34-
dj40: Django~=4.0.8
35-
dj41: Django~=4.1.3
36-
dj42: Django~=4.2.1
37-
djmain: https://github.com/django/django/tarball/main
38-
setenv =
39-
DJANGO_SETTINGS_MODULE=simple_menu.test_settings
40-
commands =
41-
coverage run -m django test -v2 {posargs:simple_menu}
42-
coverage report
43-
coverage xml

0 commit comments

Comments
 (0)