Uh oh!
There was an error while loading. Please reload this page.
Add py.typed file to package for PEP-561 compliance - #315
Conversation
jdufresne
commented
Oct 16, 2021
This is another go at #299 but this time |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Please resolve conflicts. I'm also wondering if there are cases in which people already download directly, which will now break. Maybe there's a way to redirect? I'm not familiar with one, and believe it will result in a 301. |
sethmlarson
left a comment
There was a problem hiding this comment.
Looks good, one small comment:
Uh oh!
There was an error while loading. Please reload this page.
sethmlarson
commented
Feb 2, 2022
@jdufresne This PR appears nearly complete, just pinging you in case you still intend to land it. |
sethmlarson
commented
Feb 6, 2022
@jdufresne Looks like a recent merge introduced a rebase issue, could you handle that @jdufresne? |
Per PEP-561, packages that include type information that can be consumed by other libraries should distribute a py.typed file. This tells mypy and other tools to use type information shipped with the library. This requires moving distro from a single module file to a package so that it can ship data files. The original distro.py was not altered. Only the __init__.py and __main__.py were added to facilitate being used as a packages. By keeping distro.py unaltered, this allows projects to continue to vendor the file into their project without as before without any modifications. For details on PEP-561, see: https://www.python.org/dev/peps/pep-0561/ For details on mypy using py.typed, see: https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages
jdufresne
commented
Feb 6, 2022
@sethmlarson No problem. Rebased. |
sethmlarson
left a comment
There was a problem hiding this comment.
LGTM, thanks @jdufresne!
https://build.opensuse.org/request/show/955104 by user sebix + dimstar_suse - remove shebang from distro.py - update to version 1.7.0: - BACKWARD COMPATIBILITY: - Dropped support for EOL Pythons 2.7, 3.4 and 3.5 [[#281](python-distro/distro#281)] - Dropped support for LSB and `uname` back-ends when `--root-dir` is specified [[#311](python-distro/distro#311)] - Moved `distro.py` to `src/distro/distro.py` [[#315](python-distro/distro#315)] - ENHANCEMENTS: - Documented that `distro.version()` can return an empty string on rolling releases [[#312](python-distro/distro#312)] - Documented support for Python 3.10 [[#316](python-distro/distro#316)] - Added official support for Rocky Linux distribution [[#318](https://github.com/python-distro/distr
Per PEP-561, packages that include type information that can be consumed
by other libraries should distribute a py.typed file. This tells mypy
and other tools to use type information shipped with the library.
This requires moving distro from a single module file to a package so
that it can ship data files. The original distro.py was not altered.
Only the
__init__.pyand__main__.pywere added to facilitate being usedas a package. By keeping distro.py unaltered, this allows projects to
continue to vendor the file into their project without as before without
any modifications.
For details on PEP-561, see:
https://www.python.org/dev/peps/pep-0561/
For details on mypy using py.typed, see:
https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages