python / mypy

Optional static typing for Python
https://www.mypy-lang.org/
Other
18.09k stars 2.76k forks source link

Update PEP 561 examples with modern packaging #13901

Open ofek opened 1 year ago

ofek commented 1 year ago

Documentation

https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages as noted in https://github.com/pypa/hatch/discussions/554 only mentions setup.py which is deprecated for simply defining metadata, see PEP 621

It would be nice to mention the Hatchling way as that is now the default in the official Python packaging tutorial.

ssbarnea commented 1 year ago

Anyone against me making a patch to migrate packaging to PEP-621 with setuptools-scm?

ofek commented 1 year ago

Here's an example that uses setuptools-scm and Mypyc https://github.com/psf/black/blob/main/pyproject.toml

hauntsaninja commented 1 year ago

Thanks, that'd be a welcome addition! However, I'd still like to keep the setup.py example in the docs (though it could also use some modernisation e.g. no distutils)