Skip to content

Commit

Permalink
Merge branch 'pip-tools-integration'
Browse files Browse the repository at this point in the history
* pip-tools-integration:
  Support of pip 19.0
  Update all pypi.python.org URLs to pypi.org
  • Loading branch information
suutari committed Jan 27, 2019
2 parents 357ec0a + 7bda19d commit 307b2e6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ branches: {only: [master, test]}
environment:
matrix:
- TOXENV: py37-pipmaster
- TOXENV: py37-pip190
- TOXENV: py37-pip181
- TOXENV: py37-pip10
- TOXENV: py36-pipmaster
- TOXENV: py36-pip190
- TOXENV: py36-pip180
- TOXENV: py36-pip10
- TOXENV: py36-pip9
- TOXENV: py35-pip9
- TOXENV: py34-pip9
- TOXENV: py34-pip8
- TOXENV: py27-pip190
- TOXENV: py27-pip181
- TOXENV: py27-pip10
- TOXENV: py27-pip9
Expand Down
24 changes: 16 additions & 8 deletions prequ/repositories/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from contextlib import contextmanager
from shutil import rmtree

import pip
import pkg_resources

from .._compat import TemporaryDirectory
from .._log_utils import collect_logs
from .._pip_compat import (
Expand Down Expand Up @@ -49,14 +52,19 @@ def __init__(self, pip_options, session):
if pip_options.no_index:
index_urls = []

self.finder = PackageFinder(
find_links=pip_options.find_links,
index_urls=index_urls,
trusted_hosts=pip_options.trusted_hosts,
allow_all_prereleases=pip_options.pre,
process_dependency_links=pip_options.process_dependency_links,
session=self.session,
)
finder_kwargs = {
"find_links": pip_options.find_links,
"index_urls": index_urls,
"trusted_hosts": pip_options.trusted_hosts,
"allow_all_prereleases": pip_options.pre,
"session": self.session,
}

# pip 19.0 has removed process_dependency_links from the PackageFinder constructor
if pkg_resources.parse_version(pip.__version__) < pkg_resources.parse_version('19.0'):
finder_kwargs["process_dependency_links"] = pip_options.process_dependency_links

self.finder = PackageFinder(**finder_kwargs)

# Caches
# stores project_name => InstallationCandidate mappings for all
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ envlist =
style
packaging
requirements
py{27,34,35,36,37,py}-pip{8,9,10,180,181,master}
py{27,34,35,36,37,py}-pip{8,9,10,180,181,190,master}

[testenv]
deps =
Expand All @@ -12,6 +12,7 @@ deps =
pip10: pip~=10.0
pip180: pip~=18.0.0
pip181: pip~=18.1.0
pip190: pip~=19.0.0
-rrequirements-test.txt
setenv =
pip_install=python -m pip install
Expand Down

0 comments on commit 307b2e6

Please sign in to comment.