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

Skip to content

Commit 60890cd

Browse files
committed
Start transitioning to pyproject.toml
1 parent a24ee3c commit 60890cd

File tree

2 files changed

+64
-62
lines changed

2 files changed

+64
-62
lines changed

pyproject.toml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[project]
2+
name = "matplotlib"
3+
description = "Python plotting package"
4+
readme = "README.rst"
5+
license = { file = "LICENSE/LICENSE" }
6+
dynamic = ["authors", "version"]
7+
classifiers=[
8+
'Development Status :: 5 - Production/Stable',
9+
'Framework :: Matplotlib',
10+
'Intended Audience :: Science/Research',
11+
'Intended Audience :: Education',
12+
'License :: OSI Approved :: Python Software Foundation License',
13+
'Programming Language :: Python',
14+
'Programming Language :: Python :: 3',
15+
'Programming Language :: Python :: 3.8',
16+
'Programming Language :: Python :: 3.9',
17+
'Programming Language :: Python :: 3.10',
18+
'Programming Language :: Python :: 3.11',
19+
'Topic :: Scientific/Engineering :: Visualization',
20+
]
21+
dependencies = [
22+
"contourpy>=1.0.1",
23+
"cycler>=0.10",
24+
"fonttools>=4.22.0",
25+
"kiwisolver>=1.0.1",
26+
"numpy>=1.19",
27+
"packaging>=20.0",
28+
"pillow>=6.2.0",
29+
"pyparsing>=2.2.1",
30+
"python-dateutil>=2.7",
31+
"setuptools_scm"
32+
]
33+
requires-python = ">=3.8"
34+
platforms = ["any"]
35+
36+
[build-system]
37+
requires = [
38+
"setuptools>=45",
39+
"setuptools_scm[toml]>=7",
40+
"wheel",
41+
"certifi>=2020.06.20",
42+
"oldest-supported-numpy"
43+
]
44+
build-backend = "setuptools.build_meta"
45+
46+
[tool.setuptools.packages.find]
47+
where = ["lib"]
48+
49+
[tool.setuptools_scm]
50+
version_scheme = "release-branch-semver"
51+
local_scheme = "node-and-date"
52+
write_to = "lib/matplotlib/_version.py"
53+
parentdir_prefix_version = "matplotlib-"
54+
fallback_version = "0.0+UNKNOWN"
55+
56+
[project.urls]
57+
'Documentation' = 'https://matplotlib.org'
58+
'Source Code' = 'https://github.com/matplotlib/matplotlib'
59+
'Bug Tracker' = 'https://github.com/matplotlib/matplotlib/issues'
60+
'Forum' = 'https://discourse.matplotlib.org/'
61+
'Donate' = 'https://numfocus.org/donate-to-matplotlib'

setup.py

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@
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
3636

37+
sys.path.append(str(Path(__file__).resolve().parent))
38+
3739
import setupext
3840
from setupext import print_raw, print_status
3941

@@ -258,77 +260,16 @@ def make_release_tree(self, base_dir, files):
258260
package_data[key] = list(set(val + package_data[key]))
259261

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

302-
python_requires='>={}'.format('.'.join(str(n) for n in py_min_version)),
303-
setup_requires=[
304-
"certifi>=2020.06.20",
305-
"numpy>=1.19",
306-
"setuptools_scm>=7",
307-
],
308-
install_requires=[
309-
"contourpy>=1.0.1",
310-
"cycler>=0.10",
311-
"fonttools>=4.22.0",
312-
"kiwisolver>=1.0.1",
313-
"numpy>=1.19",
314-
"packaging>=20.0",
315-
"pillow>=6.2.0",
316-
"pyparsing>=2.2.1",
317-
"python-dateutil>=2.7",
318-
] + (
319-
# Installing from a git checkout that is not producing a wheel.
320-
["setuptools_scm>=7"] if (
321-
Path(__file__).with_name(".git").exists() and
322-
os.environ.get("CIBUILDWHEEL", "0") != "1"
323-
) else []
324-
),
325-
use_scm_version={
326-
"version_scheme": "release-branch-semver",
327-
"local_scheme": "node-and-date",
328-
"write_to": "lib/matplotlib/_version.py",
329-
"parentdir_prefix_version": "matplotlib-",
330-
"fallback_version": "0.0+UNKNOWN",
331-
},
332273
cmdclass={
333274
"build_ext": BuildExtraLibraries,
334275
"build_py": BuildPy,

0 commit comments

Comments
 (0)