From ee5d3e6b86293861a475c6c9cf394dd2bb227e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Sun, 9 Nov 2025 09:07:58 +0100 Subject: [PATCH 1/3] MNT: migrate build metadata from setup.cfg to pyproject.toml --- .flake8 | 6 ++++ MANIFEST.in | 1 - pyproject.toml | 93 +++++++++++++++++++++++++++++++++++++++++++++++--- setup.cfg | 68 ------------------------------------ setup.py | 5 --- 5 files changed, 95 insertions(+), 78 deletions(-) create mode 100644 .flake8 delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..98825526 --- /dev/null +++ b/.flake8 @@ -0,0 +1,6 @@ +[flake8] +max-line-length = 120 +ignore = W503,W504 + +[pycodestyle] +max_line_length = 120 diff --git a/MANIFEST.in b/MANIFEST.in index f8d43152..5eec5f6a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ -include LICENSE include README.rst include CHANGES.md include tox.ini diff --git a/pyproject.toml b/pyproject.toml index 590e0b11..a0920a9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,90 @@ [build-system] -requires = ["setuptools>=30.3.0", - "setuptools_scm", - "wheel"] -build-backend = 'setuptools.build_meta' +requires = [ + "setuptools>=80", + "setuptools-scm[simple]>=8", +] +build-backend = "setuptools.build_meta" + +[project] +name = "pytest-mpl" +authors = [ + { name = "Thomas Robitaille", email = "thomas.robitaille@gmail.com" }, +] +license = "BSD-2-Clause" +license-files = [ + "LICENSE", +] +classifiers = [ + "Development Status :: 4 - Beta", + "Framework :: Pytest", + "Intended Audience :: Developers", + "Topic :: Software Development :: Testing", + "Topic :: Scientific/Engineering :: Visualization", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", +] +description = "pytest plugin to help with testing figures output from Matplotlib" +requires-python = ">=3.9" +dependencies = [ + "pytest", + "matplotlib", + "importlib_resources;python_version<'3.8'", + "packaging", + "Jinja2", + "Pillow", +] +dynamic = [ + "version", +] + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[project.urls] +Homepage = "https://github.com/matplotlib/pytest-mpl" + +[project.entry-points.pytest11] +pytest_mpl = "pytest_mpl.plugin" + +[project.optional-dependencies] +test = [ + "pytest-cov", +] +docs = [ + "sphinx", + "mpl_sphinx_theme>=3.9.0", + "sphinx_design", + "matplotlib==3.9.*", +] + +[tool.setuptools] +zip-safe = true +include-package-data = true + +[tool.setuptools.packages.find] +namespaces = false + +[tool.pytest.ini_options] +testpaths = [ + "tests", +] +norecursedirs = [ + "tests/subtests/subtest", +] +filterwarnings = [ + "error", + "ignore:distutils Version classes are deprecated", + "ignore:the imp module is deprecated in favour of importlib", + "ignore:The NumPy module was reloaded", +] + +[tool.isort] +balanced_wrapping = true +length_sort = false +length_sort_sections = [ + "stdlib", +] +line_length = 100 + diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 2d6642e3..00000000 --- a/setup.cfg +++ /dev/null @@ -1,68 +0,0 @@ -[metadata] -license_file = LICENSE -name = pytest-mpl -url = https://github.com/matplotlib/pytest-mpl -author = Thomas Robitaille -author_email = thomas.robitaille@gmail.com -classifiers = - Development Status :: 4 - Beta - Framework :: Pytest - Intended Audience :: Developers - Topic :: Software Development :: Testing - Topic :: Scientific/Engineering :: Visualization - Programming Language :: Python - Programming Language :: Python :: 3 - Operating System :: OS Independent - License :: OSI Approved :: BSD License -license = BSD -description = pytest plugin to help with testing figures output from Matplotlib -long_description = file: README.rst -long_description_content_type = text/x-rst - -[options] -zip_safe = True -packages = find: -include_package_data = True -python_requires = >=3.9 -install_requires = - pytest - matplotlib - importlib_resources;python_version<'3.8' - packaging - Jinja2 - Pillow - -[options.entry_points] -pytest11 = - pytest_mpl = pytest_mpl.plugin - -[options.extras_require] -test = - pytest-cov -docs = - sphinx - mpl_sphinx_theme>=3.9.0 - sphinx_design - matplotlib==3.9.* - -[tool:pytest] -testpaths = tests -norecursedirs = tests/subtests/subtest -filterwarnings = - error - ignore:distutils Version classes are deprecated - ignore:the imp module is deprecated in favour of importlib - ignore:The NumPy module was reloaded - -[flake8] -max-line-length = 120 -ignore = W503,W504 - -[pycodestyle] -max_line_length = 120 - -[isort] -balanced_wrapping = True -length_sort = False -length_sort_sections = stdlib -line_length = 100 diff --git a/setup.py b/setup.py deleted file mode 100644 index 92354ee1..00000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup - -setup(use_scm_version=True) From f5721f3867115c6b9d33f1f55875be373095b096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Sun, 9 Nov 2025 09:08:43 +0100 Subject: [PATCH 2/3] DEP: drop unused dependency on importlib-metadata --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a0920a9f..2cb20742 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,6 @@ requires-python = ">=3.9" dependencies = [ "pytest", "matplotlib", - "importlib_resources;python_version<'3.8'", "packaging", "Jinja2", "Pillow", From d1271eead99aafe3f5ab815154e1215e93317a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Sun, 9 Nov 2025 09:16:35 +0100 Subject: [PATCH 3/3] DEP: add missing lower bounds on direct dependencies (best guess) --- pyproject.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2cb20742..18ba6e4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ license-files = [ "LICENSE", ] classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Framework :: Pytest", "Intended Audience :: Developers", "Topic :: Software Development :: Testing", @@ -27,11 +27,11 @@ classifiers = [ description = "pytest plugin to help with testing figures output from Matplotlib" requires-python = ">=3.9" dependencies = [ - "pytest", - "matplotlib", - "packaging", - "Jinja2", - "Pillow", + "pytest>=5.4.0", + "matplotlib>=3.3.3", + "packaging>=22.0.0", + "Jinja2>=2.10.2", + "Pillow>=8.1.1", ] dynamic = [ "version", @@ -49,12 +49,12 @@ pytest_mpl = "pytest_mpl.plugin" [project.optional-dependencies] test = [ - "pytest-cov", + "pytest-cov>=6.0.0", ] docs = [ - "sphinx", + "sphinx>=7.0.0", "mpl_sphinx_theme>=3.9.0", - "sphinx_design", + "sphinx_design>=0.6.0", "matplotlib==3.9.*", ]