From 780aa14615559010e52f128a62324b4f16c2eb3f Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 7 Jul 2023 21:42:52 +0300 Subject: [PATCH 1/2] Modernize packaging a bit Adding pyproject.toml allows the package to be installed using PEP517 instead of legacy `setup.py install` method. At least pip says so in a warning when installing without the `wheel` package available. Change setup.py to setup.cfg (using a script[0]) because setup.py is out of fashion these days. Remove MANIFEST.ini since LICENSE is implied[1]. [0] https://github.com/gvalkov/setuptools-py2cfg [1] https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-license-files --- MANIFEST.in | 1 - pyproject.toml | 3 +++ setup.cfg | 32 ++++++++++++++++++++++++++++++-- setup.py | 39 --------------------------------------- 4 files changed, 33 insertions(+), 42 deletions(-) delete mode 100644 MANIFEST.in create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 1aba38f..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include LICENSE diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fed528d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index aa76bae..6eee9ad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,30 @@ -[bdist_wheel] -universal=0 +[metadata] +name = mypy_extensions +version = 1.0.0-dev +author = The mypy developers +author_email = jukka.lehtosalo@iki.fi +license = MIT License +description = Type system extensions for programs checked with the mypy type checker. +url = https://github.com/python/mypy_extensions +long_description = Mypy Extensions + =============== + + The "mypy_extensions" module defines extensions to the standard "typing" module + that are supported by the mypy type checker and the mypyc compiler. + +classifiers = + Development Status :: 5 - Production/Stable + Environment :: Console + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Topic :: Software Development + +[options] +py_modules = mypy_extensions +python_requires = >=3.7 diff --git a/setup.py b/setup.py deleted file mode 100644 index 5bd5f0f..0000000 --- a/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -from setuptools import setup - -version = '1.0.0-dev' -description = 'Type system extensions for programs checked with the mypy type checker.' -long_description = ''' -Mypy Extensions -=============== - -The "mypy_extensions" module defines extensions to the standard "typing" module -that are supported by the mypy type checker and the mypyc compiler. -'''.lstrip() - -classifiers = [ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Topic :: Software Development', -] - -setup( - name='mypy_extensions', - python_requires='>=3.7', - version=version, - description=description, - long_description=long_description, - author='The mypy developers', - author_email='jukka.lehtosalo@iki.fi', - url='https://github.com/python/mypy_extensions', - license='MIT License', - py_modules=['mypy_extensions'], - classifiers=classifiers, -) From aad94101105226e326869f041ef61eabb29e75fd Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 7 Jul 2023 23:31:35 +0300 Subject: [PATCH 2/2] Move setuptools config from setup.cfg with pyproject.toml Supported since setuptools 61.0.0, more standard. --- pyproject.toml | 28 +++++++++++++++++++++++++++- setup.cfg | 30 ------------------------------ 2 files changed, 27 insertions(+), 31 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index fed528d..678fda6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,29 @@ [build-system] -requires = ["setuptools"] +requires = ["setuptools>=61.0.0"] build-backend = "setuptools.build_meta" + +[project] +name = "mypy_extensions" +version = "1.0.0-dev" +description = "Type system extensions for programs checked with the mypy type checker." +readme = "README.md" +license = {file = "LICENSE"} +requires-python = ">=3.7" +authors = [ + {name = "The mypy developers", email = "jukka.lehtosalo@iki.fi"}, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Software Development", +] +[project.urls] +Repository = "https://github.com/python/mypy_extensions" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6eee9ad..0000000 --- a/setup.cfg +++ /dev/null @@ -1,30 +0,0 @@ -[metadata] -name = mypy_extensions -version = 1.0.0-dev -author = The mypy developers -author_email = jukka.lehtosalo@iki.fi -license = MIT License -description = Type system extensions for programs checked with the mypy type checker. -url = https://github.com/python/mypy_extensions -long_description = Mypy Extensions - =============== - - The "mypy_extensions" module defines extensions to the standard "typing" module - that are supported by the mypy type checker and the mypyc compiler. - -classifiers = - Development Status :: 5 - Production/Stable - Environment :: Console - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Topic :: Software Development - -[options] -py_modules = mypy_extensions -python_requires = >=3.7