Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / hatchling / default.nix
blob8a886112fed99c0224f007f9af0d2d3101984a44
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , pythonOlder
6 # runtime
7 , editables
8 , packaging
9 , pathspec
10 , pluggy
11 , tomli
12 , trove-classifiers
14 # tests
15 , build
16 , python
17 , requests
18 , virtualenv
21 buildPythonPackage rec {
22   pname = "hatchling";
23   version = "1.18.0";
24   format = "pyproject";
25   disabled = pythonOlder "3.8";
27   src = fetchPypi {
28     inherit pname version;
29     hash = "sha256-UOmcMRDOCvw/e9ut/xxxwXdY5HZzHCdgeUDPpmhkico=";
30   };
32   # listed in backend/pyproject.toml
33   propagatedBuildInputs = [
34     editables
35     packaging
36     pathspec
37     pluggy
38     trove-classifiers
39   ] ++ lib.optionals (pythonOlder "3.11") [
40     tomli
41   ];
43   pythonImportsCheck = [
44     "hatchling"
45     "hatchling.build"
46   ];
48   # tries to fetch packages from the internet
49   doCheck = false;
51   # listed in /backend/tests/downstream/requirements.txt
52   nativeCheckInputs = [
53     build
54     requests
55     virtualenv
56   ];
58   preCheck = ''
59     export HOME=$TMPDIR
60   '';
62   checkPhase = ''
63     runHook preCheck
64     ${python.interpreter} tests/downstream/integrate.py
65     runHook postCheck
66   '';
68   meta = with lib; {
69     description = "Modern, extensible Python build backend";
70     homepage = "https://hatch.pypa.io/latest/";
71     changelog = "https://github.com/pypa/hatch/releases/tag/hatchling-v${version}";
72     license = licenses.mit;
73     maintainers = with maintainers; [ hexa ofek ];
74   };