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.
This commit is contained in:
Martin Weinelt 2023-11-28 17:39:53 +01:00
parent c3b3c463b2
commit a91bcf877b
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -1,17 +1,21 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
# build-system
, flit-core
# tests
, pretend
, pytestCheckHook
, pythonOlder
}:
let
packaging = buildPythonPackage rec {
pname = "packaging";
version = "23.2";
format = "pyproject";
pyproject = true;
disabled = pythonOlder "3.7";
@ -29,18 +33,27 @@ let
pretend
];
pythonImportsCheck = [
"packaging"
"packaging.metadata"
"packaging.requirements"
"packaging.specifiers"
"packaging.tags"
"packaging.version"
];
# Prevent circular dependency with pytest
doCheck = false;
pythonImportsCheck = [ "packaging" ];
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";
homepage = "https://github.com/pypa/packaging";
downloadPage = "https://github.com/pypa/packaging";
homepage = "https://packaging.pypa.io/";
license = with licenses; [ bsd2 asl20 ];
maintainers = with maintainers; [ bennofs ];
maintainers = teams.python.members ++ (with maintainers; [ bennofs ]);
};
};
in