2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonAtLeast,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pytestCheckHook,
|
|
|
|
flit-core,
|
|
|
|
installer,
|
|
|
|
mock,
|
2022-01-19 23:45:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "installer";
|
2023-03-24 00:07:29 +00:00
|
|
|
version = "0.7.0";
|
2022-01-19 23:45:15 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-08-22 20:05:09 +00:00
|
|
|
owner = "pypa";
|
2022-01-19 23:45:15 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-03-24 00:07:29 +00:00
|
|
|
hash = "sha256-thHghU+1Alpay5r9Dc3v7ATRFfYKV8l9qR0nbGOOX/A=";
|
2022-01-19 23:45:15 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
patches = lib.optionals (pythonAtLeast "3.13") [
|
|
|
|
# Fix compatibility with Python 3.13
|
|
|
|
# https://github.com/pypa/installer/pull/201
|
|
|
|
./python313-compat.patch
|
|
|
|
];
|
|
|
|
|
2022-01-19 23:45:15 +00:00
|
|
|
nativeBuildInputs = [ flit-core ];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# We need to disable tests because this package is part of the bootstrap chain
|
|
|
|
# and its test dependencies cannot be built yet when this is being built.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
pytest = buildPythonPackage {
|
|
|
|
pname = "${pname}-pytest";
|
|
|
|
inherit version;
|
|
|
|
format = "other";
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontInstall = true;
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
installer
|
|
|
|
mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2022-01-19 23:45:15 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Low-level library for installing a Python package from a wheel distribution";
|
2023-08-22 20:05:09 +00:00
|
|
|
homepage = "https://github.com/pypa/installer";
|
|
|
|
changelog = "https://github.com/pypa/installer/blob/${src.rev}/docs/changelog.md";
|
2022-01-19 23:45:15 +00:00
|
|
|
license = licenses.mit;
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = teams.python.members ++ [ maintainers.cpcloud ];
|
2022-01-19 23:45:15 +00:00
|
|
|
};
|
|
|
|
}
|