diff --git a/Dockerfile b/Dockerfile index 294767be..36347898 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ COPY requirements.txt WebHostLib/requirements.txt RUN pip install --no-cache-dir -r \ WebHostLib/requirements.txt \ - "setuptools<81" + "setuptools>=75,<81" COPY _speedups.pyx . COPY intset.h . diff --git a/ModuleUpdate.py b/ModuleUpdate.py index 46064d3f..db42f8e5 100644 --- a/ModuleUpdate.py +++ b/ModuleUpdate.py @@ -74,11 +74,11 @@ def update_command(): def install_pkg_resources(yes=False): try: import pkg_resources # noqa: F401 - except ImportError: + except (AttributeError, ImportError): check_pip() if not yes: confirm("pkg_resources not found, press enter to install it") - subprocess.call([sys.executable, "-m", "pip", "install", "--upgrade", "setuptools<81"]) + subprocess.call([sys.executable, "-m", "pip", "install", "--upgrade", "setuptools>=75,<81"]) def update(yes: bool = False, force: bool = False) -> None: diff --git a/setup.py b/setup.py index 1808b22c..01342e4e 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ try: install_cx_freeze = False except pkg_resources.ResolutionError: install_cx_freeze = True -except ImportError: +except (AttributeError, ImportError): install_cx_freeze = True pkg_resources = None # type: ignore[assignment]