From 4d8e1ac56ede4cb651017afb871854a555e8f210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 29 Nov 2025 13:35:54 -0800 Subject: [PATCH] hatch: 1.14.2 -> 1.16.1 Diff: https://github.com/pypa/hatch/compare/hatch-v1.14.2...hatch-v1.16.1 Changelog: https://github.com/pypa/hatch/blob/hatch-v1.16.1/docs/history/hatch.md --- pkgs/by-name/ha/hatch/package.nix | 65 ++++++++++++++++++++----------- pkgs/by-name/ha/hatch/paths.patch | 46 +++++++++++----------- 2 files changed, 65 insertions(+), 46 deletions(-) diff --git a/pkgs/by-name/ha/hatch/package.nix b/pkgs/by-name/ha/hatch/package.nix index 4b3f0c4ebbc2..fcaa9017b260 100644 --- a/pkgs/by-name/ha/hatch/package.nix +++ b/pkgs/by-name/ha/hatch/package.nix @@ -14,14 +14,14 @@ python3Packages.buildPythonApplication rec { pname = "hatch"; - version = "1.14.2"; + version = "1.16.1"; pyproject = true; src = fetchFromGitHub { owner = "pypa"; repo = "hatch"; tag = "hatch-v${version}"; - hash = "sha256-LrfPDgpb9AQsaiYVb2MNdOfoIBbStZMKmESCbVhfn+s="; + hash = "sha256-HreVb+RZzQV3p9TaoHDZLHBQFifyH+hocP01u5yU+ms="; }; patches = [ (replaceVars ./paths.patch { uv = lib.getExe python3Packages.uv; }) ]; @@ -33,28 +33,34 @@ python3Packages.buildPythonApplication rec { pythonRemoveDeps = [ "uv" ]; - dependencies = with python3Packages; [ - click - hatchling - httpx - hyperlink - keyring - packaging - pexpect - platformdirs - rich - shellingham - tomli-w - tomlkit - userpath - virtualenv - zstandard - ]; + dependencies = + with python3Packages; + [ + click + hatchling + httpx + hyperlink + keyring + packaging + pexpect + platformdirs + pyproject-hooks + rich + shellingham + tomli-w + tomlkit + userpath + virtualenv + ] + ++ lib.optionals (pythonOlder "3.14") [ + backports-zstd + ]; nativeCheckInputs = with python3Packages; [ binary + flit-core git pytestCheckHook pytest-mock @@ -123,10 +129,23 @@ python3Packages.buildPythonApplication rec { ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "test_resolve" ]; disabledTestPaths = [ - # ModuleNotFoundError: No module named 'hatchling.licenses.parse' - # https://github.com/pypa/hatch/issues/1850 - "tests/backend/licenses/test_parse.py" - "tests/backend/licenses/test_supported.py" + # httpx.ConnectError: [Errno -3] Temporary failure in name resolution + "tests/workspaces/test_config.py" + + # additional comment `-*- coding: utf-8 -*-` in output + "tests/backend/builders/test_sdist.py" + + # missing output `Syncing dependencies` + "tests/cli/build/test_build.py" + "tests/cli/project/test_metadata.py" + "tests/cli/version/test_version.py" + + # AttributeError: 'WheelBuilderConfig' object has no attribute 'sbom_files' + "tests/backend/builders/test_wheel.py::TestSBOMFiles" + + # some issue with the version of `binary` + "tests/dep/test_sync.py::test_dependency_not_found" + "tests/dep/test_sync.py::test_marker_unmet" # AssertionError on the version metadata # https://github.com/pypa/hatch/issues/1877 diff --git a/pkgs/by-name/ha/hatch/paths.patch b/pkgs/by-name/ha/hatch/paths.patch index 60aeec4e4971..51845d3406cb 100644 --- a/pkgs/by-name/ha/hatch/paths.patch +++ b/pkgs/by-name/ha/hatch/paths.patch @@ -1,58 +1,58 @@ diff --git a/src/hatch/env/virtual.py b/src/hatch/env/virtual.py -index 285edb32..90bd94e6 100644 +index 72605e58..546b6ad1 100644 --- a/src/hatch/env/virtual.py +++ b/src/hatch/env/virtual.py -@@ -106,26 +106,7 @@ class VirtualEnvironment(EnvironmentInterface): +@@ -108,26 +108,7 @@ class VirtualEnvironment(EnvironmentInterface): if self.explicit_uv_path: return self.explicit_uv_path - from hatch.env.internal import is_default_environment - -- env_name = 'hatch-uv' +- env_name = "hatch-uv" - if not ( - # Prevent recursive loop - self.name == env_name - # Only if dependencies have been set by the user - or is_default_environment(env_name, self.app.project.config.internal_envs[env_name]) - ): -- uv_env = self.app.get_environment(env_name) -- self.app.prepare_environment(uv_env) +- uv_env = self.app.project.get_environment(env_name) +- self.app.project.prepare_environment(uv_env) - with uv_env: -- return self.platform.modules.shutil.which('uv') +- return self.platform.modules.shutil.which("uv") - - import sysconfig - -- scripts_dir = sysconfig.get_path('scripts') -- old_path = os.environ.get('PATH', os.defpath) -- new_path = f'{scripts_dir}{os.pathsep}{old_path}' -- return self.platform.modules.shutil.which('uv', path=new_path) -+ return '@uv@' +- scripts_dir = sysconfig.get_path("scripts") +- old_path = os.environ.get("PATH", os.defpath) +- new_path = f"{scripts_dir}{os.pathsep}{old_path}" +- return self.platform.modules.shutil.which("uv", path=new_path) ++ return "@uv@" - @staticmethod - def get_option_types() -> dict: + @cached_property + def distributions(self) -> InstalledDistributions: diff --git a/src/hatch/venv/core.py b/src/hatch/venv/core.py -index d1303f03..e1e60871 100644 +index d8c6379e..874f8936 100644 --- a/src/hatch/venv/core.py +++ b/src/hatch/venv/core.py @@ -131,7 +131,7 @@ class TempVirtualEnv(VirtualEnv): class UVVirtualEnv(VirtualEnv): def create(self, python, *, allow_system_packages=False): -- command = [os.environ.get('HATCH_UV', 'uv'), 'venv', str(self.directory), '--python', python] -+ command = [os.environ.get('HATCH_UV', '@uv@'), 'venv', str(self.directory), '--python', python] +- command = [os.environ.get("HATCH_UV", "uv"), "venv", str(self.directory), "--python", python] ++ command = [os.environ.get("HATCH_UV", "@uv@"), "venv", str(self.directory), "--python", python] if allow_system_packages: - command.append('--system-site-packages') + command.append("--system-site-packages") diff --git a/tests/conftest.py b/tests/conftest.py -index e8fe663a..6066316d 100644 +index 44681a10..d7e91d36 100644 --- a/tests/conftest.py +++ b/tests/conftest.py -@@ -203,7 +203,7 @@ def python_on_path(): +@@ -205,7 +205,7 @@ def python_on_path(): - @pytest.fixture(scope='session', autouse=True) + @pytest.fixture(scope="session", autouse=True) def uv_on_path(): -- return shutil.which('uv') -+ return '@uv@' +- return shutil.which("uv") ++ return "@uv@" - @pytest.fixture(scope='session') + @pytest.fixture(scope="session")