From a397c386fb981f71b0cdf6941aac33744f690d1c Mon Sep 17 00:00:00 2001 From: Oz Tiram Date: Thu, 12 Sep 2024 09:16:24 +0200 Subject: [PATCH] Remove import of cached_property from pip And also remove hack to make it available for python3.7. Pipenv does not support py37 for quite a while now. --- pipenv/resolver.py | 6 +----- pipenv/utils/resolver.py | 9 +-------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pipenv/resolver.py b/pipenv/resolver.py index ef4e11b302..abf9074d9b 100644 --- a/pipenv/resolver.py +++ b/pipenv/resolver.py @@ -3,11 +3,7 @@ import logging import os import sys - -try: - from functools import cached_property -except ImportError: - cached_property = property +from functools import cached_property def _ensure_modules(): diff --git a/pipenv/utils/resolver.py b/pipenv/utils/resolver.py index f04f27004e..effadef88a 100644 --- a/pipenv/utils/resolver.py +++ b/pipenv/utils/resolver.py @@ -5,7 +5,7 @@ import sys import tempfile import warnings -from functools import lru_cache +from functools import cached_property, lru_cache from pathlib import Path from typing import Dict, List, Optional @@ -31,13 +31,6 @@ from pipenv.utils.requirements import normalize_name from pipenv.vendor import click -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 - from .dependencies import ( HackedPythonVersion, convert_deps_to_pip,