Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
ed25f12b
Commit
ed25f12b
authored
Nov 14, 2020
by
Fedor Alekseev
Committed by
GitHub
Nov 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support namespace packages inside regular packages (GH-3905)
parent
c3121126
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
Cython/Utils.py
Cython/Utils.py
+1
-3
tests/build/cythonize_pep420_namespace.srctree
tests/build/cythonize_pep420_namespace.srctree
+16
-1
No files found.
Cython/Utils.py
View file @
ed25f12b
...
...
@@ -156,9 +156,7 @@ def check_package_dir(dir_path, package_names):
for
dirname
in
package_names
:
dir_path
=
os
.
path
.
join
(
dir_path
,
dirname
)
has_init
=
contains_init
(
dir_path
)
if
not
namespace
and
not
has_init
:
return
None
,
False
elif
has_init
:
if
has_init
:
namespace
=
False
return
dir_path
,
namespace
...
...
tests/build/cythonize_pep420_namespace.srctree
View file @
ed25f12b
...
...
@@ -10,7 +10,8 @@ from distutils.core import setup, Extension
setup(
ext_modules=cythonize([
Extension("nsp.m1.a", ["nsp/m1/a.pyx"]),
Extension("nsp.m2.b", ["nsp/m2/b.pyx"])
Extension("nsp.m2.b", ["nsp/m2/b.pyx"]),
Extension("nsp.m3.c.d", ["nsp/m3/c/d.pyx"]),
]),
)
...
...
@@ -31,14 +32,28 @@ cdef class A:
######## nsp/m2/b.pyx ########
from nsp.m1.a cimport A
from nsp.m3.c.d cimport D
cdef class B(A):
pass
######## nsp/m3/__init__.py ########
######## nsp/m3/c/d.pyx ########
cdef class D:
pass
######## nsp/m3/c/d.pxd ########
cdef class D:
pass
######## runner.py ########
from nsp.m1.a import A
from nsp.m2.b import B
from nsp.m3.c.d import D
a = A()
b = B()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment