Skip to content

Commit 30856df

Browse files
committed
build: move packaging and config to pyproject.toml
Thanks, Claude.
1 parent 2cd85c6 commit 30856df

File tree

4 files changed

+75
-65
lines changed

4 files changed

+75
-65
lines changed

django_coverage_plugin/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
"""Django Template Coverage Plugin"""
55

6+
__version__ = "3.1.1rc1"
7+
68
from .plugin import DjangoTemplatePluginException # noqa
79
from .plugin import DjangoTemplatePlugin
810

pyproject.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2+
# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt
3+
4+
[build-system]
5+
requires = ["setuptools>=61.0", "wheel"]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "django_coverage_plugin"
10+
description = "Django template coverage.py plugin"
11+
readme = "README.rst"
12+
authors = [
13+
{name = "Ned Batchelder", email = "[email protected]"},
14+
]
15+
license = "Apache-2.0"
16+
classifiers = [
17+
"Development Status :: 5 - Production/Stable",
18+
"Environment :: Console",
19+
"Framework :: Django",
20+
"Framework :: Django :: 2.2",
21+
"Framework :: Django :: 3.2",
22+
"Framework :: Django :: 4.2",
23+
"Framework :: Django :: 5.2",
24+
"Intended Audience :: Developers",
25+
"Operating System :: OS Independent",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"Programming Language :: Python :: 3.12",
30+
"Programming Language :: Python :: 3.13",
31+
"Programming Language :: Python :: Implementation :: CPython",
32+
"Programming Language :: Python :: Implementation :: PyPy",
33+
"Topic :: Software Development :: Quality Assurance",
34+
"Topic :: Software Development :: Testing",
35+
]
36+
requires-python = ">= 3.9"
37+
dependencies = [
38+
"coverage",
39+
]
40+
dynamic = ["version"]
41+
42+
[project.urls]
43+
"Homepage" = "https://github.com/nedbat/django_coverage_plugin"
44+
"Bug Tracker" = "https://github.com/nedbat/django_coverage_plugin/issues"
45+
"Source" = "https://github.com/nedbat/django_coverage_plugin"
46+
47+
[tool.setuptools.dynamic]
48+
version = {attr = "django_coverage_plugin.__version__"}
49+
50+
[tool.setuptools.packages.find]
51+
include = ["django_coverage_plugin*"]
52+
53+
[tool.pytest.ini_options]
54+
# How come these warnings are suppressed successfully here, but not in conftest.py??
55+
filterwarnings = [
56+
# ignore all DeprecationWarnings...
57+
"ignore::DeprecationWarning",
58+
# ...but show them if they are from our code.
59+
"default::DeprecationWarning:django_coverage_plugin",
60+
]
61+
62+
[tool.scriv]
63+
fragment_directory = "scriv.d"
64+
output_file = "README.rst"
65+
rst_header_chars = "-."

setup.cfg

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
22
# For details: https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt
33

4-
[tool:pytest]
5-
# How come these warnings are suppressed successfully here, but not in conftest.py??
6-
filterwarnings =
7-
# ignore all DeprecationWarnings...
8-
ignore::DeprecationWarning
9-
# ...but show them if they are from our code.
10-
default::DeprecationWarning:django_coverage_plugin
11-
12-
[scriv]
13-
fragment_directory = scriv.d
14-
output_file = README.rst
15-
rst_header_chars = -.
4+
# Configuration has moved to pyproject.toml
5+
# This file can be removed once migration is complete

setup.py

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,13 @@
55
- http://www.apache.org/licenses/LICENSE-2.0
66
- https://github.com/nedbat/django_coverage_plugin/blob/master/NOTICE.txt
77
8+
DEPRECATED: This file is kept for backward compatibility.
9+
All configuration has moved to pyproject.toml.
10+
This file can be removed once migration is complete.
811
"""
912

10-
import re
11-
from os.path import dirname, join
12-
13+
# For backward compatibility, import from setuptools
1314
from setuptools import setup
1415

15-
16-
def read(*names, **kwargs):
17-
"""Read and return contents of file
18-
19-
Parameter: encoding kwarg may be set
20-
"""
21-
with open(
22-
join(dirname(__file__), *names),
23-
encoding=kwargs.get('encoding', 'utf8')
24-
) as f:
25-
return f.read()
26-
27-
28-
classifiers = """\
29-
Environment :: Console
30-
Intended Audience :: Developers
31-
Operating System :: OS Independent
32-
Programming Language :: Python :: 3.9
33-
Programming Language :: Python :: 3.10
34-
Programming Language :: Python :: 3.11
35-
Programming Language :: Python :: 3.12
36-
Programming Language :: Python :: 3.13
37-
Programming Language :: Python :: Implementation :: CPython
38-
Programming Language :: Python :: Implementation :: PyPy
39-
Topic :: Software Development :: Quality Assurance
40-
Topic :: Software Development :: Testing
41-
Development Status :: 5 - Production/Stable
42-
Framework :: Django
43-
Framework :: Django :: 2.2
44-
Framework :: Django :: 3.2
45-
Framework :: Django :: 4.2
46-
Framework :: Django :: 5.2
47-
"""
48-
49-
setup(
50-
name='django_coverage_plugin',
51-
version='3.1.1rc1',
52-
description='Django template coverage.py plugin',
53-
long_description=(read('README.rst')),
54-
long_description_content_type='text/x-rst',
55-
author='Ned Batchelder',
56-
author_email='[email protected]',
57-
url='https://github.com/nedbat/django_coverage_plugin',
58-
packages=['django_coverage_plugin'],
59-
install_requires=[
60-
'coverage',
61-
],
62-
license='Apache-2.0',
63-
classifiers=classifiers.splitlines(),
64-
)
16+
# All configuration is now in pyproject.toml
17+
setup()

0 commit comments

Comments
 (0)