nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 pythonAtLeast,
5 fetchFromGitHub,
6 pytestCheckHook,
7 flit-core,
8 installer,
9 mock,
10}:
11
12buildPythonPackage rec {
13 pname = "installer";
14 version = "0.7.0";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "pypa";
19 repo = "installer";
20 rev = version;
21 hash = "sha256-thHghU+1Alpay5r9Dc3v7ATRFfYKV8l9qR0nbGOOX/A=";
22 };
23
24 patches =
25 lib.optionals (pythonAtLeast "3.13") [
26 # Fix compatibility with Python 3.13
27 # https://github.com/pypa/installer/pull/201
28 ./python313-compat.patch
29 ]
30 ++ [
31 # Add -m flag to installer to correctly support cross
32 # https://github.com/pypa/installer/pull/258
33 ./cross.patch
34 ];
35
36 nativeBuildInputs = [ flit-core ];
37
38 # We need to disable tests because this package is part of the bootstrap chain
39 # and its test dependencies cannot be built yet when this is being built.
40 doCheck = false;
41
42 passthru.tests = {
43 pytest = buildPythonPackage {
44 pname = "${pname}-pytest";
45 inherit version;
46 pyproject = false;
47
48 dontBuild = true;
49 dontInstall = true;
50
51 nativeCheckInputs = [
52 installer
53 mock
54 pytestCheckHook
55 ];
56 };
57 };
58
59 meta = {
60 description = "Low-level library for installing a Python package from a wheel distribution";
61 homepage = "https://github.com/pypa/installer";
62 changelog = "https://github.com/pypa/installer/blob/${src.rev}/docs/changelog.md";
63 license = lib.licenses.mit;
64 maintainers = [ lib.maintainers.cpcloud ];
65 teams = [ lib.teams.python ];
66 };
67}