UPDATE: When installing both packages using setup.py alone they install just fine. When extracting the tarballs generated by sdist and installing them the same error occurs. This means that the problem is somewhere inside setuptools I guess.
I developed two projects that have two namespace packages: testsuite and testsuite.prettyprint.
Both of these namespace packages' __init__.py
contain:
__import__('pkg_resources').declare_namespace(__name__)
Here's the setup.py for testsuite.prettyprint.outcomes:
import pkgutil
from setuptools import setup
def get_packages():
return [name for _, name, is_package in pkgutil.walk_packages('.') if name.startswith('testsuite') and is_package]
dependencies = ['nose2>=0.4.6', 'colorama>=0.2.5']
setup(
name='testsuite-prettyprint-outcomes',
version='0.1.0-alpha.1',
packages=get_packages(),
url='',
license='BSD3',
author='Omer Katz',
author_email='[email protected]',
description='testsuite-prettyprint-outcomes is a nose2 plugin that prettyprints test outcomes.',
namespace_packages=['testsuite', 'testsuite.prettyprint'],
install_requires=dependencies
)
and here is the setup.py for testsuite.prettyprint.traceback:
import pkgutil
import sys
from setuptools import setup
def get_packages():
return [name for _, name, is_package in pkgutil.walk_packages('.') if name.startswith('testsuite') and is_package]
dependencies = ['nose2>=0.4.6', 'pygments>=1.6']
if sys.platform == 'win32':
dependencies.append('colorama>=0.2.5')
setup(
name='testsuite-prettyprint-traceback',
version='0.1.0-alpha.2',
packages=get_packages(),
url='',
license='BSD3',
author='Omer Katz',
author_email='[email protected]',
description='testsuite-prettyprint-traceback is a nose2 plugin that prettyprints traceback on failures and errors.',
namespace_packages=['testsuite', 'testsuite.prettyprint'],
install_requires=dependencies
)
When installing them both it refuses to install one:
pip install testsuite-prettyprint-outcomes testsuite-prettyprint-traceback --use-mirrors
Downloading/unpacking testsuite-prettyprint-outcomes
Downloading testsuite-prettyprint-outcomes-0.1.0-alpha.1.tar.gz
Running setup.py egg_info for package testsuite-prettyprint-outcomes
Downloading/unpacking testsuite-prettyprint-traceback
Downloading testsuite-prettyprint-traceback-0.1.0-alpha.2.tar.gz
Running setup.py egg_info for package testsuite-prettyprint-traceback
Downloading/unpacking nose2>=0.4.6 (from testsuite-prettyprint-outcomes)
Running setup.py egg_info for package nose2
warning: no previously-included files matching '__pycache__' found anywhere in distribution
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Downloading/unpacking colorama>=0.2.5 (from testsuite-prettyprint-outcomes)
Downloading colorama-0.2.5.zip
Running setup.py egg_info for package colorama
Downloading/unpacking pygments>=1.6 (from testsuite-prettyprint-traceback)
Downloading Pygments-1.6.tar.gz (1.4MB): 1.4MB downloaded
Running setup.py egg_info for package pygments
Downloading/unpacking six>=1.1,<1.2 (from nose2>=0.4.6->testsuite-prettyprint-outcomes)
Running setup.py egg_info for package six
Installing collected packages: testsuite-prettyprint-outcomes, testsuite-prettyprint-traceback, nose2, colorama, pygments, six
Running setup.py install for testsuite-prettyprint-outcomes
Skipping installation of /home/omer/.virtualenvs/test/lib/python3.2/site-packages/testsuite/__init__.py (namespace package)
Skipping installation of /home/omer/.virtualenvs/test/lib/python3.2/site-packages/testsuite/prettyprint/__init__.py (namespace package)
Installing /home/omer/.virtualenvs/test/lib/python3.2/site-packages/testsuite_prettyprint_outcomes-0.1.0_alpha.1-py3.2-nspkg.pth
Running setup.py install for testsuite-prettyprint-traceback
error: package directory 'testsuite/prettyprint/outcomes' does not exist
Complete output from command /home/omer/.virtualenvs/test/bin/python3.2 -c "import setuptools;__file__='/home/omer/.virtualenvs/test/build/testsuite-prettyprint-traceback/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-12l9lq-record/install-record.txt --single-version-externally-managed --install-headers /home/omer/.virtualenvs/test/include/site/python3.2:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/testsuite
copying testsuite/__init__.py -> build/lib/testsuite
creating build/lib/testsuite/prettyprint
copying testsuite/prettyprint/__init__.py -> build/lib/testsuite/prettyprint
error: package directory 'testsuite/prettyprint/outcomes' does not exist
----------------------------------------
Command /home/omer/.virtualenvs/test/bin/python3.2 -c "import setuptools;__file__='/home/omer/.virtualenvs/test/build/testsuite-prettyprint-traceback/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-12l9lq-record/install-record.txt --single-version-externally-managed --install-headers /home/omer/.virtualenvs/test/include/site/python3.2 failed with error code 1 in /home/omer/.virtualenvs/test/build/testsuite-prettyprint-traceback
Storing complete log in /home/omer/.pip/pip.log
I can't figure out what is wrong. Even if you change the order of installation it says it can't find the other.
namespace_packages
entry for thesetup.py
files? – Martijn Pieters__init__.py
files and thenamespace_packages
insetup.py
and so on, it worked with 3.3. (But of course with 3.2, it installed and then couldn't be used, which is not exactly friendly…) – abarnert