-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Pep561 tests for stub-only package with namespace packages (#11141)
This only adds tests that show the current behavior when we provide a stub-only package for a subpackage of a namespace package Proposals for behavior changes exist in python/typeshed#5800 Real world example is the `protobuf` package which installs to `google.protobuf` and the `types-protobuf` package which installs to `google-stubs/protobuf` (where `google` is a namespace package)
- Loading branch information
1 parent
df827c9
commit 066da4d
Showing
19 changed files
with
88 additions
and
17 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
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
6 changes: 3 additions & 3 deletions
6
test-data/packages/typedpkg_ns/setup.py → test-data/packages/typedpkg_ns_a/setup.py
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from setuptools import setup, find_packages | ||
from setuptools import setup | ||
|
||
setup( | ||
name='typedpkg_namespace.alpha', | ||
version='1.0.0', | ||
packages=find_packages(), | ||
namespace_packages=['typedpkg_ns'], | ||
zip_safe=False, | ||
package_data={'typedpkg_ns.ns': ['py.typed']} | ||
package_data={'typedpkg_ns.a': ['py.typed']}, | ||
packages=['typedpkg_ns.a'], | ||
) |
File renamed without changes.
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
This setup file installs packages to test mypy's PEP 561 implementation | ||
""" | ||
|
||
from distutils.core import setup | ||
|
||
setup( | ||
name='typedpkg_ns_b-stubs', | ||
author="The mypy team", | ||
version='0.1', | ||
namespace_packages=['typedpkg_ns-stubs'], | ||
package_data={'typedpkg_ns-stubs.b': ['__init__.pyi', 'bbb.pyi']}, | ||
packages=['typedpkg_ns-stubs.b'], | ||
) |
Empty file.
1 change: 1 addition & 0 deletions
1
test-data/packages/typedpkg_ns_b-stubs/typedpkg_ns-stubs/b/bbb.pyi
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 @@ | ||
def bf(a: bool) -> bool: ... |
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,10 @@ | ||
from setuptools import setup | ||
|
||
setup( | ||
name='typedpkg_namespace.beta', | ||
version='1.0.0', | ||
namespace_packages=['typedpkg_ns'], | ||
zip_safe=False, | ||
package_data={'typedpkg_ns.b': []}, | ||
packages=['typedpkg_ns.b'], | ||
) |
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,2 @@ | ||
# namespace pkg | ||
__import__("pkg_resources").declare_namespace(__name__) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def bf(a): | ||
return not a |
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