Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing mETL tries to install another xml2dict from pypi (not the right package) #12

Closed
e3krisztian opened this issue Sep 2, 2013 · 6 comments
Assignees
Labels

Comments

@e3krisztian
Copy link
Member

Installing current master with

~/projects/mETL$ pip install -e .

fails with this:

...
Downloading/unpacking xml2dict (from mETL==0.1.6.10dev)
  Downloading XML2Dict-0.2.1.tar.gz
  Storing download in cache at /home/kr/.pip/cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FX%2FXML2Dict%2FXML2Dict-0.2.1.tar.gz
  Running setup.py egg_info for package xml2dict
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/home/kr/.virtualenvs/metl/build/xml2dict/setup.py", line 14, in <module>
        long_description=open('README.md').read())
    IOError: [Errno 2] No such file or directory: 'README.md'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/home/kr/.virtualenvs/metl/build/xml2dict/setup.py", line 14, in <module>

    long_description=open('README.md').read())

IOError: [Errno 2] No such file or directory: 'README.md'

apparently it tries to install

https://pypi.python.org/pypi/XML2Dict/0.2.1
(https://github.com/mcspring/XML2Dict)

instead of

https://github.com/bfaludi/XML2Dict

Proposed solutions:

@ghost ghost assigned bfaludi Sep 2, 2013
@e3krisztian
Copy link
Member Author

It turns out, that setup.py already directly links to the proper place:

    dependency_links = [
        'https://github.com/ceumicrodata/tarr/archive/tarr-0.1.1.zip',
        'https://github.com/bfaludi/XML2Dict/archive/master.zip#egg=xml2dict-0.1'
    ],

after
pip install https://github.com/bfaludi/XML2Dict/archive/master.zip#egg=xml2dict-0.1
and
pinpointing xml2dict to version 0.1 in setup.py
xml2dict==0.1

Without pinpointing to the exact version, the install fails as previously.

pip install -e . works.
May it be that, the other version is newer (0.2.1)?

@bfaludi
Copy link
Collaborator

bfaludi commented Sep 2, 2013

No, the current xml2dict version is 0.1 what the mETL is using. I think the problem You have an another xml2dict package installed on your computer, because many package available with the same name.

@e3krisztian
Copy link
Member Author

I am using virtualenvs, so I am isolated from any unknown installed packages, so no, I do not have any other xml2dict installed.
It is pip that installs it based on setup.py and searching PyPI.

I was running pip 1.3.1 (2013-03-08) and 1.4.1 (2013-08-07) (with current setuptools 1.1), neither works.
It turned out, that pip does not do proper dependency resolution:

pypa/pip#1134
pypa/pip#988

https://devcenter.heroku.com/articles/python-pip

I have tried to create a requirements.txt file pinpointing the exact versions, but dependencies from setup.py still make pip pull in the wrong XML2Dict.

mkvirtualenv metl
pip install https://github.com/ceumicrodata/mETL/tarball/master

or better

mkvirtualenv metl
pip install mETL

should work without previously downloading/cloning anything and without polluting any user visible directory with python files - they are of help only for developers.

This issue also prevents mETL being released to PyPI (I do not know if there is such a plan, but it would make it more visible/used), as there is already a different (and probably broken) XML2Dict there.

Can XML2Dict be renamed (and possibly released to PyPI)?

@bfaludi
Copy link
Collaborator

bfaludi commented Sep 3, 2013

Yes, the package will be released to PyPI. I will found an another name for the package but I have not got any naming idea. Do you have any proposal?

@e3krisztian
Copy link
Member Author

I have glanced over it - it is pretty simple & nice package!

At first I though that XML2Dict is about the right name, it just need a differentiating word prefix, but not anymore: although it is a dict, that is created, but that dict is usually not a flat dict.

It somehow resembles JSON, except that the output is not a string, so XML2JSON is also discarded.

XML2Native is about the most correct variant in the above family.


What about naming it xmlsquash?
Its a pretty unique name!
https://www.google.com/search?q=xmlsquash


There is one thing that I spotted as potential problem: attributes are treated as sub-elements (probably intentionally), but what would be the result of parsing

<item x="3">
  <x>4</x>
</item>

?

@bfaludi
Copy link
Collaborator

bfaludi commented Sep 7, 2013

I renamed it, the xmlsquash is quite good idea, thank you. :)
You have right, this case was wrong. I fixed it. Current result of parsing for your example:

{u'x': {u'text': u'4'}, u'x:attr': u'3'}

@bfaludi bfaludi closed this as completed Sep 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants