1{ lib
2, attrs
3, buildPythonPackage
4, fetchFromGitHub
5, hatch-vcs
6, hatchling
7, jsonschema
8, pytest-subtests
9, pytestCheckHook
10, pythonOlder
11, rpds-py
12}:
13
14
15let
16 self = buildPythonPackage rec {
17 pname = "referencing";
18 version = "0.30.2";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "python-jsonschema";
25 repo = "referencing";
26 rev = "refs/tags/v${version}";
27 fetchSubmodules = true;
28 hash = "sha256-C2gKjoaMcUWz/QOsqpv4TkozQyI+zEIQf3GMf5w40aw=";
29 };
30
31 SETUPTOOLS_SCM_PRETEND_VERSION = version;
32
33 nativeBuildInputs = [
34 hatch-vcs
35 hatchling
36 ];
37
38 propagatedBuildInputs = [
39 attrs
40 rpds-py
41 ];
42
43 nativeCheckInputs = [
44 jsonschema
45 pytest-subtests
46 pytestCheckHook
47 ];
48
49 # avoid infinite recursion with jsonschema
50 doCheck = false;
51
52 passthru.tests.referencing = self.overridePythonAttrs { doCheck = true; };
53
54 pythonImportsCheck = [
55 "referencing"
56 ];
57
58 meta = with lib; {
59 description = "Cross-specification JSON referencing";
60 homepage = "https://github.com/python-jsonschema/referencing";
61 changelog = "https://github.com/python-jsonschema/referencing/blob/${version}/CHANGELOG.rst";
62 license = licenses.mit;
63 maintainers = with maintainers; [ fab ];
64 };
65 };
66in
67 self