1{ lib
2, stdenv
3, fetchPypi
4, python3
5, git
6}:
7
8python3.pkgs.buildPythonApplication rec {
9 pname = "hatch";
10 version = "1.7.0";
11 format = "pyproject";
12
13 src = fetchPypi {
14 inherit pname version;
15 hash = "sha256-evxwH9WzNoSmZQ4eyriVfhloX4JCQLp0WNys1m+Q+0Y=";
16 };
17
18 propagatedBuildInputs = with python3.pkgs; [
19 click
20 hatchling
21 httpx
22 hyperlink
23 keyring
24 packaging
25 pexpect
26 platformdirs
27 pyperclip
28 rich
29 shellingham
30 tomli-w
31 tomlkit
32 userpath
33 virtualenv
34 ];
35
36 nativeCheckInputs = with python3.pkgs; [
37 git
38 pytestCheckHook
39 pytest-mock
40 pytest-xdist
41 ];
42
43 preCheck = ''
44 export HOME=$(mktemp -d);
45 '';
46
47 disabledTests = [
48 # AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0)
49 "test_default"
50 "test_explicit_path"
51 "test_default_auto_detection"
52 "test_editable_default"
53 "test_editable_default_extra_dependencies"
54 "test_editable_default_force_include"
55 "test_editable_default_force_include_option"
56 "test_editable_exact"
57 "test_editable_exact_extra_dependencies"
58 "test_editable_exact_force_include"
59 "test_editable_exact_force_include_option"
60 "test_editable_exact_force_include_build_data_precedence"
61 "test_editable_pth"
62 # AssertionError: assert len(extract_installed_requirements(output.splitlines())) > 0
63 "test_creation_allow_system_packages"
64 # tomlkit 0.12 changes
65 "test_no_strict_naming"
66 "test_project_location_basic_set_first_project"
67 "test_project_location_complex_set_first_project"
68 ] ++ lib.optionals stdenv.isDarwin [
69 # https://github.com/NixOS/nixpkgs/issues/209358
70 "test_scripts_no_environment"
71
72 # This test assumes it is running on macOS with a system shell on the PATH.
73 # It is not possible to run it in a nix build using a /nix/store shell.
74 # See https://github.com/pypa/hatch/pull/709 for the relevant code.
75 "test_populate_default_popen_kwargs_executable"
76 ];
77
78 meta = with lib; {
79 description = "Modern, extensible Python project manager";
80 homepage = "https://hatch.pypa.io/latest/";
81 changelog = "https://github.com/pypa/hatch/blob/hatch-v${version}/docs/history/hatch.md";
82 license = licenses.mit;
83 maintainers = with maintainers; [ onny ];
84 };
85}