depot/third_party/nixpkgs/pkgs/development/python-modules/jsonschema/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

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.22.0";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-WyLUNKRZNRGa+ZBVLIYuXW1WTo9mASBrMFph/fZhorc=";
};
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
];
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 ];
};
}