Skip to content

Commit a45ea18

Browse files
Daverballhenri-hulski
authored andcommitted
Switch to pyproject.toml based project setup
1 parent 511920a commit a45ea18

12 files changed

Lines changed: 134 additions & 120 deletions

File tree

.github/workflows/main.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,25 @@ jobs:
1919

2020
strategy:
2121
matrix:
22-
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"]
22+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.11"]
2323

2424
# Steps represent a sequence of tasks that will be executed as part of the job
2525
steps:
2626
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27-
- uses: "actions/checkout@v2"
28-
- uses: "actions/setup-python@v2"
27+
- uses: "actions/checkout@v6"
28+
- uses: "actions/setup-python@v6"
2929
with:
3030
python-version: "${{ matrix.python-version }}"
3131
- name: "Install dependencies"
32-
run: |
33-
set -xe
34-
python -VV
35-
python -m site
36-
python -m pip install --upgrade pip setuptools wheel
37-
python -m pip install --upgrade virtualenv tox tox-gh-actions
32+
run: python -m pip install --upgrade pip tox tox-gh
3833
- name: "Run tox targets for ${{ matrix.python-version }}"
3934
run: "python -m tox"
4035

4136
- name: "Report to coveralls"
42-
# coverage is only created in the py39 environment
37+
# coverage is only created in the py314 environment
4338
# --service=github is a workaround for bug
4439
# https://github.com/coveralls-clients/coveralls-python/issues/251
45-
if: "matrix.python-version == '3.9'"
40+
if: "matrix.python-version == '3.14'"
4641
run: |
4742
pip install coveralls
4843
coveralls --service=github

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 20.8b1
3+
rev: 26.5.1
44
hooks:
55
- id: black
66
- repo: https://github.com/PyCQA/flake8
7-
rev: "3.8.4"
7+
rev: "7.3.0"
88
hooks:
99
- id: flake8
10+
additional_dependencies: [flake8-pyproject]
1011
- repo: https://github.com/asottile/pyupgrade
11-
rev: v2.7.4
12+
rev: v3.21.2
1213
hooks:
1314
- id: pyupgrade
14-
args: [--py36-plus]
15+
args: [--py310-plus]

CHANGES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ CHANGES
88

99
- Apply Black code formatter.
1010

11-
- Drop support for Python 3.4 and 3.5.
11+
- Add support for Python 3.10, 3.11, 3.12, 3.13 and 3.14
1212

13-
- Add support for Python 3.9.
13+
- Drop support for Python 3.9 and below
1414

1515
- Use GitHub Actions instead of Travis for CI.
1616
(Travis no longer gives free credits to open source projects.)

README.rst

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

1414

1515
Dectate: a configuration engine for Python frameworks
16-
=======================================================
16+
*****************************************************
1717

1818
Dectate is a powerful configuration engine for Python frameworks.
1919

dectate/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from .toposort import topological_sort
1212
from .sentinel import NOT_FOUND
1313

14-
1514
order_count = 0
1615

1716

