From ba276cf1e6045782813048441df763d4d26ad31d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 5 Mar 2022 21:26:48 +0100 Subject: [PATCH] python3Packages.hatchling: init at 0.18.0 --- .../python-modules/hatchling/default.nix | 84 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 86 insertions(+) create mode 100644 pkgs/development/python-modules/hatchling/default.nix diff --git a/pkgs/development/python-modules/hatchling/default.nix b/pkgs/development/python-modules/hatchling/default.nix new file mode 100644 index 000000000000..b656c64baf91 --- /dev/null +++ b/pkgs/development/python-modules/hatchling/default.nix @@ -0,0 +1,84 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder + +# runtime +, editables +, importlib-metadata # < 3.8 +, packaging +, pathspec +, pluggy +, tomli + +# tests +, build +, python +, requests +, toml +, virtualenv +}: + +let + pname = "hatchling"; + version = "0.18.0"; +in +buildPythonPackage { + inherit pname version; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "ofek"; + repo = "hatch"; + rev = "${pname}-v${version}"; + hash = "sha256-kCaEAM0cY1yQcuHfvnaLs3smN9MKATjrrQTXpCfGmWc="; + }; + + prePatch = '' + cd backend + ''; + + # listed in backend/src/hatchling/ouroboros.py + propagatedBuildInputs = [ + editables + packaging + pathspec + pluggy + tomli + ] ++ lib.optionals (pythonOlder "3.8") [ + importlib-metadata + ]; + + pythonImportsCheck = [ + "hatchling" + ]; + + # tries to fetch packages from the internet + doCheck = false; + + # listed in /backend/tests/downstream/requirements.txt + checkInputs = [ + build + packaging + requests + toml + virtualenv + ]; + + preCheck = '' + export HOME=$TMPDIR + ''; + + checkPhase = '' + runHook preCheck + ${python.interpreter} tests/downstream/integrate.py + runHook postCheck + ''; + + meta = with lib; { + description = "Modern, extensible Python build backend"; + homepage = "https://ofek.dev/hatch/latest/"; + license = licenses.mit; + maintainers = with maintainers; [ hexa ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c502b6751b27..96ee3476ea31 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3692,6 +3692,8 @@ in { hatasmota = callPackage ../development/python-modules/hatasmota { }; + hatchling = callPackage ../development/python-modules/hatchling { }; + haversine = callPackage ../development/python-modules/haversine { }; hawkauthlib = callPackage ../development/python-modules/hawkauthlib { };