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

Skip to content

Commit 3fe5d58

Browse files
committed
Start transitioning to pyproject.toml
1 parent f8cf0ee commit 3fe5d58

File tree

2 files changed

+41
-35
lines changed

2 files changed

+41
-35
lines changed

pyproject.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[project]
2+
name = "matplotlib"
3+
description = "Python plotting package"
4+
readme = "README.rst"
5+
license = { file = "LICENSE/LICENSE" }
6+
dynamic = ["authors", "dependencies", "requires-python", "urls", "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+
'Topic :: Scientific/Engineering :: Visualization',
19+
]
20+
21+
[build-system]
22+
requires = ["setuptools>=45", "setuptools_scm[toml]>=7", "wheel", "certifi>=2020.06.20", "numpy>=1.19"]
23+
build-backend = "setuptools.build_meta"
24+
25+
[tool.setuptools_scm]
26+
version_scheme = "release-branch-semver"
27+
local_scheme = "node-and-date"
28+
write_to = "lib/matplotlib/_version.py"
29+
parentdir_prefix_version = "matplotlib-"
30+
fallback_version = "0.0+UNKNOWN"
31+
32+
[tool.setuptools.packages.find]
33+
where = ['lib']
34+
exclude = ["matplotlib.tests*", "mpl_toolkits.tests*"]

setup.py

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
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,8 +260,6 @@ 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",
@@ -271,39 +271,18 @@ def make_release_tree(self, base_dir, files):
271271
'Forum': 'https://discourse.matplotlib.org/',
272272
'Donate': 'https://numfocus.org/donate-to-matplotlib'
273273
},
274-
long_description=Path("README.rst").read_text(encoding="utf-8"),
275-
long_description_content_type="text/x-rst",
276-
license="PSF",
277274
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-
'Topic :: Scientific/Engineering :: Visualization',
290-
],
291-
292-
package_dir={"": "lib"},
293-
packages=find_packages("lib"),
294-
namespace_packages=["mpl_toolkits"],
275+
276+
#package_dir={"": "lib"},
277+
#packages=find_packages("lib"),
278+
#namespace_packages=["mpl_toolkits"],
295279
py_modules=["pylab"],
296280
# Dummy extension to trigger build_ext, which will swap it out with
297281
# real extensions that can depend on numpy for the build.
298282
ext_modules=[Extension("", [])],
299-
package_data=package_data,
283+
# package_data=package_data,
300284

301285
python_requires='>={}'.format('.'.join(str(n) for n in py_min_version)),
302-
setup_requires=[
303-
"certifi>=2020.06.20",
304-
"numpy>=1.19",
305-
"setuptools_scm>=7",
306-
],
307286
install_requires=[
308287
"contourpy>=1.0.1",
309288
"cycler>=0.10",
@@ -321,13 +300,6 @@ def make_release_tree(self, base_dir, files):
321300
os.environ.get("CIBUILDWHEEL", "0") != "1"
322301
) else []
323302
),
324-
use_scm_version={
325-
"version_scheme": "release-branch-semver",
326-
"local_scheme": "node-and-date",
327-
"write_to": "lib/matplotlib/_version.py",
328-
"parentdir_prefix_version": "matplotlib-",
329-
"fallback_version": "0.0+UNKNOWN",
330-
},
331303
cmdclass={
332304
"build_ext": BuildExtraLibraries,
333305
"build_py": BuildPy,

0 commit comments

Comments
 (0)