Skip to content

Commit d9845e4

Browse files
Daverballhenri-hulski
authored andcommitted
Switch to pyproject.toml based project setup and PEP-420
1 parent 9fa36cb commit d9845e4

11 files changed

Lines changed: 158 additions & 127 deletions

File tree

.bumpversion.cfg

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

.coveragerc

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

.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]

HISTORY.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ unreleased
55
~~~~~~~~~~
66

77
- Update supported Python versions.
8-
[jugmac00]
8+
[jugmac00] & [Daverball]
99

1010
- Use GitHub Actions for CI.
11-
[jugmac00
11+
[jugmac00]
12+
13+
- Switch to PEP-420 namespace package
14+
[Daverball]
1215

1316
0.2.0 (2018-02-02)
1417
~~~~~~~~~~~~~~~~~~~~~

README.rst

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

1515

1616
more.content_security
17-
=====================
17+
*********************
1818

1919
Content Security Policy for Morepath
2020

develop_requirements.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# development
2+
-e '.[test,coverage,lint]'
3+
pre-commit
4+
tox >= 4
5+
radon
6+
7+
# version bumper
8+
bump-my-version
9+
10+
# releaser
11+
zest.releaser[recommended]

more/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "more.content_security"
7+
version = "0.2.0"
8+
dynamic = ["readme"]
9+
description = "Content Security Policy for Morepath"
10+
license = "BSD-3-Clause"
11+
license-files = ["license/LICENSE"]
12+
authors = [{name = "Denis Krienbühl", email = "denis@href.ch"}]
13+
maintainers = [{name = "Henri Hulski", email = "henri@sancode.it"}]
14+
classifiers = [
15+
"Intended Audience :: Developers",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
20+
"Programming Language :: Python :: 3.14",
21+
"Programming Language :: Python :: 3 :: Only",
22+
"Programming Language :: Python :: Implementation :: CPython",
23+
"Programming Language :: Python :: Implementation :: PyPy",
24+
]
25+
requires-python = ">= 3.10"
26+
dependencies = ["morepath"]
27+
28+
[project.urls]
29+
Repository = "https://github.com/morepath/more.content_security"
30+
Issues = "https://github.com/morepath/more.content_security/issues"
31+
Changelog = "https://github.com/morepath/more.content_security/blob/master/HISTORY.rst"
32+
33+
[project.optional-dependencies]
34+
test = ["pytest >= 8", "pytest-env", "WebTest"]
35+
coverage = ["pytest-cov"]
36+
lint = ["black", "flake8", "flake8-pyproject"]
37+
38+
[tool.setuptools.packages]
39+
find = {}
40+
41+
[tool.setuptools.dynamic]
42+
readme = {file = ["README.rst", "HISTORY.rst"]}
43+
44+
[tool.pytest.ini_options]
45+
minversion = "8.0"
46+
testpaths = ["more/content_security"]
47+
addopts = ["-vv"]
48+
env = ["RUN_ENV=test"]
49+
50+
[tool.coverage.run]
51+
omit = ["more/content_security/tests/*"]
52+
source = ["more/content_security"]
53+
54+
[tool.coverage.report]
55+
show_missing = true
56+
57+
[tool.flake8]
58+
show-source = true
59+
ignore = ["E203", "E231", "W503"]
60+
max-line-length = 88
61+
62+
[tool.bumpversion]
63+
current_version = "0.2.0"
64+
commit = true
65+
message = "Release {new_version}"
66+
tag = true
67+
tag_message = "Release {new_version}"
68+
regex = true
69+
70+
[[tool.bumpversion.files]]
71+
filename = "pyproject.toml"
72+
search= 'version = "{current_version}"'
73+
replace= 'version = "{new_version}"'
74+
75+
[[tool.bumpversion.files]]
76+
filename = "HISTORY.rst"
77+
search = """
78+
---------(?:
79+
80+
unreleased
81+
~~~~~~~~~~)?
82+
"""
83+
replace = """
84+
---------
85+
86+
{new_version} ({now:%d.%m.%Y})
87+
~~~~~~~~~~~~~~~~~~~
88+
"""
89+
90+
[tool.tox]
91+
requires = ["tox>=4"]
92+
env_list = [
93+
"py310",
94+
"py311",
95+
"py312",
96+
"py313",
97+
"py314",
98+
"pypy3",
99+
"coverage",
100+
"pre-commit",
101+
]
102+
skip_missing_interpreters = true
103+
104+
[tool.tox.gh.python]
105+
"3.10" = ["py310"]
106+
"3.11" = ["py311"]
107+
"3.12" = ["py312"]
108+
"3.13" = ["py313"]
109+
"3.14" = ["py314", "pre-commit", "coverage"]
110+
"pypy-3.11" = ["pypy3"]
111+
112+
[tool.tox.env_run_base]
113+
package = "editable"
114+
extras = ["test"]
115+
commands = [["pytest", "{posargs:more}"]]
116+
117+
[tool.tox.env.coverage]
118+
base_python = ["python3"]
119+
extras = ["test", "coverage"]
120+
commands = [
121+
["pytest", "--cov", "--cov-fail-under=99", "{posargs:more}"],
122+
]
123+
124+
[tool.tox.env.pre-commit]
125+
base_python = ["python3"]
126+
package = "skip"
127+
deps = ["pre-commit"]
128+
commands = [
129+
["pre-commit", "run", "--all-files"],
130+
]

setup.py

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

0 commit comments

Comments
 (0)