mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-10 16:22:29 +03:00
get travis running
This commit is contained in:
parent
b40a984d78
commit
5015356cd0
|
@ -12,8 +12,6 @@ os:
|
||||||
- linux
|
- linux
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- PIP_DATE=2014-07-01
|
|
||||||
- PIP_DATE=2014-10-01
|
|
||||||
- PIP_DATE=2015-01-01
|
- PIP_DATE=2015-01-01
|
||||||
- PIP_DATE=2015-04-01
|
- PIP_DATE=2015-04-01
|
||||||
- PIP_DATE=2015-07-01
|
- PIP_DATE=2015-07-01
|
||||||
|
@ -23,6 +21,8 @@ install:
|
||||||
- pip install -U pip
|
- pip install -U pip
|
||||||
- python pip-date.py $PIP_DATE pip setuptools wheel six
|
- python pip-date.py $PIP_DATE pip setuptools wheel six
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
|
- pip install pytest
|
||||||
|
- pip list
|
||||||
- python setup.py sdist
|
- python setup.py sdist
|
||||||
- pip install dist/*
|
- pip install dist/*
|
||||||
|
|
||||||
|
|
38
pip-date.py
38
pip-date.py
|
@ -12,7 +12,9 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from urllib import urlopen
|
from urllib import urlopen
|
||||||
|
|
||||||
|
from pip.commands.uninstall import UninstallCommand
|
||||||
from pip.commands.install import InstallCommand
|
from pip.commands.install import InstallCommand
|
||||||
|
from pip import get_installed_distributions
|
||||||
|
|
||||||
|
|
||||||
def get_releases(package_name):
|
def get_releases(package_name):
|
||||||
|
@ -40,16 +42,38 @@ def select_version(select_date, package_name):
|
||||||
return versions[bisect([x[0] for x in versions], select_date) - 1][1]
|
return versions[bisect([x[0] for x in versions], select_date) - 1][1]
|
||||||
|
|
||||||
|
|
||||||
date = parse_iso8601(sys.argv[1])
|
installed_packages = [
|
||||||
args = ['%s==%s' % (p, select_version(date, p)) for p in sys.argv[2:]]
|
package.project_name
|
||||||
|
for package in
|
||||||
|
get_installed_distributions()
|
||||||
|
if (not package.location.endswith('dist-packages') and
|
||||||
|
package.project_name not in ('pip', 'setuptools'))
|
||||||
|
]
|
||||||
|
|
||||||
pip = InstallCommand()
|
pip = UninstallCommand()
|
||||||
options, args = pip.parse_args(args)
|
options, args = pip.parse_args(installed_packages)
|
||||||
options.force_reinstall = True
|
options.yes = True
|
||||||
options.ignore_installed = True
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print(pip.run(options, args))
|
pip.run(options, args)
|
||||||
|
except OSError as e:
|
||||||
|
if e.errno != 13:
|
||||||
|
raise e
|
||||||
|
print("You lack permissions to uninstall this package. Perhaps run with sudo? Exiting.")
|
||||||
|
exit(13)
|
||||||
|
|
||||||
|
|
||||||
|
date = parse_iso8601(sys.argv[1])
|
||||||
|
packages = {p: select_version(date, p) for p in sys.argv[2:]}
|
||||||
|
args = ['=='.join(a) for a in packages.items()]
|
||||||
|
|
||||||
|
cmd = InstallCommand()
|
||||||
|
options, args = cmd.parse_args(args)
|
||||||
|
options.ignore_installed = True
|
||||||
|
options.force_reinstall = True
|
||||||
|
|
||||||
|
try:
|
||||||
|
print(cmd.run(options, args))
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno != 13:
|
if e.errno != 13:
|
||||||
raise e
|
raise e
|
||||||
|
|
Loading…
Reference in New Issue
Block a user