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

Skip to content

Commit e40edd8

Browse files
committed
Start transitioning to pyproject.toml
1 parent 22d036e commit e40edd8

File tree

2 files changed

+81
-69
lines changed

2 files changed

+81
-69
lines changed

pyproject.toml

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
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", "optional-dependencies"]
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+
'Topic :: Scientific/Engineering :: Visualization',
23+
]
24+
25+
# When updating the list of dependencies, add an api_changes/development
26+
# entry and also update the following places:
27+
# - lib/matplotlib/__init__.py (matplotlib._check_versions())
28+
# - requirements/testing/minver.txt
29+
# - doc/devel/dependencies.rst
30+
# - .github/workflows/tests.yml
31+
# - environment.yml
32+
dependencies = [
33+
"contourpy>=1.0.1",
34+
"cycler>=0.10",
35+
"fonttools>=4.22.0",
36+
"kiwisolver>=1.0.1",
37+
"numpy>=1.21",
38+
"packaging>=20.0",
39+
"pillow>=6.2.0",
40+
"pyparsing>=2.3.1",
41+
"python-dateutil>=2.7",
42+
"setuptools_scm>=7.0"
43+
]
44+
requires-python = ">=3.9"
45+
146
[build-system]
247
build-backend = "setuptools.build_meta"
348
requires = [
@@ -7,11 +52,45 @@ requires = [
752
"setuptools_scm>=7",
853
]
954

10-
1155
[tool.isort]
1256
known_mpltoolkits = "mpl_toolkits"
1357
known_pydata = "numpy, matplotlib.pyplot"
1458
known_firstparty = "matplotlib"
1559
sections = "FUTURE,STDLIB,THIRDPARTY,PYDATA,FIRSTPARTY,MPLTOOLKITS,LOCALFOLDER"
1660
no_lines_before = "MPLTOOLKITS"
1761
force_sort_within_sections = true
62+
63+
[tool.setuptools]
64+
platforms = ["any"]
65+
py-modules = ["pylab"]
66+
namespace-packages = ["mpl_toolkits"]
67+
68+
[tool.setuptools.packages.find]
69+
where = ["lib"]
70+
include = ["matplotlib*", "mpl_toolkits*"]
71+
exclude = [
72+
"matplotlib.tests*",
73+
"mpl_toolkits.axes_grid1.tests*",
74+
"mpl_toolkits.axisartist.tests*",
75+
"mpl_toolkits.mplot3d.tests*"
76+
]
77+
namespaces = false
78+
79+
[tool.setuptools.exclude-package-data]
80+
"*" = ["*.png", "*.svg"]
81+
82+
[tool.setuptools_scm]
83+
version_scheme = "release-branch-semver"
84+
local_scheme = "node-and-date"
85+
write_to = "lib/matplotlib/_version.py"
86+
parentdir_prefix_version = "matplotlib-"
87+
fallback_version = "0.0+UNKNOWN"
88+
89+
[project.urls]
90+
'Homepage' = 'https://matplotlib.org'
91+
'Download' = 'https://matplotlib.org/stable/users/installing/index.html'
92+
'Documentation' = 'https://matplotlib.org'
93+
'Source Code' = 'https://github.com/matplotlib/matplotlib'
94+
'Bug Tracker' = 'https://github.com/matplotlib/matplotlib/issues'
95+
'Forum' = 'https://discourse.matplotlib.org/'
96+
'Donate' = 'https://numfocus.org/donate-to-matplotlib'

setup.py

Lines changed: 1 addition & 68 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_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
@@ -268,83 +268,16 @@ def make_release_tree(self, base_dir, files):
268268
package_data[key] = list(set(val + package_data[key]))
269269

270270
setup( # Finally, pass this all along to setuptools to do the heavy lifting.
271-
name="matplotlib",
272-
description="Python plotting package",
273-
author="John D. Hunter, Michael Droettboom",
274-
author_email="[email protected]",
275-
url="https://matplotlib.org",
276-
download_url="https://matplotlib.org/stable/users/installing/index.html",
277-
project_urls={
278-
'Documentation': 'https://matplotlib.org',
279-
'Source Code': 'https://github.com/matplotlib/matplotlib',
280-
'Bug Tracker': 'https://github.com/matplotlib/matplotlib/issues',
281-
'Forum': 'https://discourse.matplotlib.org/',
282-
'Donate': 'https://numfocus.org/donate-to-matplotlib'
283-
},
284-
long_description=Path("README.md").read_text(encoding="utf-8"),
285-
long_description_content_type="text/markdown",
286-
license="PSF",
287-
platforms="any",
288-
classifiers=[
289-
'Development Status :: 5 - Production/Stable',
290-
'Framework :: Matplotlib',
291-
'Intended Audience :: Science/Research',
292-
'Intended Audience :: Education',
293-
'License :: OSI Approved :: Python Software Foundation License',
294-
'Programming Language :: Python',
295-
'Programming Language :: Python :: 3',
296-
'Programming Language :: Python :: 3.9',
297-
'Programming Language :: Python :: 3.10',
298-
'Programming Language :: Python :: 3.11',
299-
'Topic :: Scientific/Engineering :: Visualization',
300-
],
301-
302-
package_dir={"": "lib"},
303-
packages=find_packages("lib"),
304-
namespace_packages=["mpl_toolkits"],
305-
py_modules=["pylab"],
306271
# Dummy extension to trigger build_ext, which will swap it out with
307272
# real extensions that can depend on numpy for the build.
308273
ext_modules=[Extension("", [])],
309274
package_data=package_data,
310275

311-
python_requires='>={}'.format('.'.join(str(n) for n in py_min_version)),
312-
# When updating the list of dependencies, add an api_changes/development
313-
# entry and also update the following places:
314-
# - lib/matplotlib/__init__.py (matplotlib._check_versions())
315-
# - requirements/testing/minver.txt
316-
# - doc/devel/dependencies.rst
317-
# - .github/workflows/tests.yml
318-
# - environment.yml
319-
install_requires=[
320-
"contourpy>=1.0.1",
321-
"cycler>=0.10",
322-
"fonttools>=4.22.0",
323-
"kiwisolver>=1.0.1",
324-
"numpy>=1.21",
325-
"packaging>=20.0",
326-
"pillow>=6.2.0",
327-
"pyparsing>=2.3.1",
328-
"python-dateutil>=2.7",
329-
] + (
330-
# Installing from a git checkout that is not producing a wheel.
331-
["setuptools_scm>=7"] if (
332-
Path(__file__).with_name(".git").exists() and
333-
os.environ.get("CIBUILDWHEEL", "0") != "1"
334-
) else []
335-
),
336276
extras_require={
337277
':python_version<"3.10"': [
338278
"importlib-resources>=3.2.0",
339279
],
340280
},
341-
use_scm_version={
342-
"version_scheme": "release-branch-semver",
343-
"local_scheme": "node-and-date",
344-
"write_to": "lib/matplotlib/_version.py",
345-
"parentdir_prefix_version": "matplotlib-",
346-
"fallback_version": "0.0+UNKNOWN",
347-
},
348281
cmdclass={
349282
"build_ext": BuildExtraLibraries,
350283
"build_py": BuildPy,

0 commit comments

Comments
 (0)