Add py.typed file to package for PEP-561 compliance#315
Merged
sethmlarson merged 1 commit intopython-distro:masterfrom Feb 6, 2022
jdufresne:py-typed
Merged
Add py.typed file to package for PEP-561 compliance#315sethmlarson merged 1 commit intopython-distro:masterfrom jdufresne:py-typed
sethmlarson merged 1 commit intopython-distro:masterfrom
jdufresne:py-typed
Conversation
Member
Author
|
This is another go at #299 but this time |
jdufresne
commented
Oct 16, 2021
Collaborator
|
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
previously approved these changes
Dec 20, 2021
Contributor
sethmlarson
left a comment
There was a problem hiding this comment.
Looks good, one small comment:
Contributor
|
@jdufresne This PR appears nearly complete, just pinging you in case you still intend to land it. |
Contributor
|
@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
Member
Author
|
@sethmlarson No problem. Rebased. |
sethmlarson
approved these changes
Feb 6, 2022
Contributor
sethmlarson
left a comment
There was a problem hiding this comment.
LGTM, thanks @jdufresne!
bmwiedemann
pushed a commit
to bmwiedemann/openSUSE
that referenced
this pull request
Feb 17, 2022
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
This was referenced Feb 23, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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