10 writableTmpDirAsHomeHook,
15 python3Packages.buildPythonApplication rec {
20 src = fetchFromGitHub {
23 tag = "hatch-v${version}";
24 hash = "sha256-JwFPNoFoNqAXkLCGhliLN98VAS+VCwRzo+JqWLIrxsw=";
27 patches = [ (replaceVars ./paths.patch { uv = lib.getExe python3Packages.uv; }) ];
29 build-system = with python3Packages; [
34 pythonRemoveDeps = [ "uv" ];
36 dependencies = with python3Packages; [
67 writableTmpDirAsHomeHook
69 ++ lib.optionals stdenv.hostPlatform.isDarwin [
73 versionCheckProgramArg = [ "--version" ];
77 # AssertionError on the version metadata
78 # https://github.com/pypa/hatch/issues/1877
79 "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_all"
80 "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_license_expression"
81 "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_all"
82 "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_license_expression"
83 "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_all"
84 "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_expression"
85 "--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_files"
86 "--deselect=tests/backend/metadata/test_spec.py::TestProjectMetadataFromCoreMetadata::test_license_files"
88 ++ lib.optionals stdenv.hostPlatform.isDarwin [
89 # Dependency/versioning errors in the CLI tests, only seem to show up on Darwin
90 # https://github.com/pypa/hatch/issues/1893
91 "--deselect=tests/cli/env/test_create.py::test_sync_dependencies_pip"
92 "--deselect=tests/cli/env/test_create.py::test_sync_dependencies_uv"
93 "--deselect=tests/cli/project/test_metadata.py::TestBuildDependenciesMissing::test_no_compatibility_check_if_exists"
94 "--deselect=tests/cli/run/test_run.py::TestScriptRunner::test_dependencies"
95 "--deselect=tests/cli/run/test_run.py::TestScriptRunner::test_dependencies_from_tool_config"
96 "--deselect=tests/cli/run/test_run.py::test_dependency_hash_checking"
97 "--deselect=tests/cli/run/test_run.py::test_sync_dependencies"
98 "--deselect=tests/cli/run/test_run.py::test_sync_project_dependencies"
99 "--deselect=tests/cli/run/test_run.py::test_sync_project_features"
100 "--deselect=tests/cli/version/test_version.py::test_no_compatibility_check_if_exists"
105 # AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0)
107 "test_editable_default"
108 "test_editable_default_extra_dependencies"
109 "test_editable_default_force_include"
110 "test_editable_default_force_include_option"
111 "test_editable_default_symlink"
112 "test_editable_exact"
113 "test_editable_exact_extra_dependencies"
114 "test_editable_exact_force_include"
115 "test_editable_exact_force_include_build_data_precedence"
116 "test_editable_exact_force_include_option"
120 # Loosen hatchling runtime version dependency
130 # Could not read ELF interpreter from any of the following paths: /bin/sh, /usr/bin/env, /bin/dash, /bin/ls
131 "test_new_selected_python"
133 ++ lib.optionals stdenv.hostPlatform.isDarwin [
134 # This test assumes it is running on macOS with a system shell on the PATH.
135 # It is not possible to run it in a nix build using a /nix/store shell.
136 # See https://github.com/pypa/hatch/pull/709 for the relevant code.
137 "test_populate_default_popen_kwargs_executable"
139 # Those tests fail because the final wheel is named '...2-macosx_11_0_arm64.whl' instead of
140 # '...2-macosx_14_0_arm64.whl'
141 "test_macos_archflags"
142 "test_macos_max_compat"
144 ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "test_resolve" ];
148 # ModuleNotFoundError: No module named 'hatchling.licenses.parse'
149 # https://github.com/pypa/hatch/issues/1850
150 "tests/backend/licenses/test_parse.py"
151 "tests/backend/licenses/test_supported.py"
153 ++ lib.optionals stdenv.hostPlatform.isDarwin [
154 # AssertionError: assert [call('test h...2p32/bin/sh')] == [call('test h..., shell=True)]
156 # call('test hatch-test.py3.10', shell=True, executable='/nix/store/b34ianga4diikh0kymkpqwmvba0mmzf7-bash-5.2p32/bin/sh')
157 # != call('test hatch-test.py3.10', shell=True)
158 "tests/cli/fmt/test_fmt.py"
159 "tests/cli/test/test_test.py"
163 updateScript = nix-update-script {
172 description = "Modern, extensible Python project manager";
173 homepage = "https://hatch.pypa.io/latest/";
174 changelog = "https://github.com/pypa/hatch/blob/hatch-v${version}/docs/history/hatch.md";
175 license = lib.licenses.mit;
176 maintainers = with lib.maintainers; [ onny ];
177 mainProgram = "hatch";