-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add py.typed file to package for PEP-561 compliance
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
- Loading branch information
Showing
7 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from .distro import ( | ||
NORMALIZED_DISTRO_ID, | ||
NORMALIZED_LSB_ID, | ||
NORMALIZED_OS_ID, | ||
LinuxDistribution, | ||
__version__, | ||
build_number, | ||
codename, | ||
distro_release_attr, | ||
distro_release_info, | ||
id, | ||
info, | ||
like, | ||
linux_distribution, | ||
lsb_release_attr, | ||
lsb_release_info, | ||
major_version, | ||
minor_version, | ||
name, | ||
os_release_attr, | ||
os_release_info, | ||
uname_attr, | ||
uname_info, | ||
version, | ||
version_parts, | ||
) | ||
|
||
__all__ = [ | ||
"NORMALIZED_DISTRO_ID", | ||
"NORMALIZED_LSB_ID", | ||
"NORMALIZED_OS_ID", | ||
"LinuxDistribution", | ||
"build_number", | ||
"codename", | ||
"distro_release_attr", | ||
"distro_release_info", | ||
"id", | ||
"info", | ||
"like", | ||
"linux_distribution", | ||
"lsb_release_attr", | ||
"lsb_release_info", | ||
"major_version", | ||
"minor_version", | ||
"name", | ||
"os_release_attr", | ||
"os_release_info", | ||
"uname_attr", | ||
"uname_info", | ||
"version", | ||
"version_parts", | ||
] | ||
|
||
__version__ = __version__ |
This file contains 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .distro import main | ||
|
||
if __name__ == "__main__": | ||
main() |
File renamed without changes.
Empty file.
This file contains 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