kura / yarg

A semi hard Cornish cheese, also queries PyPI
https://yarg.readthedocs.org
MIT License
20 stars 6 forks source link

`pip install yarg` fails #2

Closed schettino72 closed 10 years ago

schettino72 commented 10 years ago

On setup.py it imports itself but requests is not installed on my system (yet) so I get an import error. Actually I surprised it didnt fails before that! How can it import itself before being installed?

full output:

(py34)~/work/third_party$ pip install yarg
Downloading/unpacking yarg
  Downloading yarg-0.1.5.tar.gz
  Running setup.py egg_info for package yarg
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/home/eduardo/.virtualenvs/py34/build/yarg/setup.py", line 7, in <module>
        version = __import__('yarg').__version__
      File "/home/eduardo/.virtualenvs/py34/build/yarg/yarg/__init__.py", line 49, in <module>
        from .client import get
      File "/home/eduardo/.virtualenvs/py34/build/yarg/yarg/client.py", line 26, in <module>
        import requests
    ImportError: No module named 'requests'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

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

  File "/home/eduardo/.virtualenvs/py34/build/yarg/setup.py", line 7, in <module>

    version = __import__('yarg').__version__

  File "/home/eduardo/.virtualenvs/py34/build/yarg/yarg/__init__.py", line 49, in <module>

    from .client import get

  File "/home/eduardo/.virtualenvs/py34/build/yarg/yarg/client.py", line 26, in <module>

    import requests

ImportError: No module named 'requests'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/eduardo/.virtualenvs/py34/build/yarg
Storing complete log in /home/eduardo/.pip/pip.log
kura commented 10 years ago

Hmmm, interesting. This should be fixed now, try using 0.1.6.

schettino72 commented 10 years ago

Nope. It is not fixed.

__init__.py will be loaded if you try to import anything in the package. So it still fails. I guess you need to give up the hack :)

kura commented 10 years ago

It's not a hack, that is the correct way of providing methods are the base level of the module. It's also only an issue with source dists, wheels work fine.

I'll see what's wrong with it, it shouldn't even be touching init.py