Conditional requirements are broken with wheel #227

Closed
Jayin opened this Issue Jun 18, 2014 · 4 comments

Comments

Projects
None yet
4 participants

Jayin commented Jun 18, 2014

in win7

C:\Users\Lenovo>pip install --upgrade httpie
Requirement already up-to-date: httpie in c:\python27\lib\site-packages
Cleaning up...

C:\Users\Lenovo>http httpie.org
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "c:\Python27\Scripts\http.exe\__main__.py", line 5, in <module>
  File "C:\Python27\lib\site-packages\httpie\__main__.py", line 6, in <module>
    from .core import main
  File "C:\Python27\lib\site-packages\httpie\core.py", line 23, in <module>
    from .downloads import Download
  File "C:\Python27\lib\site-packages\httpie\downloads.py", line 15, in <module>

    from .output import RawStream
  File "C:\Python27\lib\site-packages\httpie\output.py", line 19, in <module>
    from .models import HTTPRequest, HTTPResponse, Environment
  File "C:\Python27\lib\site-packages\httpie\models.py", line 8, in <module>
    class Environment(object):
  File "C:\Python27\lib\site-packages\httpie\models.py", line 34, in Environment

    from colorama.initialise import wrap_stream
ImportError: No module named colorama.initialise

kjerk commented Jun 18, 2014

Same problem here.
pip install colorama fixed the problem, so probably just needs the dependency added to the install script.

Same here. It's weird that their test doesn't cover this scenario.

Owner

jakubroztocil commented Jun 19, 2014

It's a bug, sorry about that. Will be fixed hopefully soon. The same problem will occur with argparse on Python versions that don't included it (2.6, 3.0, 3.1).

It's because the conditional dependencies in setup.py don't work with the new wheel format. It looks like with wheel==0.24.0, once released, it will be possible to define environment-specific dependencies again:

http://wheel.readthedocs.org/en/latest/#defining-conditional-dependencies

extras_require={
    ':python_version == "2.6" or python_version == "3.0" or python_version == "3.1"': [
        'argparse>=1.2.1'
    ],
    ':sys_platform == "win32"': [
        'colorama>=0.2.4'
    ],
}

But maybe we could drop support for wheel until things improve. The primary reason why It was introduced was to fix #148.

jakubroztocil removed the windows label Jul 29, 2014

jakubroztocil changed the title from ImportError: No module named colorama.initialise to Conditional requirements are broken with wheel Jul 29, 2014

Owner

jakubroztocil commented Jan 31, 2015

This should be fixed in HTTPie v0.9.0. See:

#255 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment