I'm trying to use pyserial in a package that supports both Python 2.7 and 3.2.
Adding simply 'pyserial' to the "install_requires" list for the package works in 2.7, but in 3.2 I get:
Checking .pth file support in .
/home/peplin/dev/openxc-python/.tox/py32/bin/python -E -c pass
Searching for pyserial
Best match: pyserial 2.6
Running pyserial-2.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2_6sez/pyserial-2.6/egg-dist-tmp-n30bo8
warning: no files found matching 'examples/miniterm.py'
warning: no files found matching 'test/test_io_lib.py'
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
File "setup.py", line 41, in <module>
'openxc-control = openxc.tools.control:main',
File "/usr/lib/python3.2/distutils/core.py", line 148, in setup
File "/usr/lib/python3.2/distutils/dist.py", line 917, in run_commands
File "/usr/lib/python3.2/distutils/dist.py", line 936, in run_command
File "/home/peplin/dev/openxc-python/.tox/py32/lib/python3.2/site-packages/distribute-0.6.28-py3.2.egg/setuptools/command/test.py", line 127, in run
File "/home/peplin/dev/openxc-python/.tox/py32/lib/python3.2/site-packages/distribute-0.6.28-py3.2.egg/setuptools/dist.py", line 245, in fetch_build_eggs
File "/home/peplin/dev/openxc-python/.tox/py32/lib/python3.2/site-packages/distribute-0.6.28-py3.2.egg/pkg_resources.py", line 588, in resolve
Dynamically changing the dependency name to "pyserial-py3k" nets me this:
Downloading/unpacking pyserial-py3k (from openxc==0.9.0)
Could not find any downloads that satisfy the requirement pyserial-py3k (from openxc==0.9.0)
No distributions at all found for pyserial-py3k (from openxc==0.9.0)
Storing complete log in /tmp/pip-log.txt
but interestingly, after it fails once with just 'pyserial' as the dependency, the next time I try and run with 'pyserial-py3k', it works fine. The issue is that the name on PyPi is always 'pyserial', but the name of the package once it's built into an egg changes depending on the Python version. Is there a good way to handle this in my setup.py, or can the pyserial alternatively not mess with its name?