depot/third_party/nixpkgs/pkgs/development/python-modules/jsonschema/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

101 lines
1.7 KiB
Nix

{
lib,
attrs,
buildPythonPackage,
fetchPypi,
hatch-fancy-pypi-readme,
hatch-vcs,
hatchling,
importlib-resources,
jsonschema-specifications,
pkgutil-resolve-name,
pip,
pytestCheckHook,
pythonOlder,
referencing,
rpds-py,
# optionals
fqdn,
idna,
isoduration,
jsonpointer,
rfc3339-validator,
rfc3986-validator,
rfc3987,
uri-template,
webcolors,
}:
buildPythonPackage rec {
pname = "jsonschema";
version = "4.21.1";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-hXJ8ACefX6a+2+YjjSqmQDvt2LSGSrESB9B988wbLuU=";
};
postPatch = ''
patchShebangs json/bin/jsonschema_suite
'';
nativeBuildInputs = [
hatch-fancy-pypi-readme
hatch-vcs
hatchling
];
propagatedBuildInputs =
[
attrs
jsonschema-specifications
referencing
rpds-py
]
++ lib.optionals (pythonOlder "3.9") [
importlib-resources
pkgutil-resolve-name
];
passthru.optional-dependencies = {
format = [
fqdn
idna
isoduration
jsonpointer
rfc3339-validator
rfc3987
uri-template
webcolors
];
format-nongpl = [
fqdn
idna
isoduration
jsonpointer
rfc3339-validator
rfc3986-validator
uri-template
webcolors
];
};
nativeCheckInputs = [
pip
pytestCheckHook
];
pythonImportsCheck = [ "jsonschema" ];
meta = with lib; {
description = "Implementation of JSON Schema validation";
mainProgram = "jsonschema";
homepage = "https://github.com/python-jsonschema/jsonschema";
license = licenses.mit;
maintainers = with maintainers; [ domenkozar ];
};
}