depot/third_party/nixpkgs/pkgs/development/python-modules/jsonschema/default.nix
Default email d5f4a57cbf Project import generated by Copybara.
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
2023-08-10 09:59:29 +02:00

97 lines
1.6 KiB
Nix

{ lib
, attrs
, buildPythonPackage
, fetchPypi
, hatch-fancy-pypi-readme
, hatch-vcs
, hatchling
, importlib-resources
, jsonschema-specifications
, pkgutil-resolve-name
, pytestCheckHook
, pythonOlder
, referencing
, rpds-py
# optionals
, fqdn
, idna
, isoduration
, jsonpointer
, rfc3339-validator
, rfc3986-validator
, rfc3987
, uri-template
, webcolors
}:
buildPythonPackage rec {
pname = "jsonschema";
version = "4.18.4";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-+zZCc1OZ+pWMDSqtcFeQFVRZbGM0n09rKDxJPPaSol0=";
};
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 = [
pytestCheckHook
];
pythonImportsCheck = [
"jsonschema"
];
meta = with lib; {
description = "An implementation of JSON Schema validation";
homepage = "https://github.com/python-jsonschema/jsonschema";
license = licenses.mit;
maintainers = with maintainers; [ domenkozar ];
};
}