aclark4life / vanity

Get package download statistics from PyPI
GNU General Public License v2.0
66 stars 14 forks source link

Python 2.6 and 3.2 broken #27

Closed hugovk closed 7 years ago

hugovk commented 8 years ago

PR https://github.com/aclark4life/vanity/pull/23 broke Vanity for Python 2.6 and 3.2.

Python 2.6:

Traceback (most recent call last):
 File "vanity.py", line 24, in <module>
    from collections import deque, OrderedDict
ImportError: cannot import name OrderedDict

Python 3.2:

Traceback (most recent call last):
  File "vanity.py", line 38, in <module>
    import requests
  File "/home/travis/virtualenv/python3.2.6/lib/python3.2/site-packages/requests-2.11.0-py3.2.egg/requests/__init__.py", line 64, in <module>
    from .models import Request, Response, PreparedRequest
  File "/home/travis/virtualenv/python3.2.6/lib/python3.2/site-packages/requests-2.11.0-py3.2.egg/requests/models.py", line 856
    http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
                                                      ^
SyntaxError: invalid syntax

See https://travis-ci.org/hugovk/vanity/builds/154439793

These are on the PR https://github.com/aclark4life/vanity/pull/26 branch.

cc @mattjegan

mattjegan commented 8 years ago

Cheers for picking up on this, I'll take a look.

aclark4life commented 8 years ago

Thanks @hugovk @mattjegan

mattjegan commented 8 years ago

I've managed to remove the dependency on requests in favour of urllib2/urllib which fixes the issue for Python 3.2. Which I will push up into my fork soon. In regards to the assumption that collections.OrderedDict is in the stdlib, I think the project should be failing prior to that change as well since argparse wasn't added to the standard library until python 2.7 at which point OrderedDict was also added.

So we the current implementation after the requests fix should work with 2.7+. Is this an issue @aclark4life ? I don't believe vanity supported 2.6 before this change regardless.

aclark4life commented 8 years ago

@mattjegan I think it would be nice if we supported 2.6, but I'm fine with requiring 2.7+ if that's easier.

mattjegan commented 8 years ago

@aclark4life Ok, can you confirm that it did work on 2.6 without installing dependancies? If not, we could require argparse and ordereddict which I believe would allow for 2.6 support.

aclark4life commented 8 years ago

@mattjegan I think you are right, it possibly never worked on 2.6.

mattjegan commented 8 years ago

@aclark4life Apologies if I missed something, I will open a PR for the py3 fix soon.

hugovk commented 8 years ago

Vanity used to work on Python 2.6: https://travis-ci.org/hugovk/vanity/jobs/122980037#L243

aclark4life commented 8 years ago

@hugovk Ah, good catch

hugovk commented 7 years ago

One option of course is to drop support for Python 2.6 and 3.2

Python 2.6 was only supported until October 2013, and 3.2 until February 2016: https://en.wikipedia.org/wiki/CPython#Version_history

aclark4life commented 7 years ago

I'm probably fine with removing support for 2.6 and 3.2, particularly if they are hard to support now.