dectate/sphinxext.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
object using the directive decorator, and the signature needs to be
55
obtained from the action class's ``__init__`` manually.
66
"""
7+
78
import inspect
89

910

develop_requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# development
2-
-e '.[test,coverage,pep8,docs]'
2+
-e '.[test,coverage,lint,docs]'
33
pre-commit
4-
tox >= 2.4.1
4+
tox >= 4
55
radon
66

77
# releaser

doc/developing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ You can run all tox tests with::
165165

166166
You can also specify a test environment to run e.g.::
167167

168-
$ tox -e py37
169-
$ tox -e pep8
168+
$ tox -e py311
169+
$ tox -e lint
170170
$ tox -e docs
171171

172172
.. _pyenv: https://github.com/yyuu/pyenv

pyproject.toml

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,70 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "dectate"
7+
version = "0.15.dev0"
8+
dynamic = ["readme"]
9+
description = "A configuration engine for Python frameworks"
10+
license = "BSD-3-Clause"
11+
license-files = ["LICENSE.txt"]
12+
authors = [{name = "Martijn Faassen", email = "faassen@startifact.com"}]
13+
maintainers = [{name = "Henri Hulski", email = "henri@sancode.it"}]
14+
keywords = ["configuration"]
15+
classifiers = [
16+
"Intended Audience :: Developers",
17+
"Topic :: Software Development :: Libraries :: Application Frameworks",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
23+
"Programming Language :: Python :: 3 :: Only",
24+
"Programming Language :: Python :: Implementation :: PyPy",
25+
"Development Status :: 5 - Production/Stable",
26+
]
27+
requires-python = ">= 3.10"
28+
29+
[project.urls]
30+
Documentation = "https://dectate.readthedocs.io"
31+
Repository = "https://github.com/morepath/dectate"
32+
Issues = "https://github.com/morepath/dectate/issues"
33+
Changelog = "https://github.com/morepath/dectate/blob/master/CHANGES.txt"
34+
35+
[project.optional-dependencies]
36+
test = ["pytest >= 8", "pytest-env"]
37+
coverage = ["pytest-cov"]
38+
lint = ["black", "flake8", "flake8-pyproject"]
39+
docs = ["sphinx"]
40+
41+
[tool.setuptools.packages]
42+
find = {}
43+
44+
[tool.setuptools.dynamic]
45+
readme = {file = ["README.rst", "CHANGES.txt"]}
46+
47+
[tool.pytest.ini_options]
48+
minversion = "8.0"
49+
testpaths = ["dectate"]
50+
addopts = ["-vv"]
51+
env = ["RUN_ENV=test"]
52+
53+
[tool.coverage.run]
54+
omit = ["dectate/tests/*"]
55+
source = ["dectate"]
56+
57+
[tool.coverage.report]
58+
show_missing = true
59+
60+
[tool.flake8]
61+
show-source = true
62+
ignore = ["E203", "W503"]
63+
max-line-length = 80
64+
165
[tool.black]
266
line-length = 80
3-
target-version = ['py34', 'py35', 'py36', 'py37', 'py38']
67+
target-version = ['py310', 'py311', 'py312', 'py313', 'py314']
468
include = '\.pyi?$'
569
exclude = '''
670
(
@@ -13,3 +77,53 @@ exclude = '''
1377
)/
1478
)
1579
'''
80+
81+
[tool.tox]
82+
requires = ["tox>=4"]
83+
env_list = [
84+
"py310",
85+
"py311",
86+
"py312",
87+
"py313",
88+
"py314",
89+
"pypy3",
90+
"coverage",
91+
"pre-commit",
92+
"docs",
93+
]
94+
skip_missing_interpreters = true
95+
96+
[tool.tox.gh.python]
97+
"3.10" = ["py310"]
98+
"3.11" = ["py311"]
99+
"3.12" = ["py312"]
100+
"3.13" = ["py313"]
101+
"3.14" = ["py314", "pre-commit", "coverage"]
102+
"pypy-3.11" = ["pypy3"]
103+
104+
[tool.tox.env_run_base]
105+
package = "editable"
106+
extras = ["test"]
107+
commands = [["pytest", "{posargs:dectate}"]]
108+
109+
[tool.tox.env.coverage]
110+
base_python = ["python3"]
111+
extras = ["test", "coverage"]
112+
commands = [
113+
["pytest", "--cov", "--cov-fail-under=94", "{posargs:dectate}"],
114+
]
115+
116+
[tool.tox.env.pre-commit]
117+
base_python = ["python3"]
118+
package = "skip"
119+
deps = ["pre-commit"]
120+
commands = [
121+
["pre-commit", "run", "--all-files"],
122+
]
123+
124+
[tool.tox.env.docs]
125+
base_python = ["python3"]
126+
extras = ["docs"]
127+
commands = [
128+
["sphinx-build", "-b", "doctest", "doc", "{env_tmp_dir}"],
129+
]

setup.cfg

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

0 commit comments

Comments
 (0)