2022-08-21 13:32:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-03-24 00:07:29 +00:00
|
|
|
, fetchPypi
|
2022-08-21 13:32:41 +00:00
|
|
|
, python3
|
2024-01-13 08:15:51 +00:00
|
|
|
, cargo
|
2022-08-21 13:32:41 +00:00
|
|
|
, git
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "hatch";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.9.7";
|
2022-08-21 13:32:41 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-Gae4IXn5Tyrd2612qn5lq5DK1VqxA9U4J2N5NcnmYkw=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Loosen hatchling runtime version dependency
|
|
|
|
sed -i 's/hatchling<1.22/hatchling/' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = with python3.pkgs; [
|
|
|
|
hatchling
|
|
|
|
hatch-vcs
|
|
|
|
];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
click
|
|
|
|
hatchling
|
|
|
|
httpx
|
2022-11-21 17:40:18 +00:00
|
|
|
hyperlink
|
2022-08-21 13:32:41 +00:00
|
|
|
keyring
|
2022-11-21 17:40:18 +00:00
|
|
|
packaging
|
2022-08-21 13:32:41 +00:00
|
|
|
pexpect
|
2022-11-21 17:40:18 +00:00
|
|
|
platformdirs
|
2022-08-21 13:32:41 +00:00
|
|
|
rich
|
|
|
|
shellingham
|
|
|
|
tomli-w
|
|
|
|
tomlkit
|
|
|
|
userpath
|
|
|
|
virtualenv
|
2024-01-13 08:15:51 +00:00
|
|
|
zstandard
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
cargo
|
|
|
|
] ++ (with python3.pkgs; [
|
|
|
|
binary
|
2022-08-21 13:32:41 +00:00
|
|
|
git
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
2022-11-21 17:40:18 +00:00
|
|
|
pytest-xdist
|
2024-01-13 08:15:51 +00:00
|
|
|
setuptools
|
|
|
|
]);
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0)
|
|
|
|
"test_default"
|
|
|
|
"test_explicit_path"
|
|
|
|
"test_default_auto_detection"
|
|
|
|
"test_editable_default"
|
|
|
|
"test_editable_default_extra_dependencies"
|
|
|
|
"test_editable_default_force_include"
|
|
|
|
"test_editable_default_force_include_option"
|
|
|
|
"test_editable_exact"
|
|
|
|
"test_editable_exact_extra_dependencies"
|
|
|
|
"test_editable_exact_force_include"
|
2022-11-21 17:40:18 +00:00
|
|
|
"test_editable_exact_force_include_option"
|
2022-08-21 13:32:41 +00:00
|
|
|
"test_editable_exact_force_include_build_data_precedence"
|
|
|
|
"test_editable_pth"
|
2024-01-13 08:15:51 +00:00
|
|
|
# expects sh, finds bash
|
|
|
|
"test_all"
|
|
|
|
"test_already_installed_update_flag"
|
|
|
|
"test_already_installed_update_prompt"
|
2024-05-15 15:35:15 +00:00
|
|
|
# Loosen hatchling runtime version dependency
|
|
|
|
"test_core"
|
|
|
|
"test_correct"
|
2023-02-02 18:25:31 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/209358
|
|
|
|
"test_scripts_no_environment"
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
# 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"
|
2024-05-15 15:35:15 +00:00
|
|
|
] ++ lib.optionals stdenv.isAarch64 [
|
|
|
|
"test_resolve"
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Modern, extensible Python project manager";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "hatch";
|
2022-08-21 13:32:41 +00:00
|
|
|
homepage = "https://hatch.pypa.io/latest/";
|
2023-08-10 07:59:29 +00:00
|
|
|
changelog = "https://github.com/pypa/hatch/blob/hatch-v${version}/docs/history/hatch.md";
|
2022-08-21 13:32:41 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ onny ];
|
|
|
|
};
|
|
|
|
}
|