-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Move static project metadata to pyproject.toml #18146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,72 @@ requires = [ | |
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "mypy" | ||
description = "Optional static typing for Python" | ||
authors = [{name = "Jukka Lehtosalo", email = "[email protected]"}] | ||
license = {text = "MIT"} | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
"Topic :: Software Development", | ||
"Typing :: Typed", | ||
] | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
# When changing this, also update build-system.requires and mypy-requirements.txt | ||
"typing_extensions>=4.6.0", | ||
"mypy_extensions>=1.0.0", | ||
"tomli>=1.1.0; python_version<'3.11'", | ||
] | ||
dynamic = ["version", "readme"] | ||
|
||
[project.optional-dependencies] | ||
dmypy = ["psutil>=4.0"] | ||
mypyc = ["setuptools>=50"] | ||
python2 = [] | ||
reports = ["lxml"] | ||
install-types = ["pip"] | ||
faster-cache = ["orjson"] | ||
|
||
[project.urls] | ||
Homepage = "https://www.mypy-lang.org/" | ||
Documentation = "https://mypy.readthedocs.io/en/stable/index.html" | ||
Repository = "https://github.com/python/mypy" | ||
Changelog = "https://github.com/python/mypy/blob/master/CHANGELOG.md" | ||
Issues = "https://github.com/python/mypy/issues" | ||
|
||
[project.scripts] | ||
mypy = "mypy.__main__:console_entry" | ||
stubgen = "mypy.stubgen:main" | ||
stubtest = "mypy.stubtest:main" | ||
dmypy = "mypy.dmypy.client:console_entry" | ||
mypyc = "mypyc.__main__:main" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["mypy*", "mypyc*", "*__mypyc*"] | ||
namespaces = false | ||
|
||
[tool.setuptools.package-data] | ||
mypy = [ | ||
"py.typed", | ||
"typeshed/**/*.py", | ||
"typeshed/**/*.pyi", | ||
"typeshed/stdlib/VERSIONS", | ||
"xml/*.xsd", | ||
"xml/*.xslt", | ||
"xml/*.css", | ||
] | ||
|
||
[tool.black] | ||
line-length = 99 | ||
target-version = ["py38", "py39", "py310", "py311", "py312"] | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,15 +18,14 @@ | |
# This requires setuptools when building; setuptools is not needed | ||
# when installing from a wheel file (though it is still needed for | ||
# alternative forms of installing, as suggested by README.md). | ||
from setuptools import Extension, find_packages, setup | ||
from setuptools import Extension, setup | ||
from setuptools.command.build_py import build_py | ||
|
||
from mypy.version import __version__ as version | ||
|
||
if TYPE_CHECKING: | ||
from typing_extensions import TypeGuard | ||
|
||
description = "Optional static typing for Python" | ||
long_description = """ | ||
Mypy -- Optional Static Typing for Python | ||
========================================= | ||
|
@@ -78,13 +77,6 @@ def run(self): | |
|
||
cmdclass = {"build_py": CustomPythonBuild} | ||
|
||
package_data = ["py.typed"] | ||
|
||
package_data += find_package_data(os.path.join("mypy", "typeshed"), ["*.py", "*.pyi"]) | ||
package_data += [os.path.join("mypy", "typeshed", "stdlib", "VERSIONS")] | ||
|
||
package_data += find_package_data(os.path.join("mypy", "xml"), ["*.xsd", "*.xslt", "*.css"]) | ||
|
||
USE_MYPYC = False | ||
# To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH | ||
if len(sys.argv) > 1 and "--use-mypyc" in sys.argv: | ||
|
@@ -179,67 +171,6 @@ def run(self): | |
ext_modules = [] | ||
|
||
|
||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
"Topic :: Software Development", | ||
"Typing :: Typed", | ||
] | ||
|
||
setup( | ||
name="mypy", | ||
version=version, | ||
description=description, | ||
long_description=long_description, | ||
author="Jukka Lehtosalo", | ||
author_email="[email protected]", | ||
url="https://www.mypy-lang.org/", | ||
license="MIT", | ||
py_modules=[], | ||
ext_modules=ext_modules, | ||
packages=find_packages(), | ||
package_data={"mypy": package_data}, | ||
entry_points={ | ||
"console_scripts": [ | ||
"mypy=mypy.__main__:console_entry", | ||
"stubgen=mypy.stubgen:main", | ||
"stubtest=mypy.stubtest:main", | ||
"dmypy=mypy.dmypy.client:console_entry", | ||
"mypyc=mypyc.__main__:main", | ||
] | ||
}, | ||
classifiers=classifiers, | ||
cmdclass=cmdclass, | ||
# When changing this, also update mypy-requirements.txt and pyproject.toml | ||
install_requires=[ | ||
"typing_extensions>=4.6.0", | ||
"mypy_extensions >= 1.0.0", | ||
"tomli>=1.1.0; python_version<'3.11'", | ||
], | ||
# Same here. | ||
extras_require={ | ||
"dmypy": "psutil >= 4.0", | ||
"mypyc": "setuptools >= 50", | ||
"python2": "", | ||
"reports": "lxml", | ||
"install-types": "pip", | ||
"faster-cache": "orjson", | ||
}, | ||
python_requires=">=3.8", | ||
include_package_data=True, | ||
project_urls={ | ||
"Documentation": "https://mypy.readthedocs.io/en/stable/index.html", | ||
"Repository": "https://github.com/python/mypy", | ||
"Changelog": "https://github.com/python/mypy/blob/master/CHANGELOG.md", | ||
"Issues": "https://github.com/python/mypy/issues", | ||
}, | ||
version=version, long_description=long_description, ext_modules=ext_modules, cmdclass=cmdclass | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true
is the default fortool.setuptools.include-package-data
(inpyproject.toml
) since setuptools>=61.0.0
. https://setuptools.pypa.io/en/latest/userguide/datafiles.html#include-package-data