Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66a591d

Browse files
oscargusissamarabi
authored andcommitted
Start transitioning to pyproject.toml
1 parent 4d95735 commit 66a591d

File tree

2 files changed

+89
-79
lines changed

2 files changed

+89
-79
lines changed

pyproject.toml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,73 @@
1+
[project]
2+
name = "matplotlib"
3+
authors = [
4+
{email = "[email protected]"},
5+
{name = "John D. Hunter, Michael Droettboom"}
6+
]
7+
description = "Python plotting package"
8+
readme = "README.md"
9+
license = { file = "LICENSE/LICENSE" }
10+
dynamic = ["version"]
11+
classifiers=[
12+
"Development Status :: 5 - Production/Stable",
13+
"Framework :: Matplotlib",
14+
"Intended Audience :: Science/Research",
15+
"Intended Audience :: Education",
16+
"License :: OSI Approved :: Python Software Foundation License",
17+
"Programming Language :: Python",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Topic :: Scientific/Engineering :: Visualization",
24+
]
25+
26+
# When updating the list of dependencies, add an api_changes/development
27+
# entry and also update the following places:
28+
# - lib/matplotlib/__init__.py (matplotlib._check_versions())
29+
# - requirements/testing/minver.txt
30+
# - doc/devel/dependencies.rst
31+
# - .github/workflows/tests.yml
32+
# - environment.yml
33+
dependencies = [
34+
"contourpy >= 1.0.1",
35+
"cycler >= 0.10",
36+
"fonttools >= 4.22.0",
37+
"kiwisolver >= 1.3.1",
38+
"numpy >= 1.21",
39+
"packaging >= 20.0",
40+
"pillow >= 8",
41+
"pyparsing >= 2.3.1",
42+
"python-dateutil >= 2.7",
43+
"setuptools >= 64",
44+
"setuptools_scm >= 7",
45+
"importlib-resources >= 3.2.0; python_version < '3.10'",
46+
]
47+
requires-python = ">=3.9"
48+
49+
[project.optional-dependencies]
50+
# Should be a copy of the build dependencies below.
51+
dev = [
52+
"certifi>=2020.06.20",
53+
"numpy>=1.25",
54+
"pybind11>=2.6",
55+
"setuptools>=64",
56+
"setuptools_scm>=7",
57+
]
58+
59+
[project.urls]
60+
"Homepage" = "https://matplotlib.org"
61+
"Download" = "https://matplotlib.org/stable/users/installing/index.html"
62+
"Documentation" = "https://matplotlib.org"
63+
"Source Code" = "https://github.com/matplotlib/matplotlib"
64+
"Bug Tracker" = "https://github.com/matplotlib/matplotlib/issues"
65+
"Forum" = "https://discourse.matplotlib.org/"
66+
"Donate" = "https://numfocus.org/donate-to-matplotlib"
67+
168
[build-system]
269
build-backend = "setuptools.build_meta"
70+
# Also keep in sync with optional dependencies above.
371
requires = [
472
"certifi>=2020.06.20",
573
"numpy>=1.25",
@@ -8,6 +76,26 @@ requires = [
876
"setuptools_scm>=7",
977
]
1078

79+
[tool.setuptools]
80+
platforms = ["any"]
81+
py-modules = ["pylab"]
82+
license-files = ["LICENSE/*"]
83+
namespace-packages = ["mpl_toolkits"]
84+
85+
[tool.setuptools.packages.find]
86+
where = ["lib"]
87+
include = ["matplotlib*", "mpl_toolkits*"]
88+
exclude = [
89+
"matplotlib.tests*",
90+
"mpl_toolkits.axes_grid1.tests*",
91+
"mpl_toolkits.axisartist.tests*",
92+
"mpl_toolkits.mplot3d.tests*",
93+
]
94+
namespaces = true
95+
96+
[tool.setuptools.exclude-package-data]
97+
"*" = ["*.png", "*.svg"]
98+
1199
[tool.setuptools_scm]
12100
version_scheme = "release-branch-semver"
13101
local_scheme = "node-and-date"

setup.py

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import shutil
3030
import subprocess
3131

32-
from setuptools import setup, find_namespace_packages, Distribution, Extension
32+
from setuptools import setup, Distribution, Extension
3333
import setuptools.command.build_ext
3434
import setuptools.command.build_py
3535
import setuptools.command.sdist
@@ -277,89 +277,11 @@ def make_release_tree(self, base_dir, files):
277277
package_data[key] = list(set(val + package_data[key]))
278278

279279
setup( # Finally, pass this all along to setuptools to do the heavy lifting.
280-
name="matplotlib",
281-
description="Python plotting package",
282-
author="John D. Hunter, Michael Droettboom",
283-
author_email="[email protected]",
284-
url="https://matplotlib.org",
285-
download_url="https://matplotlib.org/stable/users/installing/index.html",
286-
project_urls={
287-
'Documentation': 'https://matplotlib.org',
288-
'Source Code': 'https://github.com/matplotlib/matplotlib',
289-
'Bug Tracker': 'https://github.com/matplotlib/matplotlib/issues',
290-
'Forum': 'https://discourse.matplotlib.org/',
291-
'Donate': 'https://numfocus.org/donate-to-matplotlib'
292-
},
293-
long_description=Path("README.md").read_text(encoding="utf-8"),
294-
long_description_content_type="text/markdown",
295-
license="PSF",
296-
platforms="any",
297-
classifiers=[
298-
'Development Status :: 5 - Production/Stable',
299-
'Framework :: Matplotlib',
300-
'Intended Audience :: Science/Research',
301-
'Intended Audience :: Education',
302-
'License :: OSI Approved :: Python Software Foundation License',
303-
'Programming Language :: Python',
304-
'Programming Language :: Python :: 3',
305-
'Programming Language :: Python :: 3.9',
306-
'Programming Language :: Python :: 3.10',
307-
'Programming Language :: Python :: 3.11',
308-
'Programming Language :: Python :: 3.12',
309-
'Topic :: Scientific/Engineering :: Visualization',
310-
],
311-
312-
package_dir={"": "lib"},
313-
packages=find_namespace_packages(
314-
where="lib",
315-
exclude=["*baseline_images*", "*tinypages*", "*mpl-data*", "*web_backend*"],
316-
),
317-
py_modules=["pylab"],
318280
# Dummy extension to trigger build_ext, which will swap it out with
319281
# real extensions that can depend on numpy for the build.
320282
ext_modules=[Extension("", [])],
321283
package_data=package_data,
322284

323-
python_requires='>={}'.format('.'.join(str(n) for n in py_min_version)),
324-
# When updating the list of dependencies, add an api_changes/development
325-
# entry and also update the following places:
326-
# - lib/matplotlib/__init__.py (matplotlib._check_versions())
327-
# - requirements/testing/minver.txt
328-
# - doc/devel/dependencies.rst
329-
# - .github/workflows/tests.yml
330-
# - environment.yml
331-
install_requires=[
332-
"contourpy>=1.0.1",
333-
"cycler>=0.10",
334-
"fonttools>=4.22.0",
335-
"kiwisolver>=1.3.1",
336-
"numpy>=1.21",
337-
"packaging>=20.0",
338-
"pillow>=8",
339-
"pyparsing>=2.3.1",
340-
"python-dateutil>=2.7",
341-
] + (
342-
# Installing from a git checkout that is not producing a wheel.
343-
# setuptools_scm warns with older setuptools, which turns into errors for our
344-
# test suite. However setuptools_scm does not themselves pin the version of
345-
# setuptools.
346-
["setuptools_scm>=7", "setuptools>=64"] if (
347-
Path(__file__).with_name(".git").exists() and
348-
os.environ.get("CIBUILDWHEEL", "0") != "1"
349-
) else []
350-
),
351-
extras_require={
352-
':python_version<"3.10"': [
353-
"importlib-resources>=3.2.0",
354-
],
355-
},
356-
use_scm_version={
357-
"version_scheme": "release-branch-semver",
358-
"local_scheme": "node-and-date",
359-
"write_to": "lib/matplotlib/_version.py",
360-
"parentdir_prefix_version": "matplotlib-",
361-
"fallback_version": "0.0+UNKNOWN",
362-
},
363285
cmdclass={
364286
"build_ext": BuildExtraLibraries,
365287
"build_py": BuildPy,

0 commit comments

Comments
 (0)