From 6e444381f3952f831aeec44e7828326225731218 Mon Sep 17 00:00:00 2001 From: Nash Kaminski Date: Fri, 18 Oct 2024 16:13:11 -0500 Subject: [PATCH 1/2] Increase min Python version requirement to 3.7+ and fix py37 compatibility regression in commit 377c70d This change enables support in Python 3.7 for deferred type evaluation as well as increases the minimum Python version to 3.7. --- setup.cfg | 3 +-- src/shiv/__version__.py | 2 +- src/shiv/bootstrap/environment.py | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 3101036..b9d0f08 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,8 +50,7 @@ install_requires = click>=6.7,!=7.0 pip>=9.0.3 setuptools - importlib_resources; python_version < "3.7" -python_requires = >=3.6 +python_requires = >=3.7 include_package_data = True [options.extras_require] diff --git a/src/shiv/__version__.py b/src/shiv/__version__.py index 9e604c0..6849410 100644 --- a/src/shiv/__version__.py +++ b/src/shiv/__version__.py @@ -1 +1 @@ -__version__ = "1.0.7" +__version__ = "1.1.0" diff --git a/src/shiv/bootstrap/environment.py b/src/shiv/bootstrap/environment.py index 75625b7..11c512b 100644 --- a/src/shiv/bootstrap/environment.py +++ b/src/shiv/bootstrap/environment.py @@ -2,6 +2,7 @@ This module contains the ``Environment`` object, which combines settings decided at build time with overrides defined at runtime (via environment variables). """ +from __future__ import annotations import json import os from typing import Any, Optional From 57e2345f7976e8447f4eeab61e62e513c75eeaf2 Mon Sep 17 00:00:00 2001 From: Nash Kaminski Date: Fri, 18 Oct 2024 16:30:58 -0500 Subject: [PATCH 2/2] Backport type hint for Dict type in environment.py as well --- src/shiv/bootstrap/environment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shiv/bootstrap/environment.py b/src/shiv/bootstrap/environment.py index 11c512b..fdc80ec 100644 --- a/src/shiv/bootstrap/environment.py +++ b/src/shiv/bootstrap/environment.py @@ -5,7 +5,7 @@ from __future__ import annotations import json import os -from typing import Any, Optional +from typing import Any, Dict, Optional def str_bool(v) -> bool: @@ -36,7 +36,7 @@ def __init__( entry_point: Optional[str] = None, extend_pythonpath: bool = False, prepend_pythonpath: Optional[str] = None, - hashes: Optional[dict[str, Any]] = None, + hashes: Optional[Dict[str, Any]] = None, no_modify: bool = False, reproducible: bool = False, script: Optional[str] = None, @@ -47,7 +47,7 @@ def __init__( self.always_write_cache: bool = always_write_cache self.build_id: Optional[str] = build_id self.built_at: str = built_at - self.hashes: Optional[dict[str, Any]] = hashes or {} + self.hashes: Optional[Dict[str, Any]] = hashes or {} self.no_modify: bool = no_modify self.reproducible: bool = reproducible self.preamble: Optional[str] = preamble