Skip to content

Commit

Permalink
Support pip 19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
atugushev committed Jan 22, 2019
1 parent e03ce4f commit e1f5761
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
- PIP=9.0.3
- PIP=10.0.1
- PIP=18.0
- PIP=19.0
- PIP=latest
- PIP=master

Expand Down
1 change: 0 additions & 1 deletion piptools/repositories/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __init__(self, pip_options, session):
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,
)

Expand Down
8 changes: 4 additions & 4 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
from textwrap import dedent
from six.moves.urllib.request import pathname2url
import subprocess
import sys
import mock
Expand All @@ -12,6 +11,7 @@
from piptools.repositories import PyPIRepository
from piptools.scripts.compile import cli
from piptools.scripts.sync import cli as sync_cli
from .utils import pathname_to_url
from pip._vendor.packaging.version import parse as parse_version
from pip import __version__ as pip_version

Expand Down Expand Up @@ -242,7 +242,7 @@ def test_sync_quiet(tmpdir):
def test_editable_package(tmpdir):
""" piptools can compile an editable """
fake_package_dir = os.path.join(os.path.split(__file__)[0], 'test_data', 'small_fake_package')
fake_package_dir = 'file:' + pathname2url(fake_package_dir)
fake_package_dir = pathname_to_url(fake_package_dir)
runner = CliRunner()
with runner.isolated_filesystem():
with open('requirements.in', 'w') as req_in:
Expand Down Expand Up @@ -278,7 +278,7 @@ def test_locally_available_editable_package_is_not_archived_in_cache_dir(tmpdir)
cache_dir = tmpdir.mkdir('cache_dir')

fake_package_dir = os.path.join(os.path.split(__file__)[0], 'test_data', 'small_fake_package')
fake_package_dir = 'file:' + pathname2url(fake_package_dir)
fake_package_dir = pathname_to_url(fake_package_dir)

with mock.patch('piptools.repositories.pypi.CACHE_DIR', new=str(cache_dir)):
runner = CliRunner()
Expand Down Expand Up @@ -360,7 +360,7 @@ def test_upgrade_packages_version_option(tmpdir):
def test_generate_hashes_with_editable():
small_fake_package_dir = os.path.join(
os.path.split(__file__)[0], 'test_data', 'small_fake_package')
small_fake_package_url = 'file:' + pathname2url(small_fake_package_dir)
small_fake_package_url = pathname_to_url(small_fake_package_dir)
runner = CliRunner()
with runner.isolated_filesystem():
with open('requirements.in', 'w') as fp:
Expand Down
8 changes: 8 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from six.moves.urllib.request import pathname2url


def pathname_to_url(path):
"""
Given a path to a file, returns an URL with 'file://' scheme
"""
return 'file://' + pathname2url(path)
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ deps =
pip9.0.3: pip==9.0.3
pip10.0.1: pip==10.0.1
pip18.0: pip==18.0
pip19.0: pip==19.0
coverage
mock
pytest
Expand All @@ -25,6 +26,7 @@ setenv =
pip9.0.3: PIP=9.0.3
pip10.0.1: PIP=10.0.1
pip18.0: PIP=18.0
pip19.0: PIP==19.0
install_command= python -m pip install {opts} {packages}
commands =
pip --version
Expand All @@ -48,5 +50,6 @@ PIP =
9.0.3: pip9.0.3
10.0.1: pip10.0.1
18.0: pip18.0
19.0: pip19.0
latest: piplatest
master: pipmaster

0 comments on commit e1f5761

Please sign in to comment.