Skip to content

Commit 2fb9022

Browse files
committed
Rework build system for latest pypa tooling
1 parent f1c2150 commit 2fb9022

File tree

3 files changed

+45
-39
lines changed

3 files changed

+45
-39
lines changed

pyproject.toml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = [
3-
"setuptools>=68.0"
3+
"setuptools>=77.0"
44
]
55
build-backend = "setuptools.build_meta"
66

@@ -15,26 +15,27 @@ maintainers = [
1515
]
1616
description = "Ctypes-based simple MagickWand API binding for Python"
1717
readme = { file = "README.rst", content-type = "text/x-rst" }
18-
requires-python = ">=3.7"
18+
requires-python = ">=3.8"
1919
keywords = ["ImageMagick", "ctypes"]
20-
license = {text = "MIT License"}
20+
license = "MIT"
21+
license-files = ["LICENSE"]
2122
classifiers = [
2223
"Development Status :: 5 - Production/Stable",
2324
"Intended Audience :: Developers",
24-
"License :: OSI Approved :: MIT License",
2525
"Operating System :: OS Independent",
26-
"Programming Language :: Python :: 3.7",
2726
"Programming Language :: Python :: 3.8",
2827
"Programming Language :: Python :: 3.9",
2928
"Programming Language :: Python :: 3.10",
3029
"Programming Language :: Python :: 3.11",
3130
"Programming Language :: Python :: 3.12",
31+
"Programming Language :: Python :: 3.13",
32+
"Programming Language :: Python :: 3.14",
3233
"Programming Language :: Python :: Implementation :: CPython",
3334
"Programming Language :: Python :: Implementation :: PyPy",
3435
"Programming Language :: Python :: Implementation :: Stackless",
3536
"Topic :: Multimedia :: Graphics",
3637
]
37-
dynamic = ["version"]
38+
version = "0.7.0"
3839

3940
[project.optional-dependencies]
4041
test = ["pytest >= 7.2.0"]
@@ -47,12 +48,17 @@ Repository = "https://github.com/emcconville/wand"
4748
Tracker = "https://github.com/emcconville/wand/issues"
4849
Changelog = "https://docs.wand-py.org/en/latest/changes.html"
4950

50-
[tools.setuptools]
51-
packages = ["wand", "wand.cdefs"]
52-
5351
[tool.setuptools.packages.find]
5452
include = ["wand", "wand.cdefs"]
55-
exclude = ["prof", "temp", "sample", "support"]
53+
exclude = [
54+
"prof",
55+
"reports",
56+
"sample",
57+
"support",
58+
"temp"
59+
]
5660

57-
[tool.setuptools.dynamic]
58-
version = { attr = "wand.VERSION" }
61+
[tool.pytest.ini_options]
62+
minversion = "7.2.0"
63+
testpaths = ["tests"]
64+
addopts = "--skip-pdf --skip-fft"

setup.py

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,14 @@ def readme():
1111
return f.read()
1212

1313

14-
try:
15-
from setuptools.command.test import test
16-
except ImportError:
17-
cmdclass = {}
18-
else:
19-
class pytest(test):
20-
21-
def finalize_options(self):
22-
test.finalize_options(self)
23-
self.test_args = []
24-
self.test_suite = True
25-
26-
def run_tests(self):
27-
from pytest import main
28-
errno = main(self.test_args)
29-
raise SystemExit(errno)
30-
cmdclass = {'test': pytest}
31-
3214
wand_includes = [
3315
"wand",
3416
"wand.cdefs"
3517
]
3618

3719
wand_excludes = [
3820
"prof", # CI Memory profile.
21+
"reports", # CI coverage reports.
3922
"temp", # CI artifacts.
4023
"sample", # Old documents.
4124
"support", # Non-public issues.
@@ -59,7 +42,8 @@ def run_tests(self):
5942
description='Ctypes-based simple MagickWand API binding for Python',
6043
long_description=readme(),
6144
long_description_content_type='text/x-rst',
62-
license='MIT License',
45+
license='MIT',
46+
license_files = ['LICENSE'],
6347
author='Hong Minhee',
6448
author_email='hongminhee' '@' 'member.fsf.org',
6549
maintainer='E. McConville',
@@ -70,26 +54,20 @@ def run_tests(self):
7054
classifiers=[
7155
'Development Status :: 5 - Production/Stable',
7256
'Intended Audience :: Developers',
73-
'License :: OSI Approved :: MIT License',
7457
'Operating System :: OS Independent',
75-
'Programming Language :: Python :: 3',
76-
'Programming Language :: Python :: 3.3',
77-
'Programming Language :: Python :: 3.4',
78-
'Programming Language :: Python :: 3.5',
79-
'Programming Language :: Python :: 3.6',
80-
'Programming Language :: Python :: 3.7',
8158
'Programming Language :: Python :: 3.8',
8259
'Programming Language :: Python :: 3.9',
8360
'Programming Language :: Python :: 3.10',
8461
'Programming Language :: Python :: 3.11',
8562
'Programming Language :: Python :: 3.12',
63+
"Programming Language :: Python :: 3.13",
64+
"Programming Language :: Python :: 3.14",
8665
'Programming Language :: Python :: Implementation :: CPython',
8766
'Programming Language :: Python :: Implementation :: PyPy',
8867
'Programming Language :: Python :: Implementation :: Stackless',
8968
'Topic :: Multimedia :: Graphics'
9069
],
9170
keywords='ImageMagick ctypes',
92-
cmdclass=cmdclass,
9371
project_urls={
9472
'Documentation': 'https://docs.wand-py.org',
9573
'Source': 'https://github.com/emcconville/wand',

tests/_pyproject_test.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from pathlib import Path
2+
from pytest import mark
3+
from wand.version import VERSION
4+
try:
5+
import tomllib
6+
except ImportError:
7+
tomllib = None
8+
9+
CFG_ROOT = Path(__file__).parent.parent
10+
CFG_PATH = CFG_ROOT / "pyproject.toml"
11+
12+
def test_pyproject_exists():
13+
assert CFG_PATH.exists()
14+
15+
@mark.skipif(tomllib is None, reason="tomllib not available")
16+
def test_pyproject_valid():
17+
with open(CFG_PATH, 'rb') as fd:
18+
cfg = tomllib.load(fd)
19+
assert 'project' in cfg
20+
project = cfg.get('project', {})
21+
assert project.get('name') in ['wand', 'Wand']
22+
assert project.get('version') == VERSION

0 commit comments

Comments
 (0)