youknowone / itunes-iap

Apple iTunes In-app purchase verification tool
http://itunes-iap.readthedocs.io
Other
136 stars 50 forks source link

Installation of 2.5.0 fails on python2 #44

Closed prettyv closed 6 years ago

prettyv commented 7 years ago

After the update to 2.5.0 itunes-iap cannot be upgraded anymore on python versions <3.4.2. pip2 install --upgrade itunes-iap tries to install aiohttp, which fails:

[...]
Collecting aiohttp (from itunes-iap)
  1 location(s) to search for versions of aiohttp:
  * https://pypi.python.org/simple/aiohttp/
  Getting page https://pypi.python.org/simple/aiohttp/
  Looking up "https://pypi.python.org/simple/aiohttp/" in the cache
  Current age based on date: 311
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  The response is "fresh", returning cached response
  600 > 311
  Analyzing links from page https://pypi.python.org/simple/aiohttp/
  [...]
  Using version 2.2.3 (newest of versions: 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5,$
  Looking up "https://pypi.python.org/packages/9b/3a/b560a411b97203fb20b5eee084c1e292862b3092029d9d9faaa8714797fa/aiohttp-2.2.3.tar.gz" in $
  Current age based on date: 108202
  Freshness lifetime from max-age: 31557600
  The response is "fresh", returning cached response
  31557600 > 108202
  Using cached aiohttp-2.2.3.tar.gz
  Downloading from URL https://pypi.python.org/packages/9b/3a/b560a411b97203fb20b5eee084c1e292862b3092029d9d9faaa8714797fa/aiohttp-2.2.3.ta$
  Running setup.py (path:/tmp/pip-build-DwBsrd/aiohttp/setup.py) egg_info for package aiohttp
    Running command python setup.py egg_info
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-DwBsrd/aiohttp/setup.py", line 66, in <module>
        raise RuntimeError("aiohttp requires Python 3.4.2+")
    RuntimeError: aiohttp requires Python 3.4.2+
Cleaning up...
Exception information:
Traceback (most recent call last):
  File "/home/prettyvanilla/.local/share/virtualenvs/bikemap/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/prettyvanilla/.local/share/virtualenvs/bikemap/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
    wb.build(autobuilding=True)
  File "/home/prettyvanilla/.local/share/virtualenvs/bikemap/lib/python2.7/site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/home/prettyvanilla/.local/share/virtualenvs/bikemap/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/home/prettyvanilla/.local/share/virtualenvs/bikemap/lib/python2.7/site-packages/pip/req/req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/home/prettyvanilla/.local/share/virtualenvs/bikemap/lib/python2.7/site-packages/pip/req/req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/home/prettyvanilla/.local/share/virtualenvs/bikemap/lib/python2.7/site-packages/pip/req/req_install.py", line 439, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/home/prettyvanilla/.local/share/virtualenvs/bikemap/lib/python2.7/site-packages/pip/utils/__init__.py", line 707, in call_subproce$
    % (command_desc, proc.returncode, cwd))
InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-DwBsrd/aiohttp/

Most likely the conditional in setup.py isn't working the way you'd expect when using wheels, instead environment markers seem to be the recommended way now: https://wheel.readthedocs.io/en/latest/#defining-conditional-dependencies

youknowone commented 7 years ago

I am sorry for the inconvenience and thanks for the wheel document. I will learn more about the wheel.

For now, I temporarily removed the universal wheel to fix the problem. If you still experience problem, --no-cache-dir will work. pip install itunes-iap -U --no-cache-dir

prettyv commented 7 years ago

Thanks, that fixes manual installation for now. pip-tools still thinks aiohttp is a dependency though (itunes-iap==2.5.0 requires aiodns, aiohttp, prettyexc>=0.6.0, python-dateutil, pytz, requests[security], six) and thus fails to compile an upgraded requirements.txt. Not quite sure whether that's an issue in pip-tools itself or related to the same problem.

youknowone commented 7 years ago

It seems it is related to your local cache of universal wheel. When I try to pip-compile itunes-iap, it shows:

asn1crypto==0.22.0        # via cryptography
certifi==2017.7.27.1      # via requests
cffi==1.10.0              # via cryptography
chardet==3.0.4            # via requests
cryptography==2.0.2       # via pyopenssl, requests
enum34==1.1.6             # via cryptography
idna==2.5                 # via cryptography, requests
ipaddress==1.0.18         # via cryptography
itunes-iap==2.5.0
prettyexc==0.6.0          # via itunes-iap
pycparser==2.18           # via cffi
pyopenssl==17.2.0         # via requests
python-dateutil==2.6.1    # via itunes-iap
pytz==2017.2              # via itunes-iap
requests[security]==2.18.3  # via itunes-iap
six==1.10.0               # via cryptography, itunes-iap, prettyexc, pyopenssl, python-dateutil
urllib3==1.22             # via requests
prettyv commented 7 years ago

You are right, I tried it on a different machine and it compiles as expected there now, so I must have overlooked something when (manually) cleaning the cache on my main dev machine.

Should we keep this issue open until you looked into using the modern way to specify conditional requirements for universal wheels?

youknowone commented 6 years ago

I think this package is very small so not that bad without universal wheel.