From e83034a2f54c1cb733a8d2bd38c000c817d133c3 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 19 Mar 2020 17:32:35 +0100 Subject: [PATCH] Inline some more kwargs into setup.py's setup() call. - long_description can be defined right where it's used. - It seems nicer to also define classifiers at the point of use (together with other "metadata"-like entries) rather than at the top of the file, far away from the point of use. --- setup.py | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/setup.py b/setup.py index 3b2eb28a8c02..7922aefb8708 100644 --- a/setup.py +++ b/setup.py @@ -73,21 +73,6 @@ ] -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.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Topic :: Scientific/Engineering :: Visualization', - ] - - class NoopTestCommand(TestCommand): def __init__(self, dist): print("Matplotlib does not support running tests with " @@ -222,10 +207,6 @@ def run(self): with open('lib/matplotlib/mpl-data/matplotlibrc', 'w') as fd: fd.write(''.join(template_lines)) - # Use Readme as long description - with open('README.rst', encoding='utf-8') as fd: - long_description = fd.read() - # Finally, pass this all along to distutils to do the heavy lifting. setup( name="matplotlib", @@ -242,10 +223,24 @@ def run(self): 'Forum': 'https://discourse.matplotlib.org/', 'Donate': 'https://numfocus.org/donate-to-matplotlib' }, - long_description=long_description, + long_description=Path("README.rst").read_text(encoding="utf-8"), long_description_content_type="text/x-rst", 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.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Topic :: Scientific/Engineering :: Visualization', + ], + package_dir={"": "lib"}, packages=find_packages("lib"), namespace_packages=["mpl_toolkits"], @@ -254,7 +249,6 @@ def run(self): # real extensions that can depend on numpy for the build. ext_modules=[Extension("", [])], package_data=package_data, - classifiers=classifiers, python_requires='>={}'.format('.'.join(str(n) for n in min_version)), setup_requires=[