From 8bc9e3a3e040fccf29bfeafdf64212aa9fb73db3 Mon Sep 17 00:00:00 2001 From: Henning Peters Date: Mon, 14 Dec 2015 22:23:08 +0100 Subject: [PATCH] get travis running --- .travis.yml | 5 +++++ pip-date.py | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d620e3c41..0a8f27b1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,12 @@ os: - linux env: + - PIP_DATE=2014-07-01 + - PIP_DATE=2014-10-01 - PIP_DATE=2015-01-01 + - PIP_DATE=2015-04-01 + - PIP_DATE=2015-07-01 + - PIP_DATE=2015-10-01 install: - python pip-date.py $PIP_DATE pip setuptools wheel six diff --git a/pip-date.py b/pip-date.py index adfe6b252..62e34cb70 100644 --- a/pip-date.py +++ b/pip-date.py @@ -1,6 +1,5 @@ #!/usr/bin/env python from __future__ import print_function -import urllib import json import re import sys @@ -8,12 +7,17 @@ from bisect import bisect from datetime import datetime from datetime import timedelta +try: + from urllib.request import urlopen +except ImportError: + from urllib import urlopen + from pip.commands.install import InstallCommand def get_releases(package_name): url = 'https://pypi.python.org/pypi/%s/json' % package_name - return json.load(urllib.urlopen(url))['releases'] + return json.loads(urlopen(url).read().decode('utf8'))['releases'] def parse_iso8601(s):