Skip to content

Commit

Permalink
Correct implementation of pkgutil style namespace (Fixes #144) (#145)
Browse files Browse the repository at this point in the history
* Fix for #144

Change to correct use of pkgutil style namespace packages as documented https://packaging.python.org/guides/packaging-namespace-packages/#pkgutil-style-namespace-packages and illustrated in https://github.com/pypa/sample-namespace-packages/tree/master/pkgutil

Note: at the moment the `namespace_packages` directive is completely ignored, if you add the "luma" package to `packages` (in addition to `namespace_packages`) then `setup.py build` returns an error because it is expecting a pkg_resources style namespace package:

```
running build
running build_py
error: Namespace package problem: luma is a namespace package, but its
__init__.py does not call declare_namespace()! Please fix it.
(See the setuptools manual under "Namespace Packages" for details.)
```

Note: in the linked example the `find_packages()` method returns the "namespace" package as if it were an ordinary package.

* Update CONTRIBUTING.rst
  • Loading branch information
Gadgetoid authored and rm-hull committed Jul 25, 2018
1 parent d378fa1 commit 120df29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ Contributors
* Jonathan Pereira (@jonathanrjpereira)
* Daniel Smullen (@drspangle)
* Hans Liss (@hansliss)
* Phil Howard (@gadgetoid)
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def find_version(*file_paths):
keywords="raspberry orange banana pi rpi opi sbc oled lcd led display screen spi i2c",
url="https://github.com/rm-hull/luma.core",
download_url="https://github.com/rm-hull/luma.core/tarball/" + version,
namespace_packages=["luma"],
packages=["luma.core", "luma.core.legacy", "luma.core.interface"],
packages=["luma", "luma.core", "luma.core.legacy", "luma.core.interface"],
install_requires=install_deps,
setup_requires=pytest_runner,
tests_require=test_deps,
Expand Down

0 comments on commit 120df29

Please sign in to comment.