From b89c79116d1ba68e299b12b8a85a3254ca662777 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Mon, 28 Aug 2023 11:22:27 +0200 Subject: [PATCH 1/7] drop python3.7 --- pipenv/environment.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pipenv/environment.py b/pipenv/environment.py index 26975ce0..8169e042 100644 --- a/pipenv/environment.py +++ b/pipenv/environment.py @@ -9,6 +9,7 @@ import os import site import sys import typing +from functools import cached_property from pathlib import Path from sysconfig import get_paths, get_python_version, get_scheme_names from urllib.parse import urlparse @@ -30,14 +31,6 @@ from pipenv.utils.processes import subprocess_run from pipenv.utils.shell import make_posix, temp_environ from pipenv.vendor.pythonfinder.utils import is_in_path -try: - # this is only in Python3.8 and later - from functools import cached_property -except ImportError: - # eventually distlib will remove cached property when they drop Python3.7 - from pipenv.patched.pip._vendor.distlib.util import cached_property - - if typing.TYPE_CHECKING: from types import ModuleType from typing import ContextManager, Generator From c1062f22305f1a7a1eec854b65f9fc0325372555 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Mon, 28 Aug 2023 12:12:47 +0200 Subject: [PATCH 2/7] upgrade lru_cache syntax to 3.8 --- pipenv/utils/project.py | 2 +- pipenv/utils/resolver.py | 4 ++-- pipenv/utils/shell.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pipenv/utils/project.py b/pipenv/utils/project.py index 84166961..792fc8e1 100644 --- a/pipenv/utils/project.py +++ b/pipenv/utils/project.py @@ -87,7 +87,7 @@ def ensure_project( os.environ["PIP_PYTHON_PATH"] = project.python(system=system) -@lru_cache() +@lru_cache def get_setuptools_version(): # type: () -> Optional[STRING_TYPE] diff --git a/pipenv/utils/resolver.py b/pipenv/utils/resolver.py index 06c8c8cb..590e7d9c 100644 --- a/pipenv/utils/resolver.py +++ b/pipenv/utils/resolver.py @@ -148,7 +148,7 @@ class Resolver: ) @staticmethod - @lru_cache() + @lru_cache def _get_pip_command(): return InstallCommand(name="InstallCommand", summary="pip Install command.") @@ -931,7 +931,7 @@ def resolve_deps( return results, internal_resolver -@lru_cache() +@lru_cache def get_pipenv_sitedir() -> Optional[str]: site_dir = next( iter(d for d in pkg_resources.working_set if d.key.lower() == "pipenv"), None diff --git a/pipenv/utils/shell.py b/pipenv/utils/shell.py index dd7795ab..50d2b9cf 100644 --- a/pipenv/utils/shell.py +++ b/pipenv/utils/shell.py @@ -19,7 +19,7 @@ from .constants import FALSE_VALUES, SCHEME_LIST, TRUE_VALUES from .processes import subprocess_run -@lru_cache() +@lru_cache def make_posix(path: str) -> str: """ Convert a path with possible windows-style separators to a posix-style path From f7ae8f10a8fe5f070ef6c8b503f8d52903aa40ae Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Wed, 11 Oct 2023 13:28:39 +0200 Subject: [PATCH 3/7] more cleaning --- run-tests.sh | 2 +- tests/integration/conftest.py | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index 8d589726..55e38dd3 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -13,7 +13,7 @@ export PIPENV_CACHE_DIR=`mktemp -d 2>/dev/null || mktemp -d -t 'pipenv_cache'` # on some Linux OS python is python3 PYTHON=${PYTHON:-"python"} -PIPENV_PYTHON="${PIPENV_PYTHON:-3.7}" +PIPENV_PYTHON="${PIPENV_PYTHON:-3.8}" PIP_CALL="${PIP_CALL:-${PYTHON} -m pip install --user}" diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index e16f7835..3a4c88f2 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -104,14 +104,6 @@ def pytest_runtest_setup(item): pytest.skip('test not applicable on python 3.8') if item.get_closest_marker('skip_osx') is not None and sys.platform == 'darwin': pytest.skip('test does not apply on OSX') - if item.get_closest_marker('lte_py36') is not None and ( - sys.version_info >= (3, 7) - ): - pytest.skip('test only runs on python < 3.7') - if item.get_closest_marker('skip_py36') is not None and ( - sys.version_info[:2] == (3, 6) - ): - pytest.skip('test is skipped on python 3.6') if item.get_closest_marker('skip_windows') is not None and (os.name == 'nt'): pytest.skip('test does not run on windows') From ad6cf4fb3d026a1cd6746328f126ce672f095589 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Fri, 20 Oct 2023 09:47:55 +0200 Subject: [PATCH 4/7] remove some more 3.7 leftovers --- Makefile | 4 ++-- pyproject.toml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index fe5f4932..e518d942 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ venv_dir := $(get_venv_dir)/pipenv_venv venv_file := $(CURDIR)/.test_venv get_venv_path =$(file < $(venv_file)) # This is how we will build tag-specific wheels, e.g. py36 or py37 -PY_VERSIONS:= 3.7 3.8 3.9 3.10 3.11 +PY_VERSIONS:= 3.8 3.9 3.10 3.11 BACKSLASH = '\\' # This is how we will build generic wheels, e.g. py2 or py3 INSTALL_TARGETS := $(addprefix install-py,$(PY_VERSIONS)) @@ -96,7 +96,7 @@ retest: virtualenv submodules test-install .PHONY: build build: install-virtualenvs.stamp install.stamp - PIPENV_PYTHON=3.7 pipenv run python -m build + PIPENV_PYTHON=3.8 pipenv run python -m build .PHONY: update-version update-version: diff --git a/pyproject.toml b/pyproject.toml index f6cf6240..23e8c3d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,12 +12,11 @@ license = {file = "LICENSE"} authors = [ {name = "Pipenv maintainer team", email = "distutils-sig@python.org"}, ] -requires-python = ">=3.7" +requires-python = ">=3.8" classifiers=[ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", From 578d3db7102b3aca4b50def06b40e33adf36b829 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Fri, 20 Oct 2023 09:48:23 +0200 Subject: [PATCH 5/7] even more cleaning --- tests/integration/conftest.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 3a4c88f2..d3857561 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -94,22 +94,11 @@ WE_HAVE_HG = check_for_mercurial() def pytest_runtest_setup(item): if item.get_closest_marker('needs_internet') is not None and not WE_HAVE_INTERNET: pytest.skip('requires internet') - if item.get_closest_marker('needs_github_ssh') is not None and not WE_HAVE_GITHUB_SSH_KEYS: - pytest.skip('requires github ssh') - if item.get_closest_marker('needs_hg') is not None and not WE_HAVE_HG: - pytest.skip('requires mercurial') - if item.get_closest_marker('skip_py38') is not None and ( - sys.version_info[:2] == (3, 8) - ): - pytest.skip('test not applicable on python 3.8') - if item.get_closest_marker('skip_osx') is not None and sys.platform == 'darwin': - pytest.skip('test does not apply on OSX') if item.get_closest_marker('skip_windows') is not None and (os.name == 'nt'): pytest.skip('test does not run on windows') WE_HAVE_INTERNET = check_internet() -WE_HAVE_GITHUB_SSH_KEYS = False class _Pipfile: From 4e3a77d9d542a7b8be99573869bed9ca1f1f17c3 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Fri, 20 Oct 2023 10:23:41 +0200 Subject: [PATCH 6/7] Revert "even more cleaning" This reverts commit 578d3db7102b3aca4b50def06b40e33adf36b829. --- tests/integration/conftest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index d3857561..3a4c88f2 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -94,11 +94,22 @@ WE_HAVE_HG = check_for_mercurial() def pytest_runtest_setup(item): if item.get_closest_marker('needs_internet') is not None and not WE_HAVE_INTERNET: pytest.skip('requires internet') + if item.get_closest_marker('needs_github_ssh') is not None and not WE_HAVE_GITHUB_SSH_KEYS: + pytest.skip('requires github ssh') + if item.get_closest_marker('needs_hg') is not None and not WE_HAVE_HG: + pytest.skip('requires mercurial') + if item.get_closest_marker('skip_py38') is not None and ( + sys.version_info[:2] == (3, 8) + ): + pytest.skip('test not applicable on python 3.8') + if item.get_closest_marker('skip_osx') is not None and sys.platform == 'darwin': + pytest.skip('test does not apply on OSX') if item.get_closest_marker('skip_windows') is not None and (os.name == 'nt'): pytest.skip('test does not run on windows') WE_HAVE_INTERNET = check_internet() +WE_HAVE_GITHUB_SSH_KEYS = False class _Pipfile: From 0f5ad4919f90ccddb2e41af73e14a2febe9dae31 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Fri, 20 Oct 2023 10:22:40 +0200 Subject: [PATCH 7/7] add news fragments --- news/5879.removal.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/5879.removal.rst diff --git a/news/5879.removal.rst b/news/5879.removal.rst new file mode 100644 index 00000000..f325c670 --- /dev/null +++ b/news/5879.removal.rst @@ -0,0 +1 @@ +Drop support for Python 3.7