summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/aiotarfile/default.nix
blob: 4008a15e1e1be9bdf8eb687b8f682d2b94b50b64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,
  pythonOlder,
  unittestCheckHook,
  cargo,
  rustc,
  rustPlatform,
  semver,
}:

buildPythonPackage rec {
  pname = "aiotarfile";
  version = "0.5.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "rhelmot";
    repo = "aiotarfile";
    tag = "v${version}";
    hash = "sha256-V88cvVw6ss7iiojhlqDd2frG/gCEH0YKTP0IpgeFASw=";
  };

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit pname version src;
    hash = "sha256-Yf6N615X9ZB+HDp3xehMc3kjKbdsSbIJrqARRXwCRDQ=";
  };

  postPatch = ''
    patchShebangs release.py
    ./release.py finalize
  '';

  build-system = [
    semver # required for release.py
  ];

  nativeBuildInputs = [
    cargo
    rustPlatform.cargoSetupHook
    rustPlatform.maturinBuildHook
    rustc
  ];

  nativeCheckInputs = [ unittestCheckHook ];

  unittestFlagsArray = [ "tests/" ]; # Not sure why it isn't autodiscovered

  # pyo3-asyncio 0.20 segfaults on the python 3.14 interpreter state.
  doCheck = pythonOlder "3.14";

  pythonImportsCheck = [ "aiotarfile" ];

  meta = {
    description = "Stream-based, asynchronous tarball processing";
    homepage = "https://github.com/rhelmot/aiotarfile";
    changelog = "https://github.com/rhelmot/aiotarfile/commits/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ nicoo ];
  };
}