From 75f8c1fc1dd8a8dfcc5dfcff0399772aed3952ed Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 27 Mar 2026 22:46:57 +0000 Subject: [PATCH 1/4] python3Packages.hatch: init at 1.16.2 --- pkgs/by-name/ha/hatch/package.nix | 212 +-------------- .../python-modules/hatch/default.nix | 242 ++++++++++++++++++ .../python-modules}/hatch/paths.patch | 0 pkgs/top-level/python-packages.nix | 2 + 4 files changed, 245 insertions(+), 211 deletions(-) create mode 100644 pkgs/development/python-modules/hatch/default.nix rename pkgs/{by-name/ha => development/python-modules}/hatch/paths.patch (100%) diff --git a/pkgs/by-name/ha/hatch/package.nix b/pkgs/by-name/ha/hatch/package.nix index 02e045bf6beb..9edc4e4b0c82 100644 --- a/pkgs/by-name/ha/hatch/package.nix +++ b/pkgs/by-name/ha/hatch/package.nix @@ -1,211 +1 @@ -{ - lib, - stdenv, - python3Packages, - fetchFromGitHub, - replaceVars, - git, - cargo, - versionCheckHook, - writableTmpDirAsHomeHook, - darwin, - nix-update-script, -}: - -python3Packages.buildPythonApplication (finalAttrs: { - pname = "hatch"; - version = "1.16.2"; - pyproject = true; - - src = fetchFromGitHub { - owner = "pypa"; - repo = "hatch"; - tag = "hatch-v${finalAttrs.version}"; - hash = "sha256-A91tpoNBTerB2e09dmvgwealId8mnjxcyiVyCkMxQlY="; - }; - - patches = [ (replaceVars ./paths.patch { uv = lib.getExe python3Packages.uv; }) ]; - - build-system = with python3Packages; [ - hatchling - hatch-vcs - ]; - - pythonRemoveDeps = [ "uv" ]; - - 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 - pytest-xdist - setuptools - ] - ++ [ - cargo - versionCheckHook - writableTmpDirAsHomeHook - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.ps - ]; - - disabledTests = [ - # AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0) - "test_default" - "test_editable_default" - "test_editable_default_extra_dependencies" - "test_editable_default_force_include" - "test_editable_default_force_include_option" - "test_editable_default_symlink" - "test_editable_exact" - "test_editable_exact_extra_dependencies" - "test_editable_exact_force_include" - "test_editable_exact_force_include_build_data_precedence" - "test_editable_exact_force_include_option" - "test_editable_pth" - "test_explicit_path" - - # Loosen hatchling runtime version dependency - "test_core" - # New failing - "test_guess_variant" - "test_open" - "test_no_open" - "test_uv_env" - "test_pyenv" - "test_pypirc" - # Relies on FHS - # Could not read ELF interpreter from any of the following paths: /bin/sh, /usr/bin/env, /bin/dash, /bin/ls - "test_new_selected_python" - - # https://github.com/pypa/hatch/issues/2006 - "test_project_location_basic_set_first_project" - "test_project_location_complex_set_first_project" - - # TypeError: 'int' object is not subscriptable with newer packaging - "test_begin" - "test_continue" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # This test assumes it is running on macOS with a system shell on the PATH. - # It is not possible to run it in a nix build using a /nix/store shell. - # See https://github.com/pypa/hatch/pull/709 for the relevant code. - "test_populate_default_popen_kwargs_executable" - - # Those tests fail because the final wheel is named '...2-macosx_11_0_arm64.whl' instead of - # '...2-macosx_14_0_arm64.whl' - "test_macos_archflags" - "test_macos_max_compat" - - # https://github.com/pypa/hatch/issues/1942 - "test_features" - "test_sync_dynamic_dependencies" - ] - ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "test_resolve" ]; - - disabledTestPaths = [ - # 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 - "tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_all" - "tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_license_expression" - "tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_all" - "tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_license_expression" - "tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_all" - "tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_expression" - "tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_files" - "tests/backend/metadata/test_spec.py::TestProjectMetadataFromCoreMetadata::test_license_files" - - # Table title centering changed in newer Rich - "tests/cli/dep/show/test_table.py" - "tests/cli/env/test_show.py" - "tests/cli/python/test_show.py" - - # Version scheme failures with newer packaging - "tests/backend/version/scheme/test_standard.py::TestWithEpoch::test_correct[minor,dev-1!0.1.0.dev0]" - "tests/backend/version/scheme/test_standard.py::TestMultiple::test_correct[minor,dev-0.1.0.dev0]" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # AssertionError: assert [call('test h...2p32/bin/sh')] == [call('test h..., shell=True)] - # At index 0 diff: - # call('test hatch-test.py3.10', shell=True, executable='/nix/store/b34ianga4diikh0kymkpqwmvba0mmzf7-bash-5.2p32/bin/sh') - # != call('test hatch-test.py3.10', shell=True) - "tests/cli/fmt/test_fmt.py" - "tests/cli/test/test_test.py" - - # Dependency/versioning errors in the CLI tests, only seem to show up on Darwin - # https://github.com/pypa/hatch/issues/1893 - "tests/cli/env/test_create.py::test_sync_dependencies_pip" - "tests/cli/env/test_create.py::test_sync_dependencies_uv" - "tests/cli/project/test_metadata.py::TestBuildDependenciesMissing::test_no_compatibility_check_if_exists" - "tests/cli/run/test_run.py::TestScriptRunner::test_dependencies" - "tests/cli/run/test_run.py::TestScriptRunner::test_dependencies_from_tool_config" - "tests/cli/run/test_run.py::test_dependency_hash_checking" - "tests/cli/run/test_run.py::test_sync_dependencies" - "tests/cli/run/test_run.py::test_sync_project_dependencies" - "tests/cli/run/test_run.py::test_sync_project_features" - "tests/cli/version/test_version.py::test_no_compatibility_check_if_exists" - ]; - - passthru = { - updateScript = nix-update-script { - extraArgs = [ - "--version-regex" - "hatch-v([0-9.]+)" - ]; - }; - }; - - meta = { - description = "Modern, extensible Python project manager"; - homepage = "https://hatch.pypa.io/latest/"; - changelog = "https://github.com/pypa/hatch/blob/hatch-v${finalAttrs.version}/docs/history/hatch.md"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ onny ]; - mainProgram = "hatch"; - }; -}) +{ python3Packages }: with python3Packages; toPythonApplication hatch diff --git a/pkgs/development/python-modules/hatch/default.nix b/pkgs/development/python-modules/hatch/default.nix new file mode 100644 index 000000000000..21c71e08c5f8 --- /dev/null +++ b/pkgs/development/python-modules/hatch/default.nix @@ -0,0 +1,242 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + replaceVars, + uv, + + # build-system, + hatch-vcs, + hatchling, + + # dependencies + click, + httpx, + hyperlink, + keyring, + packaging, + pexpect, + platformdirs, + pyproject-hooks, + rich, + shellingham, + tomli-w, + tomlkit, + userpath, + virtualenv, + # python<3.14 only + pythonOlder, + backports-zstd, + + # tests + binary, + cargo, + flit-core, + gitMinimal, + pytest-mock, + pytest-xdist, + pytestCheckHook, + setuptools, + versionCheckHook, + writableTmpDirAsHomeHook, + + darwin, + nix-update-script, +}: + +buildPythonPackage (finalAttrs: { + pname = "hatch"; + version = "1.16.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pypa"; + repo = "hatch"; + tag = "hatch-v${finalAttrs.version}"; + hash = "sha256-A91tpoNBTerB2e09dmvgwealId8mnjxcyiVyCkMxQlY="; + }; + + patches = [ + (replaceVars ./paths.patch { + uv = lib.getExe uv; + }) + ]; + + build-system = [ + hatchling + hatch-vcs + ]; + + pythonRemoveDeps = [ "uv" ]; + + dependencies = [ + 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 = [ + binary + flit-core + pytest-mock + pytest-xdist + pytestCheckHook + setuptools + cargo + gitMinimal + versionCheckHook + writableTmpDirAsHomeHook + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + darwin.ps + ]; + + disabledTests = [ + # AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0) + "test_default" + "test_editable_default" + "test_editable_default_extra_dependencies" + "test_editable_default_force_include" + "test_editable_default_force_include_option" + "test_editable_default_symlink" + "test_editable_exact" + "test_editable_exact_extra_dependencies" + "test_editable_exact_force_include" + "test_editable_exact_force_include_build_data_precedence" + "test_editable_exact_force_include_option" + "test_editable_pth" + "test_explicit_path" + + # Loosen hatchling runtime version dependency + "test_core" + # New failing + "test_guess_variant" + "test_open" + "test_no_open" + "test_uv_env" + "test_pyenv" + "test_pypirc" + # Relies on FHS + # Could not read ELF interpreter from any of the following paths: /bin/sh, /usr/bin/env, /bin/dash, /bin/ls + "test_new_selected_python" + + # https://github.com/pypa/hatch/issues/2006 + "test_project_location_basic_set_first_project" + "test_project_location_complex_set_first_project" + + # TypeError: 'int' object is not subscriptable with newer packaging + "test_begin" + "test_continue" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # This test assumes it is running on macOS with a system shell on the PATH. + # It is not possible to run it in a nix build using a /nix/store shell. + # See https://github.com/pypa/hatch/pull/709 for the relevant code. + "test_populate_default_popen_kwargs_executable" + + # Those tests fail because the final wheel is named '...2-macosx_11_0_arm64.whl' instead of + # '...2-macosx_14_0_arm64.whl' + "test_macos_archflags" + "test_macos_max_compat" + + # https://github.com/pypa/hatch/issues/1942 + "test_features" + "test_sync_dynamic_dependencies" + ] + ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "test_resolve" ]; + + disabledTestPaths = [ + # 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 + "tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_all" + "tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_license_expression" + "tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_all" + "tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_license_expression" + "tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_all" + "tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_expression" + "tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_files" + "tests/backend/metadata/test_spec.py::TestProjectMetadataFromCoreMetadata::test_license_files" + + # Table title centering changed in newer Rich + "tests/cli/dep/show/test_table.py" + "tests/cli/env/test_show.py" + "tests/cli/python/test_show.py" + + # Version scheme failures with newer packaging + "tests/backend/version/scheme/test_standard.py::TestWithEpoch::test_correct[minor,dev-1!0.1.0.dev0]" + "tests/backend/version/scheme/test_standard.py::TestMultiple::test_correct[minor,dev-0.1.0.dev0]" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # AssertionError: assert [call('test h...2p32/bin/sh')] == [call('test h..., shell=True)] + # At index 0 diff: + # call('test hatch-test.py3.10', shell=True, executable='/nix/store/b34ianga4diikh0kymkpqwmvba0mmzf7-bash-5.2p32/bin/sh') + # != call('test hatch-test.py3.10', shell=True) + "tests/cli/fmt/test_fmt.py" + "tests/cli/test/test_test.py" + + # Dependency/versioning errors in the CLI tests, only seem to show up on Darwin + # https://github.com/pypa/hatch/issues/1893 + "tests/cli/env/test_create.py::test_sync_dependencies_pip" + "tests/cli/env/test_create.py::test_sync_dependencies_uv" + "tests/cli/project/test_metadata.py::TestBuildDependenciesMissing::test_no_compatibility_check_if_exists" + "tests/cli/run/test_run.py::TestScriptRunner::test_dependencies" + "tests/cli/run/test_run.py::TestScriptRunner::test_dependencies_from_tool_config" + "tests/cli/run/test_run.py::test_dependency_hash_checking" + "tests/cli/run/test_run.py::test_sync_dependencies" + "tests/cli/run/test_run.py::test_sync_project_dependencies" + "tests/cli/run/test_run.py::test_sync_project_features" + "tests/cli/version/test_version.py::test_no_compatibility_check_if_exists" + ]; + + passthru = { + updateScript = nix-update-script { + extraArgs = [ + "--version-regex" + "hatch-v([0-9.]+)" + ]; + }; + }; + + meta = { + description = "Modern, extensible Python project manager"; + homepage = "https://hatch.pypa.io/latest/"; + changelog = "https://github.com/pypa/hatch/blob/hatch-v${finalAttrs.version}/docs/history/hatch.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ onny ]; + mainProgram = "hatch"; + }; +}) diff --git a/pkgs/by-name/ha/hatch/paths.patch b/pkgs/development/python-modules/hatch/paths.patch similarity index 100% rename from pkgs/by-name/ha/hatch/paths.patch rename to pkgs/development/python-modules/hatch/paths.patch diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c100206eae07..884d8c9c8a35 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6900,6 +6900,8 @@ self: super: with self; { hatasmota = callPackage ../development/python-modules/hatasmota { }; + hatch = callPackage ../development/python-modules/hatch/default.nix { }; + hatch-autorun = callPackage ../development/python-modules/hatch-autorun { }; hatch-babel = callPackage ../development/python-modules/hatch-babel { }; From 7025ade3e9d3ce10aa272df4a977a9135aba238e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 27 Mar 2026 22:47:13 +0000 Subject: [PATCH 2/4] python3Packages.ipycanvas: cleanup --- .../python-modules/ipycanvas/default.nix | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/ipycanvas/default.nix b/pkgs/development/python-modules/ipycanvas/default.nix index fa05db7ed6ee..934536132fe0 100644 --- a/pkgs/development/python-modules/ipycanvas/default.nix +++ b/pkgs/development/python-modules/ipycanvas/default.nix @@ -1,38 +1,44 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + + # build-system hatch, hatch-build-scripts, hatch-nodejs-version, + hatchling, + jupyterlab, + + # dependencies ipywidgets, numpy, pillow, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "ipycanvas"; version = "0.14.3"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-xqU6Iu6/TWEbFouPRDQUWIPyenV1UJvZmkv8SMU4Wjk="; + src = fetchFromGitHub { + owner = "jupyter-widgets-contrib"; + repo = "ipycanvas"; + tag = "v${finalAttrs.version}"; + hash = "sha256-VvNCe3+zK3qSuYErO4H2UlfAClvfDmisExWHx48cjUo="; }; - # We relax dependencies here instead of pulling in a patch because upstream - # has released a new version using hatch-jupyter-builder, but it is not yet - # trivial to upgrade to that. - # + # _version.py is supposed to be generated by a script postPatch = '' - substituteInPlace pyproject.toml \ - --replace-fail '"jupyterlab>=3,<5",' "" \ + echo '__version__ = "{${finalAttrs.version}}"' > ipycanvas/_version.py ''; build-system = [ hatch hatch-build-scripts hatch-nodejs-version + hatchling + jupyterlab ]; env.HATCH_BUILD_NO_HOOKS = true; @@ -49,8 +55,8 @@ buildPythonPackage rec { meta = { description = "Expose the browser's Canvas API to IPython"; homepage = "https://ipycanvas.readthedocs.io"; - changelog = "https://github.com/jupyter-widgets-contrib/ipycanvas/releases/tag/${version}"; + changelog = "https://github.com/jupyter-widgets-contrib/ipycanvas/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.bsd3; maintainers = with lib.maintainers; [ bcdarwin ]; }; -} +}) From 826a7e1a56a68662913e3b7e9199fd18177b591f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 27 Mar 2026 23:00:11 +0000 Subject: [PATCH 3/4] python3Packages.python-discovery: init at 1.2.0 --- .../python-discovery/default.nix | 55 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/development/python-modules/python-discovery/default.nix diff --git a/pkgs/development/python-modules/python-discovery/default.nix b/pkgs/development/python-modules/python-discovery/default.nix new file mode 100644 index 000000000000..8067e62c2cd7 --- /dev/null +++ b/pkgs/development/python-modules/python-discovery/default.nix @@ -0,0 +1,55 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + hatch-vcs, + hatchling, + + # dependencies + filelock, + platformdirs, + + # tests + pytest-mock, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "python-discovery"; + version = "1.2.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "tox-dev"; + repo = "python-discovery"; + tag = finalAttrs.version; + hash = "sha256-gkyrI1nsuaFN1Njf8Faifei4qz4Cdy/YWZf8Nd0WrwY="; + }; + + build-system = [ + hatch-vcs + hatchling + ]; + + dependencies = [ + filelock + platformdirs + ]; + + pythonImportsCheck = [ "python_discovery" ]; + + nativeCheckInputs = [ + pytest-mock + pytestCheckHook + ]; + + meta = { + description = "Python interpreter discovery"; + changelog = "https://github.com/tox-dev/python-discovery/releases/tag/${finalAttrs.src.tag}"; + homepage = "https://github.com/tox-dev/python-discovery"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 884d8c9c8a35..f8ea27bd5b09 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15584,6 +15584,8 @@ self: super: with self; { python-digitalocean = callPackage ../development/python-modules/python-digitalocean { }; + python-discovery = callPackage ../development/python-modules/python-discovery { }; + python-djvulibre = callPackage ../development/python-modules/python-djvulibre { }; python-docs-theme = callPackage ../development/python-modules/python-docs-theme { }; From f6c34ae02b687e5f3a06c09dcf27b3fb5580dde5 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 27 Mar 2026 22:47:59 +0000 Subject: [PATCH 4/4] python3Packages.hatch: 1.16.2 -> 1.16.5 Changelog: https://github.com/pypa/hatch/blob/hatch-v1.16.5/docs/history/hatch.md --- .../python-modules/hatch/default.nix | 25 ++++++++++++++----- .../{paths.patch => inject-uv-path.patch} | 15 ++++++----- 2 files changed, 28 insertions(+), 12 deletions(-) rename pkgs/development/python-modules/hatch/{paths.patch => inject-uv-path.patch} (83%) diff --git a/pkgs/development/python-modules/hatch/default.nix b/pkgs/development/python-modules/hatch/default.nix index 21c71e08c5f8..909df93a064a 100644 --- a/pkgs/development/python-modules/hatch/default.nix +++ b/pkgs/development/python-modules/hatch/default.nix @@ -19,6 +19,7 @@ pexpect, platformdirs, pyproject-hooks, + python-discovery, rich, shellingham, tomli-w, @@ -47,18 +48,18 @@ buildPythonPackage (finalAttrs: { pname = "hatch"; - version = "1.16.2"; + version = "1.16.5"; pyproject = true; src = fetchFromGitHub { owner = "pypa"; repo = "hatch"; tag = "hatch-v${finalAttrs.version}"; - hash = "sha256-A91tpoNBTerB2e09dmvgwealId8mnjxcyiVyCkMxQlY="; + hash = "sha256-pUlRy8ar0zXsGGSA1VTZyPiU4LruYp/maU2C5T4E5WI="; }; patches = [ - (replaceVars ./paths.patch { + (replaceVars ./inject-uv-path.patch { uv = lib.getExe uv; }) ]; @@ -68,8 +69,12 @@ buildPythonPackage (finalAttrs: { hatch-vcs ]; - pythonRemoveDeps = [ "uv" ]; - + pythonRemoveDeps = [ + "uv" + ]; + pythonRelaxDeps = [ + "virtualenv" + ]; dependencies = [ click hatchling @@ -80,6 +85,7 @@ buildPythonPackage (finalAttrs: { pexpect platformdirs pyproject-hooks + python-discovery rich shellingham tomli-w @@ -108,6 +114,13 @@ buildPythonPackage (finalAttrs: { ]; disabledTests = [ + # AssertionError: assert ['dep2', 'pro...u7kv', 'dep1'] == ['dep2', 'pro...u7kv', 'dep1'] + # At index 1 diff: 'proj@ file:///build/tmp5snbu7kv' != 'proj @ file:///build/tmp5snbu7kv' + "test_all" + "test_context_formatting" + "test_dependencies" + "test_project_dependencies_context_formatting" + # AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0) "test_default" "test_editable_default" @@ -234,7 +247,7 @@ buildPythonPackage (finalAttrs: { meta = { description = "Modern, extensible Python project manager"; homepage = "https://hatch.pypa.io/latest/"; - changelog = "https://github.com/pypa/hatch/blob/hatch-v${finalAttrs.version}/docs/history/hatch.md"; + changelog = "https://github.com/pypa/hatch/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ onny ]; mainProgram = "hatch"; diff --git a/pkgs/development/python-modules/hatch/paths.patch b/pkgs/development/python-modules/hatch/inject-uv-path.patch similarity index 83% rename from pkgs/development/python-modules/hatch/paths.patch rename to pkgs/development/python-modules/hatch/inject-uv-path.patch index 51845d3406cb..78cd38b5fece 100644 --- a/pkgs/development/python-modules/hatch/paths.patch +++ b/pkgs/development/python-modules/hatch/inject-uv-path.patch @@ -1,11 +1,14 @@ diff --git a/src/hatch/env/virtual.py b/src/hatch/env/virtual.py -index 72605e58..546b6ad1 100644 +index 7a9b7e65..38f69fb7 100644 --- a/src/hatch/env/virtual.py +++ b/src/hatch/env/virtual.py -@@ -108,26 +108,7 @@ class VirtualEnvironment(EnvironmentInterface): - if self.explicit_uv_path: - return self.explicit_uv_path +@@ -108,29 +108,7 @@ class VirtualEnvironment(EnvironmentInterface): + @cached_property + def uv_path(self) -> str: +- if self.explicit_uv_path: +- return self.explicit_uv_path +- - from hatch.env.internal import is_default_environment - - env_name = "hatch-uv" @@ -16,7 +19,7 @@ index 72605e58..546b6ad1 100644 - or is_default_environment(env_name, self.app.project.config.internal_envs[env_name]) - ): - uv_env = self.app.project.get_environment(env_name) -- self.app.project.prepare_environment(uv_env) +- self.app.project.prepare_environment(uv_env, keep_env=bool(os.environ.get(AppEnvVars.KEEP_ENV))) - with uv_env: - return self.platform.modules.shutil.which("uv") - @@ -44,7 +47,7 @@ index d8c6379e..874f8936 100644 command.append("--system-site-packages") diff --git a/tests/conftest.py b/tests/conftest.py -index 44681a10..d7e91d36 100644 +index b47e90e8..542035d9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -205,7 +205,7 @@ def python_on_path():