nixpkgs-suyu/pkgs/development/python-modules/packaging/default.nix
Martin Weinelt a91bcf877b
python311Packages.packaging: refactor and adopt
Since this package is now used in a widely used hook, I'm adopting this
package on behalf of the Python team.
2023-12-20 20:10:24 +01:00

60 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
# build-system
, flit-core
# tests
, pretend
, pytestCheckHook
}:
let
packaging = buildPythonPackage rec {
pname = "packaging";
version = "23.2";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-BI+w6UBQNlGOqvSKVZU8dQwR4aG2jg3RqdYu0MCSz8U=";
};
nativeBuildInputs = [
flit-core
];
nativeCheckInputs = [
pytestCheckHook
pretend
];
pythonImportsCheck = [
"packaging"
"packaging.metadata"
"packaging.requirements"
"packaging.specifiers"
"packaging.tags"
"packaging.version"
];
# Prevent circular dependency with pytest
doCheck = false;
passthru.tests = packaging.overridePythonAttrs (_: { doCheck = true; });
meta = with lib; {
changelog = "https://github.com/pypa/packaging/blob/${version}/CHANGELOG.rst";
description = "Core utilities for Python packages";
downloadPage = "https://github.com/pypa/packaging";
homepage = "https://packaging.pypa.io/";
license = with licenses; [ bsd2 asl20 ];
maintainers = teams.python.members ++ (with maintainers; [ bennofs ]);
};
};
in
packaging