Skip to content

Commit a5e7ea5

Browse files
committed
And a test
1 parent 99957d7 commit a5e7ea5

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[project]
2+
name = 'typedpkg_namespace.nested'
3+
version = '0.1'
4+
description = 'Two namespace packages, one of them typed'
5+
6+
[tool.hatch.build]
7+
include = ["**/*.py", "**/*.pyi", "**/py.typed"]
8+
9+
[build-system]
10+
requires = ["hatchling==1.18"]
11+
build-backend = "hatchling.build"

test-data/packages/typedpkg_ns_nested/typedpkg_ns/a/__init__.py

Whitespace-only changes.

test-data/packages/typedpkg_ns_nested/typedpkg_ns/a/py.typed

Whitespace-only changes.

test-data/packages/typedpkg_ns_nested/typedpkg_ns/b/__init__.py

Whitespace-only changes.

test-data/unit/pep561.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,23 @@ from typedpkg_ns.a.bbb import bf
213213
[file dummy.py.2]
214214
[out]
215215
[out2]
216+
217+
[case testTypedNamespaceSubpackage]
218+
# pkgs: typedpkg_ns_nested
219+
import our
220+
[file our/__init__.py]
221+
import our.bar
222+
import our.foo
223+
[file our/bar.py]
224+
from typedpkg_ns.b import Something
225+
[file our/foo.py]
226+
import typedpkg_ns.a
227+
228+
[file dummy.py.2]
229+
230+
[out]
231+
our/bar.py:1: error: Skipping analyzing "typedpkg_ns.b": module is installed, but missing library stubs or py.typed marker
232+
our/bar.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
233+
[out2]
234+
our/bar.py:1: error: Skipping analyzing "typedpkg_ns.b": module is installed, but missing library stubs or py.typed marker
235+
our/bar.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

0 commit comments

Comments
 (0)