From cc8984b447cba72fbab1ecbb2dad507c823e9308 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Fri, 22 Jun 2018 22:18:26 -0400 Subject: [PATCH 01/15] Update requirementslib Signed-off-by: Dan Ryan --- pipenv/vendor/requirementslib/__init__.py | 2 +- pipenv/vendor/requirementslib/models/lockfile.py | 7 ++++--- pipenv/vendor/requirementslib/models/requirements.py | 7 ++++++- pipenv/vendor/requirementslib/models/utils.py | 2 +- pipenv/vendor/vendor.txt | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pipenv/vendor/requirementslib/__init__.py b/pipenv/vendor/requirementslib/__init__.py index 72ce5b71..e7273226 100644 --- a/pipenv/vendor/requirementslib/__init__.py +++ b/pipenv/vendor/requirementslib/__init__.py @@ -1,5 +1,5 @@ # -*- coding=utf-8 -*- -__version__ = "1.0.1" +__version__ = "1.0.2" from .exceptions import RequirementError diff --git a/pipenv/vendor/requirementslib/models/lockfile.py b/pipenv/vendor/requirementslib/models/lockfile.py index b79e1947..c04ae021 100644 --- a/pipenv/vendor/requirementslib/models/lockfile.py +++ b/pipenv/vendor/requirementslib/models/lockfile.py @@ -9,8 +9,8 @@ from .._compat import Path, FileNotFoundError @attr.s class Lockfile(object): - dev_requirements = attr.ib(default=list) - requirements = attr.ib(default=list) + dev_requirements = attr.ib(default=attr.Factory(list)) + requirements = attr.ib(default=attr.Factory(list)) path = attr.ib(default=None, validator=optional_instance_of(Path)) pipfile_hash = attr.ib(default=None) @@ -31,7 +31,8 @@ class Lockfile(object): if not lockfile_path.exists(): raise FileNotFoundError("No such lockfile: %s" % lockfile_path) - lockfile = json.loads(lockfile_path.read_text(encoding="utf-8")) + with lockfile_path.open(encoding="utf-8") as f: + lockfile = json.loads(f.read()) for k in lockfile["develop"].keys(): dev_requirements.append(Requirement.from_pipfile(k, lockfile["develop"][k])) for k in lockfile["default"].keys(): diff --git a/pipenv/vendor/requirementslib/models/requirements.py b/pipenv/vendor/requirementslib/models/requirements.py index 71e228f0..9fa3e6ca 100644 --- a/pipenv/vendor/requirementslib/models/requirements.py +++ b/pipenv/vendor/requirementslib/models/requirements.py @@ -324,7 +324,7 @@ class FileRequirement(BaseRequirement): vcs_type, prefer, relpath, path, uri, link = cls.get_link_from_line(line) setup_path = Path(path) / "setup.py" if path else None arg_dict = { - "path": relpath or path, + "path": relpath if relpath else path, "uri": unquote(link.url_without_fragment), "link": link, "editable": editable, @@ -347,6 +347,11 @@ class FileRequirement(BaseRequirement): uri = pipfile.get("uri") fil = pipfile.get("file") path = pipfile.get("path") + if path: + if isinstance(path, Path) and not path.is_absolute(): + path = get_converted_relative_path(path.as_posix()) + elif not os.path.isabs(path): + path = get_converted_relative_path(path) if path and uri: raise ValueError("do not specify both 'path' and 'uri'") if path and fil: diff --git a/pipenv/vendor/requirementslib/models/utils.py b/pipenv/vendor/requirementslib/models/utils.py index 13b2b368..b7daf890 100644 --- a/pipenv/vendor/requirementslib/models/utils.py +++ b/pipenv/vendor/requirementslib/models/utils.py @@ -84,7 +84,7 @@ def strip_ssh_from_git_uri(uri): def add_ssh_scheme_to_git_uri(uri): - """Cleans VCS uris from pipenv.patched.notpip format""" + """Cleans VCS uris from pip format""" if isinstance(uri, six.string_types): # Add scheme for parsing purposes, this is also what pip does if uri.startswith("git+") and "://" not in uri: diff --git a/pipenv/vendor/vendor.txt b/pipenv/vendor/vendor.txt index eafcec98..1936b858 100644 --- a/pipenv/vendor/vendor.txt +++ b/pipenv/vendor/vendor.txt @@ -27,7 +27,7 @@ requests==2.19.1 idna==2.7 urllib3==1.23 certifi==2018.4.16 -requirementslib==1.0.1 +requirementslib==1.0.2 attrs==18.1.0 distlib==0.2.7 packaging==17.1 From 74430df2f35cbf639cc92f9c299f7f59145a212d Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 23 Jun 2018 01:43:12 -0400 Subject: [PATCH 02/15] Add tests to cover #2260 Signed-off-by: Dan Ryan --- tests/integration/test_install_twists.py | 22 ++++++++++++++++++ .../six-1.11.0+mkl-py2.py3-none-any.whl | Bin 0 -> 10702 bytes 2 files changed, 22 insertions(+) create mode 100644 tests/test_artifacts/six-1.11.0+mkl-py2.py3-none-any.whl diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index e12b2ab6..91cdf329 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -230,3 +230,25 @@ def test_install_local_file_collision(PipenvInstance, pypi): assert target_package in p.pipfile['packages'] assert p.pipfile['packages'][target_package] == '*' assert target_package in p.lockfile['default'] + + +@pytest.mark.url +@pytest.mark.install +def test_install_local_uri_special_character(PipenvInstance, testsroot): + file_name = 'six-1.11.0+mkl-py2.py3-none-any.whl' + source_path = os.path.abspath(os.path.join(testsroot, 'test_artifacts', file_name)) + with PipenvInstance() as p: + artifact_dir = 'artifacts' + artifact_path = os.path.join(p.path, artifact_dir) + mkdir_p(artifact_path) + shutil.copy(source_path, os.path.join(artifact_path, file_name)) + with open(p.pipfile_path, 'w') as f: + contents = """ +# Pre comment +[packages] +six = {{path = "./artifacts/{}"}} + """.format(file_name) + f.write(contents.strip()) + c = p.pipenv('install') + assert c.return_code == 0 + assert 'six' in p.lockfile['default'] diff --git a/tests/test_artifacts/six-1.11.0+mkl-py2.py3-none-any.whl b/tests/test_artifacts/six-1.11.0+mkl-py2.py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..599602396f904e27512eca2a8b50842f65bbddb8 GIT binary patch literal 10702 zcmZ{q1#BJ5vaXkznVDl|hM1YX%*;&7%uF#mam>ujj4{N_j+vR6IXCAXy?5T;@9Y`1 zMl(`>>Q-0PU!y8zIS5Eh0000Bm`-AqqoZ1Tnj!)KN<9Gp=s#awtUZ}PUR9rMU3R&? zZQj#^(q*+*)Lq#hC_R#*RA-jbV;tW3mJ?+h76$UAhfUq69+bd^7JT zmV}&Mx8lH$9SoV^-l2@)s`F@(9q7S}>TkK+@JIOlp7KN*B6QY-^MyWblm{+kBV&U= z`ll_kOeYJf0l5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JU;iU+Ezq_x}%QQz|{8JZcdwZfgbGETm;@wI7_ zg6hLK7r4lHV4-swrP*l%k^j2u%2=dtXi<5wtKntso2JBbJ9eMpk#Wvn)O<%o6YT%S zGd?_(09J_syQyZHsbmpY?4iCB9UX;*IOCn;o-dFr5!fhJT4v4irJCGOl#k_YM(}Y> z35H<1XIe_?v=8;FtWN8^SrVb7^j#CldoF_OtlEm-u zJZ_WObZ+~ILVedqeQrA6Kj9;nl}V%soSt^aA`}O*vGp6X1gK)82!ffpQ|f0NVJ%wu zPDy*cgSEZ*7`(I)@0Mat7hNWHRtHVY%32+`H65{7xq$CRyI}UamQ_$mpS@Ke4)~Pg zoW5ry|JLZx%MaauYmEY)!2H#1`-NrQjQ#|3!aqJj@K62$ln_$_in~pZ0Yg{-VcT8o z-Eh5-HhBm*nBbAvvU#ws{e^m_ZPuu|IUDNhb%N}hY0pqUMt2p^kyNu6nW5+OezjC_(ny89{3vWb$me|yA}do~ydQ$;tpSX{jwmy=rUEW2wnzH%@RWZ` zKW4vC74sXuu5M#MZSwMIUE6DZ@*f+^vI*I{i>~Kc4nE||883$p58bkm@wlF;jVW-l z+-?`58kha-cA>!HJ|pGQYhjZZ0|t6cbIFNQ*-nB)Le~+q4??PKLt&87Ni_|=zVPRz z!2ubOf~0uw3HE1BU0(TPy45mKcw(I5X*bwSPQLJ@JotMp0+p zC2y2Wk`bx$r!%W`qIt$=-ucpQiiS9mRS}bX{0UrO;Fu8q+_(4VbpH1$4EopO-(7tF z@0|aZ`2BkZ08kio`zQMS*O>gbH1O}lzpMR!h{~k@K>UmL|DE@DwfPT^^iMMJUsw1S z?fE Date: Sat, 23 Jun 2018 03:01:20 -0400 Subject: [PATCH 03/15] Add some tests - the rest of the to-do items are at https://github.com/pypa/pipenv/projects/2 - We just need to review the items in the 'needs tests' column to ensure that they either have tests, or don't need to have tests - If they need tests, and they don't yet have tests, we need to write them and make sure they pass - Then we can release. No more features/bugfixes, this is now how it's going out. Signed-off-by: Dan Ryan --- tests/integration/test_install_twists.py | 42 +++++++++++++++--------- tests/integration/test_lock.py | 29 ++++++++++++---- tests/unit/test_utils.py | 7 ++++ 3 files changed, 56 insertions(+), 22 deletions(-) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index 91cdf329..dfa265a2 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -1,6 +1,6 @@ import os import shutil - +from pipenv.project import Project try: import pathlib except ImportError: @@ -16,36 +16,46 @@ from flaky import flaky @pytest.mark.extras @pytest.mark.install @pytest.mark.local -@pytest.mark.skip(reason="I'm not mocking this.") -def test_local_extras_install(PipenvInstance, pypi): - with PipenvInstance(pypi=pypi) as p: +@pytest.mark.parametrize('line, pipfile', [ + ['-e .[dev]', {'testpipenv': {'path': '.', 'editable': True, 'extras': ['dev']}}] +]) +def test_local_extras_install(PipenvInstance, pypi, line, pipfile): + """Test -e .[extras] installs... note that the extras themselves + are currently not landing in the lockfile for reasons that are unclear. + """ + with PipenvInstance(pypi=pypi, chdir=True) as p: + project = Project() setup_py = os.path.join(p.path, 'setup.py') with open(setup_py, 'w') as fh: contents = """ from setuptools import setup, find_packages - setup( -name='test_pipenv', +name='testpipenv', version='0.1', description='Pipenv Test Package', author='Pipenv Test', author_email='test@pipenv.package', -license='PIPENV', +license='MIT', packages=find_packages(), -install_requires=['tablib'], -extras_require={'dev': ['flake8', 'pylint']}, +install_requires=[], +extras_require={'dev': ['six']}, zip_safe=False ) """.strip() fh.write(contents) - c = p.pipenv('install .[dev]') + project.write_toml({'packages': pipfile, 'dev-packages': {}}) + c = p.pipenv('install') assert c.return_code == 0 - key = [k for k in p.pipfile['packages'].keys()][0] - dep = p.pipfile['packages'][key] - assert dep['path'] == '.' - assert dep['extras'] == ['dev'] - assert key in p.lockfile['default'] - assert 'dev' in p.lockfile['default'][key]['extras'] + assert 'testpipenv' in p.lockfile['default'] + assert p.lockfile['default']['testpipenv']['extras'] == ['dev'] + c = p.pipenv('--rm') + assert c.return_code == 0 + project.write_toml({'packages': {}, 'dev-packages': {}}) + c = p.pipenv('install {0}'.format(line)) + assert c.return_code == 0 + assert 'testpipenv' in p.pipfile['packages'] + assert p.pipfile['packages']['testpipenv']['path'] in ['.', './.'] + assert p.pipfile['packages']['testpipenv']['extras'] == ['dev'] @pytest.mark.e diff --git a/tests/integration/test_lock.py b/tests/integration/test_lock.py index ce57e544..0dfd22bb 100644 --- a/tests/integration/test_lock.py +++ b/tests/integration/test_lock.py @@ -307,12 +307,11 @@ requests = "==2.14.0" """.strip().format(url=pypi.url) f.write(contents) - os.environ['MY_ENV_VAR'] = 'simple' - c = p.pipenv('lock') - assert c.return_code == 0 - assert 'requests' in p.lockfile['default'] - - del os.environ['MY_ENV_VAR'] + with temp_environ(): + os.environ['MY_ENV_VAR'] = 'simple' + c = p.pipenv('lock') + assert c.return_code == 0 + assert 'requests' in p.lockfile['default'] with open(p.pipfile_path, 'w') as f: contents = """ @@ -328,3 +327,21 @@ requests = "==2.14.0" assert c.return_code == 0 assert 'requests' in p.lockfile['default'] + +@pytest.mark.lock +@pytest.mark.vcs +@pytest.mark.needs_internet +def lock_editable_vcs_without_install(PipenvInstance, pypi): + with PipenvInstance(pypi=pypi, chdir=True) as p: + with open(p.pipfile_path, 'w') as f: + f.write(""" +[packages] +requests = {git = "https://github.com/requests/requests.git", ref = "master", editable = true} + """.strip()) + c = p.pipenv('lock') + assert c.return_code == 0 + assert 'requests' in p.lockfile['default'] + assert 'idna' in p.lockfile['default'] + assert 'chardet' in p.lockfile['default'] + c = p.pipenv('install') + assert c.return_code == 0 diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 7847551a..361108dd 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -60,6 +60,13 @@ DEP_PIP_PAIRS = [ }}, 'git+https://github.com/requests/requests.git@master#egg=requests[security]', ), + ( + {'local_path': { + 'path': '.', + 'extras': ['dev'] + }}, + '.[dev]' + ) ] From 6a4831bccd39d33235c555d6faba78e588566cb5 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 23 Jun 2018 12:19:32 -0400 Subject: [PATCH 04/15] Fix broken test Signed-off-by: Dan Ryan --- tests/unit/test_utils.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 361108dd..7847551a 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -60,13 +60,6 @@ DEP_PIP_PAIRS = [ }}, 'git+https://github.com/requests/requests.git@master#egg=requests[security]', ), - ( - {'local_path': { - 'path': '.', - 'extras': ['dev'] - }}, - '.[dev]' - ) ] From dca353ffdb7a98de17ac9a775e6eaf086365a488 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 23 Jun 2018 19:18:18 -0400 Subject: [PATCH 05/15] add test for #2192 Signed-off-by: Dan Ryan --- tests/integration/test_pipenv.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_pipenv.py b/tests/integration/test_pipenv.py index 30a955bd..82117704 100644 --- a/tests/integration/test_pipenv.py +++ b/tests/integration/test_pipenv.py @@ -5,8 +5,7 @@ XXX: Try our best to reduce tests in this file. from pipenv.core import activate_virtualenv from pipenv.project import Project - - +from pipenv.vendor import delegator import pytest @@ -83,3 +82,13 @@ def test_update_locks(PipenvInstance, pypi): assert c.return_code == 0 lines = c.out.splitlines() assert 'requests==2.19.1' in [l.strip() for l in lines] + + +@pytest.mark.project +@pytest.mark.proper_names +def test_proper_names_unamanged_virtualenv(PipenvInstance, pypi): + with PipenvInstance(chdir=True, pypi=pypi) as p: + c = delegator.run('python -m virtualenv .venv') + assert c.return_code == 0 + project = Project() + assert project.proper_names == [] From 6b8649f575fefa661671f13d679013cbec6e5d47 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 23 Jun 2018 19:46:51 -0400 Subject: [PATCH 06/15] Add test for #1861 Signed-off-by: Dan Ryan --- tests/integration/test_install_basic.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index a6798aa3..3fb04e4c 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -2,7 +2,13 @@ import contextlib import os from pipenv.utils import temp_environ +from pipenv._compat import TemporaryDirectory from pipenv.vendor import delegator +from pipenv.project import Project +try: + from pathlib import Path +except ImportError: + from pipenv.vendor.pathlib2 import Path import pytest @@ -309,3 +315,20 @@ def test_editable_no_args(PipenvInstance): c = p.pipenv('install -e') assert c.return_code != 0 assert 'Please provide path to editable package' in c.err + + +@pytest.mark.install +@pytest.mark.virtualenv +def test_install_venv_project_directory(PipenvInstance, pypi): + """Test pew's project functionality during virtualenv creation. Since .venv + virtualenvs are not created with pew, we need to swap to a workon_home based + virtualenv for this test""" + with PipenvInstance(pypi=pypi, chdir=True) as p: + with temp_environ(), TemporaryDirectory(prefix='pipenv-', suffix='temp_workon_home') as workon_home: + os.environ['WORKON_HOME'] = workon_home.name + if 'PIPENV_VENV_IN_PROJECT' in os.environ: + del os.environ['PIPENV_VENV_IN_PROJECT'] + c = p.pipenv('install six') + assert c.return_code == 0 + project = Project() + assert Path(project.virtualenv_location).joinpath('.project').exists() From b2f6932a131bfe1ec501eb1751ac8a87d5fecc4f Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 23 Jun 2018 19:57:06 -0400 Subject: [PATCH 07/15] Add tests for #2309 Signed-off-by: Dan Ryan --- tests/integration/test_install_basic.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index 3fb04e4c..a992d49a 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -332,3 +332,26 @@ def test_install_venv_project_directory(PipenvInstance, pypi): assert c.return_code == 0 project = Project() assert Path(project.virtualenv_location).joinpath('.project').exists() + + +@pytest.mark.install +@pytest.mark.requirements +def test_install_ignores_requirements_with_existing_projects(PipenvInstance, pypi): + """This test is deisgned to make sure that pipenv ignores requirements.txt files + for projects that already exist (already have a Pipfile) as well as for times when a + package name is passed in to the install command.""" + with PipenvInstance(chdir=True, pypi=pypi) as p: + requirements_path = Path(p.path).joinpath('requirements.txt') + requirements_path.write_text(""" +pytz +chardet + """.strip()) + p.pipenv('install six') + assert 'six' in p.pipfile['packages'] + assert 'chardet' not in p.pipfile['packages'] + assert 'pytz' not in p.pipfile['packages'] + p.pipenv('--rm') + p.pipenv('install') + assert 'six' in p.pipfile['packages'] + assert 'chardet' not in p.pipfile['packages'] + assert 'pytz' not in p.pipfile['packages'] From d6adc1efa579c512bf0cfcd2693e23abb1a1ac43 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 23 Jun 2018 18:15:03 -0600 Subject: [PATCH 08/15] test skipping requirements if there is a lockfile or package name is specified --- tests/integration/test_install_basic.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index a6798aa3..74705029 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -267,6 +267,29 @@ def test_requirements_to_pipfile(PipenvInstance, pypi): assert 'pysocks' in p.lockfile['default'] +@pytest.mark.install +@pytest.mark.requirements +def test_skip_requirements_when_pipfile(PipenvInstance, pypi): + + with PipenvInstance(chdir=True, pypi=pypi) as p: + with open('requirements.txt', 'w') as f: + f.write('requests==2.18.1\n') + with open(p.pipfile_path, 'w') as f: + contents = """ +[packages] +tablib = "<0.12" + """.strip() + f.write(contents) + c = p.pipenv('install') + assert c.return_code == 0 + c = p.pipenv('install six') + assert 'tablib' in p.pipfile['packages'] + assert 'tablib' in p.lockfile['default'] + assert 'six' in p.pipfile['packages'] + assert 'six' in p.lockfile['default'] + assert 'requests' not in p.pipfile['packages'] + assert 'requests' not in p.lockfile['default'] + @pytest.mark.cli @pytest.mark.clean def test_clean_on_empty_venv(PipenvInstance, pypi): From ef913b2148f69f824cd7c1fad25c4e22aec1d93b Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 23 Jun 2018 20:27:08 -0400 Subject: [PATCH 09/15] Tests for #2273 and #2301 Signed-off-by: Dan Ryan --- tests/integration/test_install_basic.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index a992d49a..9da44f7d 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -355,3 +355,25 @@ chardet assert 'six' in p.pipfile['packages'] assert 'chardet' not in p.pipfile['packages'] assert 'pytz' not in p.pipfile['packages'] + + +@pytest.mark.deploy +@pytest.mark.system +def test_system_and_deploy_work(PipenvInstance, pypi): + with PipenvInstance(chdir=True, pypi=pypi) as p: + c = p.pipenv('install six requests') + assert c.return_code == 0 + c = p.pipenv('--rm') + assert c.return_code == 0 + c = delegator.run('virtualenv .venv') + assert c.return_code == 0 + c = p.pipenv('install --system --deploy') + assert c.return_code == 0 + c = p.pipenv('--rm') + assert c.return_code == 0 + Path(p.pipfile_path).write_text(""" +[packages] +requests + """.strip()) + c = p.pipenv('install --system') + assert c.return_code == 0 From aa82db02f7bcef56ef45167ef53e3184424f518b Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 23 Jun 2018 20:32:20 -0400 Subject: [PATCH 10/15] Update test with comments + minor tweak Signed-off-by: Dan Ryan --- tests/integration/test_install_basic.py | 32 ++++++------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index 7e5c8a7a..2e5cad67 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -280,15 +280,16 @@ def test_skip_requirements_when_pipfile(PipenvInstance, pypi): with PipenvInstance(chdir=True, pypi=pypi) as p: with open('requirements.txt', 'w') as f: f.write('requests==2.18.1\n') + c = p.pipenv('install six') + assert c.return_code == 0 with open(p.pipfile_path, 'w') as f: contents = """ [packages] +six = "*" tablib = "<0.12" """.strip() f.write(contents) c = p.pipenv('install') - assert c.return_code == 0 - c = p.pipenv('install six') assert 'tablib' in p.pipfile['packages'] assert 'tablib' in p.lockfile['default'] assert 'six' in p.pipfile['packages'] @@ -296,6 +297,7 @@ tablib = "<0.12" assert 'requests' not in p.pipfile['packages'] assert 'requests' not in p.lockfile['default'] + @pytest.mark.cli @pytest.mark.clean def test_clean_on_empty_venv(PipenvInstance, pypi): @@ -306,6 +308,9 @@ def test_clean_on_empty_venv(PipenvInstance, pypi): @pytest.mark.install def test_install_does_not_extrapolate_environ(PipenvInstance, pypi): + """This test is deisgned to make sure that pipenv ignores requirements.txt files + for projects that already exist (already have a Pipfile) as well as for times when a + package name is passed in to the install command.""" with temp_environ(), PipenvInstance(pypi=pypi, chdir=True) as p: os.environ['PYPI_URL'] = pypi.url @@ -357,29 +362,6 @@ def test_install_venv_project_directory(PipenvInstance, pypi): assert Path(project.virtualenv_location).joinpath('.project').exists() -@pytest.mark.install -@pytest.mark.requirements -def test_install_ignores_requirements_with_existing_projects(PipenvInstance, pypi): - """This test is deisgned to make sure that pipenv ignores requirements.txt files - for projects that already exist (already have a Pipfile) as well as for times when a - package name is passed in to the install command.""" - with PipenvInstance(chdir=True, pypi=pypi) as p: - requirements_path = Path(p.path).joinpath('requirements.txt') - requirements_path.write_text(""" -pytz -chardet - """.strip()) - p.pipenv('install six') - assert 'six' in p.pipfile['packages'] - assert 'chardet' not in p.pipfile['packages'] - assert 'pytz' not in p.pipfile['packages'] - p.pipenv('--rm') - p.pipenv('install') - assert 'six' in p.pipfile['packages'] - assert 'chardet' not in p.pipfile['packages'] - assert 'pytz' not in p.pipfile['packages'] - - @pytest.mark.deploy @pytest.mark.system def test_system_and_deploy_work(PipenvInstance, pypi): From 30b6425d5738c3908ef4f06d98d8581d12d2a3df Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 23 Jun 2018 23:35:35 -0400 Subject: [PATCH 11/15] Updated requirementslib and tests Signed-off-by: Dan Ryan --- pipenv/vendor/requirementslib/__init__.py | 2 +- pipenv/vendor/requirementslib/models/requirements.py | 6 ++---- pipenv/vendor/requirementslib/utils.py | 6 ++++-- pipenv/vendor/vendor.txt | 2 +- tests/integration/test_install_twists.py | 4 +++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pipenv/vendor/requirementslib/__init__.py b/pipenv/vendor/requirementslib/__init__.py index e7273226..36caf359 100644 --- a/pipenv/vendor/requirementslib/__init__.py +++ b/pipenv/vendor/requirementslib/__init__.py @@ -1,5 +1,5 @@ # -*- coding=utf-8 -*- -__version__ = "1.0.2" +__version__ = "1.0.3" from .exceptions import RequirementError diff --git a/pipenv/vendor/requirementslib/models/requirements.py b/pipenv/vendor/requirementslib/models/requirements.py index 9fa3e6ca..16d99863 100644 --- a/pipenv/vendor/requirementslib/models/requirements.py +++ b/pipenv/vendor/requirementslib/models/requirements.py @@ -392,7 +392,7 @@ class FileRequirement(BaseRequirement): ): seed = unquote(self.link.url_without_fragment) or self.uri else: - seed = self.formatted_path or self.link.url or self.uri + seed = self.formatted_path or unquote(self.link.url_without_fragment) or self.uri # add egg fragments to remote artifacts (valid urls only) if not self._has_hashed_name and self.is_remote_artifact: seed += "#egg={0}".format(self.name) @@ -794,9 +794,7 @@ class Requirement(object): @property def constraint_line(self): - if self.is_named or self.is_vcs: - return self.as_line() - return self.req.req.line + return self.as_line() def as_pipfile(self): good_keys = ( diff --git a/pipenv/vendor/requirementslib/utils.py b/pipenv/vendor/requirementslib/utils.py index e25d2e85..95cf8873 100644 --- a/pipenv/vendor/requirementslib/utils.py +++ b/pipenv/vendor/requirementslib/utils.py @@ -69,8 +69,10 @@ def get_converted_relative_path(path, relative_to=os.curdir): path = start.joinpath(".", path).relative_to(start) # Normalize these to use forward slashes even on windows if os.name == "nt": - return os.altsep.join([".", path.as_posix()]) - return os.sep.join([".", path.as_posix()]) + relpath = os.altsep.join([".", path.as_posix()]) + relpath = os.sep.join([".", path.as_posix()]) + if relpath == './.': + return '.' def multi_split(s, split): diff --git a/pipenv/vendor/vendor.txt b/pipenv/vendor/vendor.txt index 1936b858..c70ebc07 100644 --- a/pipenv/vendor/vendor.txt +++ b/pipenv/vendor/vendor.txt @@ -27,7 +27,7 @@ requests==2.19.1 idna==2.7 urllib3==1.23 certifi==2018.4.16 -requirementslib==1.0.2 +requirementslib==1.0.3 attrs==18.1.0 distlib==0.2.7 packaging==17.1 diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index dfa265a2..0a48bafb 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -48,14 +48,16 @@ zip_safe=False assert c.return_code == 0 assert 'testpipenv' in p.lockfile['default'] assert p.lockfile['default']['testpipenv']['extras'] == ['dev'] + assert 'six' in p.lockfile['default'] c = p.pipenv('--rm') assert c.return_code == 0 project.write_toml({'packages': {}, 'dev-packages': {}}) c = p.pipenv('install {0}'.format(line)) assert c.return_code == 0 assert 'testpipenv' in p.pipfile['packages'] - assert p.pipfile['packages']['testpipenv']['path'] in ['.', './.'] + assert p.pipfile['packages']['testpipenv']['path'] == '.' assert p.pipfile['packages']['testpipenv']['extras'] == ['dev'] + assert 'six' in p.lockfile['default'] @pytest.mark.e From 4b63fe5086be48ffe0b8c241cd3cadcde862c7f4 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sun, 24 Jun 2018 00:03:10 -0400 Subject: [PATCH 12/15] Update requirementslib again Signed-off-by: Dan Ryan --- pipenv/vendor/requirementslib/__init__.py | 2 +- pipenv/vendor/requirementslib/utils.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pipenv/vendor/requirementslib/__init__.py b/pipenv/vendor/requirementslib/__init__.py index 36caf359..3c2e0ce1 100644 --- a/pipenv/vendor/requirementslib/__init__.py +++ b/pipenv/vendor/requirementslib/__init__.py @@ -1,5 +1,5 @@ # -*- coding=utf-8 -*- -__version__ = "1.0.3" +__version__ = "1.0.4" from .exceptions import RequirementError diff --git a/pipenv/vendor/requirementslib/utils.py b/pipenv/vendor/requirementslib/utils.py index 95cf8873..7b7680b5 100644 --- a/pipenv/vendor/requirementslib/utils.py +++ b/pipenv/vendor/requirementslib/utils.py @@ -72,7 +72,8 @@ def get_converted_relative_path(path, relative_to=os.curdir): relpath = os.altsep.join([".", path.as_posix()]) relpath = os.sep.join([".", path.as_posix()]) if relpath == './.': - return '.' + relpath = '.' + return relpath def multi_split(s, split): From 5402a9bc0f4f0b9bc9f329617aff5de2e360464b Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sun, 24 Jun 2018 00:06:31 -0400 Subject: [PATCH 13/15] Bump requirementslib version Signed-off-by: Dan Ryan --- pipenv/vendor/vendor.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/vendor/vendor.txt b/pipenv/vendor/vendor.txt index c70ebc07..aa1e3126 100644 --- a/pipenv/vendor/vendor.txt +++ b/pipenv/vendor/vendor.txt @@ -27,7 +27,7 @@ requests==2.19.1 idna==2.7 urllib3==1.23 certifi==2018.4.16 -requirementslib==1.0.3 +requirementslib==1.0.4 attrs==18.1.0 distlib==0.2.7 packaging==17.1 From 3bfab233f58fe33f689711c07efa1c2f201816d6 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sun, 24 Jun 2018 00:10:36 -0400 Subject: [PATCH 14/15] Unicode file data Signed-off-by: Dan Ryan --- tests/integration/test_install_basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_install_basic.py b/tests/integration/test_install_basic.py index 2e5cad67..047c9d78 100644 --- a/tests/integration/test_install_basic.py +++ b/tests/integration/test_install_basic.py @@ -376,7 +376,7 @@ def test_system_and_deploy_work(PipenvInstance, pypi): assert c.return_code == 0 c = p.pipenv('--rm') assert c.return_code == 0 - Path(p.pipfile_path).write_text(""" + Path(p.pipfile_path).write_text(u""" [packages] requests """.strip()) From 9624dce80adc9330c0ea507e3d04f3081868df33 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sun, 24 Jun 2018 01:01:30 -0400 Subject: [PATCH 15/15] Windows relpath fix with requirementslib update Signed-off-by: Dan Ryan --- pipenv/vendor/requirementslib/__init__.py | 2 +- pipenv/vendor/requirementslib/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pipenv/vendor/requirementslib/__init__.py b/pipenv/vendor/requirementslib/__init__.py index 3c2e0ce1..f3393c11 100644 --- a/pipenv/vendor/requirementslib/__init__.py +++ b/pipenv/vendor/requirementslib/__init__.py @@ -1,5 +1,5 @@ # -*- coding=utf-8 -*- -__version__ = "1.0.4" +__version__ = "1.0.5.dev0" from .exceptions import RequirementError diff --git a/pipenv/vendor/requirementslib/utils.py b/pipenv/vendor/requirementslib/utils.py index 7b7680b5..02511c93 100644 --- a/pipenv/vendor/requirementslib/utils.py +++ b/pipenv/vendor/requirementslib/utils.py @@ -71,7 +71,7 @@ def get_converted_relative_path(path, relative_to=os.curdir): if os.name == "nt": relpath = os.altsep.join([".", path.as_posix()]) relpath = os.sep.join([".", path.as_posix()]) - if relpath == './.': + if relpath in ['./.', '.\\.']: relpath = '.' return relpath