Skip to content

Commit c1611f3

Browse files
committed
Declare namespace package with pkgutil module.
Use the builtin module instead of pkg_resources from setuptools. This is compatible with PEP 420 namespace packages in Python 3.
1 parent 82ade62 commit c1611f3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ def getversioncfg():
7373
setup_args = dict(
7474
name = "diffpy.srfit",
7575
version = versiondata.get('DEFAULT', 'version'),
76-
namespace_packages = ['diffpy'],
77-
packages = find_packages('src'),
76+
packages = find_packages(os.path.join(MYDIR, 'src')),
7877
package_dir = {'' : 'src'},
7978
test_suite = 'diffpy.srfit.tests',
8079
include_package_data = True,

src/diffpy/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616

1717
"""diffpy - tools for structure analysis by diffraction.
1818
19-
This is the namespace package shared by all DiffPy software.
19+
Blank namespace package.
2020
"""
2121

22-
__import__('pkg_resources').declare_namespace(__name__)
22+
23+
from pkgutil import extend_path
24+
__path__ = extend_path(__path__, __name__)
2325

2426

2527
# End of file

0 commit comments

Comments
 (0)