Kengo Seki created AVRO-2424:
--------------------------------
Summary: Make Py2 bindings work on setuptools' development mode
Key: AVRO-2424
URL: https://issues.apache.org/jira/browse/AVRO-2424
Project: Apache Avro
Issue Type: Improvement
Components: python
Reporter: Kengo Seki
Assignee: Kengo Seki
I tried to use the Python2 bindings in the [development
mode|https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode]
via `python setup.py develop` or `pip install -e .`, but got the following
error.
{code}
~/repo/avro/lang/py$ mkvirtualenv avro
(snip)
(avro) ~/repo/avro/lang/py$ python setup.py develop
/home/sekikn/.virtualenvs/avro/local/lib/python2.7/site-packages/setuptools/dist.py:481:
UserWarning: The version specified ('@AVRO_VERSION@') is an invalid version,
this may not work as expected with newer versions of setuptools, pip, and PyPI.
Please see PEP 440 for more details.
"details." % self.metadata.version
(snip)
Installed /home/sekikn/repo/avro/lang/py
Processing dependencies for avro===-AVRO-VERSION-
Finished processing dependencies for avro===-AVRO-VERSION-
(avro) sekikn@sekikn-ProLiant-ML110-G6:~/repo/avro/lang/py$ python -c "import
avro"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named avro
{code}
The following patch seems to fix this problem.
{code}
(avro) ~/repo/avro/lang/py$ git diff
diff --git a/lang/py/setup.py b/lang/py/setup.py
index 0d3c9b9e..9ebc3e05 100755
--- a/lang/py/setup.py
+++ b/lang/py/setup.py
@@ -29,7 +29,7 @@ setup(
name = 'avro',
version = '@AVRO_VERSION@',
packages = ['avro',],
- package_dir = {'avro': 'src/avro'},
+ package_dir = {'': 'src'},
scripts = ["./scripts/avro"],
#include_package_data=True,
{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)