diff --git a/pyproject.toml b/pyproject.toml index 8c51b1556a3b..7d200c454fd3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,48 @@ +[project] +name = "matplotlib" +authors = [ + {email = "matplotlib-users@python.org"}, + {name = "John D. Hunter, Michael Droettboom"} +] +description = "Python plotting package" +readme = "README.md" +license = { file = "LICENSE/LICENSE" } +dynamic = ["version", "optional-dependencies"] +classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Framework :: Matplotlib', + 'Intended Audience :: Science/Research', + 'Intended Audience :: Education', + 'License :: OSI Approved :: Python Software Foundation License', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Topic :: Scientific/Engineering :: Visualization', +] + +# When updating the list of dependencies, add an api_changes/development +# entry and also update the following places: +# - lib/matplotlib/__init__.py (matplotlib._check_versions()) +# - requirements/testing/minver.txt +# - doc/devel/dependencies.rst +# - .github/workflows/tests.yml +# - environment.yml +dependencies = [ + "contourpy>=1.0.1", + "cycler>=0.10", + "fonttools>=4.22.0", + "kiwisolver>=1.0.1", + "numpy>=1.21", + "packaging>=20.0", + "pillow>=6.2.0", + "pyparsing>=2.3.1", + "python-dateutil>=2.7", + "setuptools_scm>=7.0" +] +requires-python = ">=3.9" + [build-system] build-backend = "setuptools.build_meta" requires = [ @@ -7,7 +52,6 @@ requires = [ "setuptools_scm>=7", ] - [tool.isort] known_mpltoolkits = "mpl_toolkits" known_pydata = "numpy, matplotlib.pyplot" @@ -15,3 +59,38 @@ known_firstparty = "matplotlib" sections = "FUTURE,STDLIB,THIRDPARTY,PYDATA,FIRSTPARTY,MPLTOOLKITS,LOCALFOLDER" no_lines_before = "MPLTOOLKITS" force_sort_within_sections = true + +[tool.setuptools] +platforms = ["any"] +py-modules = ["pylab"] +namespace-packages = ["mpl_toolkits"] + +[tool.setuptools.packages.find] +where = ["lib"] +include = ["matplotlib*", "mpl_toolkits*"] +exclude = [ + "matplotlib.tests*", + "mpl_toolkits.axes_grid1.tests*", + "mpl_toolkits.axisartist.tests*", + "mpl_toolkits.mplot3d.tests*" +] +namespaces = false + +[tool.setuptools.exclude-package-data] +"*" = ["*.png", "*.svg"] + +[tool.setuptools_scm] +version_scheme = "release-branch-semver" +local_scheme = "node-and-date" +write_to = "lib/matplotlib/_version.py" +parentdir_prefix_version = "matplotlib-" +fallback_version = "0.0+UNKNOWN" + +[project.urls] +'Homepage' = 'https://matplotlib.org' +'Download' = 'https://matplotlib.org/stable/users/installing/index.html' +'Documentation' = 'https://matplotlib.org' +'Source Code' = 'https://github.com/matplotlib/matplotlib' +'Bug Tracker' = 'https://github.com/matplotlib/matplotlib/issues' +'Forum' = 'https://discourse.matplotlib.org/' +'Donate' = 'https://numfocus.org/donate-to-matplotlib' diff --git a/setup.py b/setup.py index bbaa56f3d619..9c49ad00d4e2 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ import shutil import subprocess -from setuptools import setup, find_packages, Distribution, Extension +from setuptools import setup, Distribution, Extension import setuptools.command.build_ext import setuptools.command.build_py import setuptools.command.sdist @@ -268,83 +268,16 @@ def make_release_tree(self, base_dir, files): package_data[key] = list(set(val + package_data[key])) setup( # Finally, pass this all along to setuptools to do the heavy lifting. - name="matplotlib", - description="Python plotting package", - author="John D. Hunter, Michael Droettboom", - author_email="matplotlib-users@python.org", - url="https://matplotlib.org", - download_url="https://matplotlib.org/stable/users/installing/index.html", - project_urls={ - 'Documentation': 'https://matplotlib.org', - 'Source Code': 'https://github.com/matplotlib/matplotlib', - 'Bug Tracker': 'https://github.com/matplotlib/matplotlib/issues', - 'Forum': 'https://discourse.matplotlib.org/', - 'Donate': 'https://numfocus.org/donate-to-matplotlib' - }, - long_description=Path("README.md").read_text(encoding="utf-8"), - long_description_content_type="text/markdown", - license="PSF", - platforms="any", - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Framework :: Matplotlib', - 'Intended Audience :: Science/Research', - 'Intended Audience :: Education', - 'License :: OSI Approved :: Python Software Foundation License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Topic :: Scientific/Engineering :: Visualization', - ], - - package_dir={"": "lib"}, - packages=find_packages("lib"), - namespace_packages=["mpl_toolkits"], - py_modules=["pylab"], # Dummy extension to trigger build_ext, which will swap it out with # real extensions that can depend on numpy for the build. ext_modules=[Extension("", [])], package_data=package_data, - python_requires='>={}'.format('.'.join(str(n) for n in py_min_version)), - # When updating the list of dependencies, add an api_changes/development - # entry and also update the following places: - # - lib/matplotlib/__init__.py (matplotlib._check_versions()) - # - requirements/testing/minver.txt - # - doc/devel/dependencies.rst - # - .github/workflows/tests.yml - # - environment.yml - install_requires=[ - "contourpy>=1.0.1", - "cycler>=0.10", - "fonttools>=4.22.0", - "kiwisolver>=1.0.1", - "numpy>=1.21", - "packaging>=20.0", - "pillow>=6.2.0", - "pyparsing>=2.3.1", - "python-dateutil>=2.7", - ] + ( - # Installing from a git checkout that is not producing a wheel. - ["setuptools_scm>=7"] if ( - Path(__file__).with_name(".git").exists() and - os.environ.get("CIBUILDWHEEL", "0") != "1" - ) else [] - ), extras_require={ ':python_version<"3.10"': [ "importlib-resources>=3.2.0", ], }, - use_scm_version={ - "version_scheme": "release-branch-semver", - "local_scheme": "node-and-date", - "write_to": "lib/matplotlib/_version.py", - "parentdir_prefix_version": "matplotlib-", - "fallback_version": "0.0+UNKNOWN", - }, cmdclass={ "build_ext": BuildExtraLibraries, "build_py": BuildPy,