From 1a7d72fe6ebee100fda2a3d40dda1bcf14b29971 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 30 Jul 2018 14:35:28 +1000 Subject: [PATCH 1/7] Add link to PEP-440 for version specifiers --- docs/basics.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/basics.rst b/docs/basics.rst index 9c222eb4..8a9460e7 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -188,6 +188,7 @@ To tell pipenv to install a specific version of a library, the usage is simple:: This will update your ``Pipfile`` to reflect this requirement, automatically. +For other version specifiers, see `PEP-440 <(https://www.python.org/dev/peps/pep-0440/#version-specifiers>`. ☤ Specifying Versions of Python ------------------------------- From 587125c279a0e0abee3059083ea39d64c3e222e5 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 30 Jul 2018 14:38:53 +1000 Subject: [PATCH 2/7] Fix syntax of link --- docs/basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index 8a9460e7..3db70519 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -188,7 +188,7 @@ To tell pipenv to install a specific version of a library, the usage is simple:: This will update your ``Pipfile`` to reflect this requirement, automatically. -For other version specifiers, see `PEP-440 <(https://www.python.org/dev/peps/pep-0440/#version-specifiers>`. +For other version specifiers, see `PEP-440 `. ☤ Specifying Versions of Python ------------------------------- From f65c0dfd63192b638bea040ad7f51ad97afb7f92 Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Wed, 18 Jul 2018 17:10:41 -0400 Subject: [PATCH 3/7] Adding some git+git and git+ssh tests as examples --- tests/integration/test_install_uri.py | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/integration/test_install_uri.py b/tests/integration/test_install_uri.py index 24f7996f..4a73c1c7 100644 --- a/tests/integration/test_install_uri.py +++ b/tests/integration/test_install_uri.py @@ -25,6 +25,38 @@ def test_basic_vcs_install(PipenvInstance, pip_src_dir, pypi): assert "gitdb2" in p.lockfile["default"] +@pytest.mark.vcs +@pytest.mark.install +@pytest.mark.needs_internet +@flaky +def test_git_vcs_install(PipenvInstance, pip_src_dir, pypi): + with PipenvInstance(pypi=pypi, chdir=True) as p: + c = p.pipenv("install git+git://github.com/benjaminp/six.git@1.11.0#egg=six") + assert c.return_code == 0 + assert "six" in p.pipfile["packages"] + assert "git" in p.pipfile["packages"]["six"] + assert p.lockfile["default"]["six"] == { + "git": "git://github.com/benjaminp/six.git", + "ref": "15e31431af97e5e64b80af0a3f598d382bcdd49a", + } + + +@pytest.mark.vcs +@pytest.mark.install +@pytest.mark.needs_internet +@flaky +def test_ssh_vcs_install(PipenvInstance, pip_src_dir, pypi): + with PipenvInstance(pypi=pypi, chdir=True) as p: + c = p.pipenv("install git+ssh://git@github.com/benjaminp/six.git@1.11.0#egg=six") + assert c.return_code == 0 + assert "six" in p.pipfile["packages"] + assert "git" in p.pipfile["packages"]["six"] + assert p.lockfile["default"]["six"] == { + "git": "ssh://git@github.com/benjaminp/six.git", + "ref": "15e31431af97e5e64b80af0a3f598d382bcdd49a", + } + + @pytest.mark.files @pytest.mark.urls @pytest.mark.needs_internet From 8f1d99256c71fe4fe2f5500e30be9f74d2b54d51 Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Fri, 3 Aug 2018 12:56:27 -0700 Subject: [PATCH 4/7] Skip git+ssh test until we configure BildKite to have an SSH key-pair --- tests/integration/test_install_uri.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/test_install_uri.py b/tests/integration/test_install_uri.py index 4a73c1c7..4973b3cb 100644 --- a/tests/integration/test_install_uri.py +++ b/tests/integration/test_install_uri.py @@ -43,8 +43,10 @@ def test_git_vcs_install(PipenvInstance, pip_src_dir, pypi): @pytest.mark.vcs @pytest.mark.install +@pytest.mark.needs_ssh_keys @pytest.mark.needs_internet @flaky +@pytest.mark.skip(reason="must set valid SSH keys in testing environment") def test_ssh_vcs_install(PipenvInstance, pip_src_dir, pypi): with PipenvInstance(pypi=pypi, chdir=True) as p: c = p.pipenv("install git+ssh://git@github.com/benjaminp/six.git@1.11.0#egg=six") From 0081918e63a2e00d05d470b21c4e3dc7aaee4348 Mon Sep 17 00:00:00 2001 From: Alexandros Tzannes Date: Fri, 3 Aug 2018 15:48:21 -0700 Subject: [PATCH 5/7] Skip some tests if we have not set-up SSH keys for GitHub --- tests/integration/conftest.py | 25 +++++++++++++++++++++++++ tests/integration/test_install_uri.py | 3 +-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 8a8aebe6..9cb4b7b1 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -28,7 +28,30 @@ def check_internet(): return True +def check_github_ssh(): + res = False + try: + # `ssh -T git@github.com` will return successfully with return_code==1 + # and message 'Hi ! You've successfully authenticated, but + # GitHub does not provide shell access.' if ssh keys are available and + # registered with GitHub. Otherwise, the command will fail with + # return_code=255 and say 'Permission denied (publickey).' + c = delegator.run('ssh -T git@github.com') + res = True if c.return_code == 1 else False + except Exception: + pass + if not res: + warnings.warn( + 'Cannot connect to GitHub via SSH', ResourceWarning + ) + warnings.warn( + 'Will skip tests requiring SSH access to GitHub', ResourceWarning + ) + return res + + WE_HAVE_INTERNET = check_internet() +WE_HAVE_GITHUB_SSH_KEYS = check_github_ssh() TESTS_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) PYPI_VENDOR_DIR = os.path.join(TESTS_ROOT, 'pypi') @@ -38,6 +61,8 @@ prepare_pypi_packages(PYPI_VENDOR_DIR) def pytest_runtest_setup(item): if item.get_marker('needs_internet') is not None and not WE_HAVE_INTERNET: pytest.skip('requires internet') + if item.get_marker('needs_github_ssh') is not None and not WE_HAVE_GITHUB_SSH_KEYS: + pytest.skip('requires github ssh') class _PipenvInstance(object): diff --git a/tests/integration/test_install_uri.py b/tests/integration/test_install_uri.py index 4973b3cb..c51db6ad 100644 --- a/tests/integration/test_install_uri.py +++ b/tests/integration/test_install_uri.py @@ -43,10 +43,9 @@ def test_git_vcs_install(PipenvInstance, pip_src_dir, pypi): @pytest.mark.vcs @pytest.mark.install -@pytest.mark.needs_ssh_keys +@pytest.mark.needs_github_ssh @pytest.mark.needs_internet @flaky -@pytest.mark.skip(reason="must set valid SSH keys in testing environment") def test_ssh_vcs_install(PipenvInstance, pip_src_dir, pypi): with PipenvInstance(pypi=pypi, chdir=True) as p: c = p.pipenv("install git+ssh://git@github.com/benjaminp/six.git@1.11.0#egg=six") From 4bfa219985d2338854e3cea31ddd2072c5d47fad Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sat, 4 Aug 2018 18:16:35 -0400 Subject: [PATCH 6/7] Use proper syntax for rst links Fix link syntax for pep440 links in documentation --- docs/basics.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/basics.rst b/docs/basics.rst index 3db70519..bcd1f89f 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -188,7 +188,9 @@ To tell pipenv to install a specific version of a library, the usage is simple:: This will update your ``Pipfile`` to reflect this requirement, automatically. -For other version specifiers, see `PEP-440 `. +For other version specifiers, see `the relevant section of PEP-440`_. + +.. _`the relevant section of PEP-440`: https://www.python.org/dev/peps/pep-0440/#version-specifiers> ☤ Specifying Versions of Python ------------------------------- From 797ce40bb29fa50cec307240fc4ac2965fa7a047 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Sun, 5 Aug 2018 02:39:00 -0400 Subject: [PATCH 7/7] Add news entry for pr #2674 Signed-off-by: Dan Ryan --- news/2674.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2674.doc diff --git a/news/2674.doc b/news/2674.doc new file mode 100644 index 00000000..33fbd49e --- /dev/null +++ b/news/2674.doc @@ -0,0 +1 @@ +Added a link to ``PEP-440`` version specifiers in the documentation for additional detail.