diff --git a/pkgs/development/python-modules/csvw/default.nix b/pkgs/development/python-modules/csvw/default.nix index 8bccfd9f3d85..7c768d3b08e7 100644 --- a/pkgs/development/python-modules/csvw/default.nix +++ b/pkgs/development/python-modules/csvw/default.nix @@ -3,49 +3,76 @@ buildPythonPackage, fetchFromGitHub, attrs, + babel, + frictionless, isodate, + jsonschema, + language-tags, python-dateutil, + rdflib, + requests, rfc3986, + setuptools, + termcolor, uritemplate, pytestCheckHook, pytest-cov-stub, pytest-mock, + requests-mock, }: -buildPythonPackage rec { +buildPythonPackage (finalAttrs: { pname = "csvw"; - version = "1.11.0"; - format = "setuptools"; + version = "3.7.0"; + pyproject = true; src = fetchFromGitHub { owner = "cldf"; repo = "csvw"; - rev = "v${version}"; - sha256 = "1393xwqawaxsflbq62vks92vv4zch8p6dd1mdvdi7j4vvf0zljkg"; + tag = "v${finalAttrs.version}"; + hash = "sha256-HftvI4xJy/MX0WTIFNyZqNqIJIlHsWhhURpeQ1XqrT0="; }; - propagatedBuildInputs = [ + postPatch = '' + substituteInPlace src/csvw/__main__.py \ + --replace-fail "'frictionless'" "'${lib.getExe frictionless}'" + ''; + + build-system = [ setuptools ]; + + dependencies = [ attrs + babel + frictionless isodate + jsonschema python-dateutil + requests + rdflib rfc3986 uritemplate + termcolor + language-tags ]; nativeCheckInputs = [ pytestCheckHook pytest-cov-stub pytest-mock + requests-mock ]; + pythonRelaxDeps = [ "rfc3986" ]; + disabledTests = [ # this test is flaky on darwin because it depends on the resolution of filesystem mtimes # https://github.com/cldf/csvw/blob/45584ad63ff3002a9b3a8073607c1847c5cbac58/tests/test_db.py#L257 "test_write_file_exists" - # https://github.com/cldf/csvw/issues/58 - "test_roundtrip_escapechar" - "test_escapequote_escapecharquotechar_final" - "test_doubleQuote" + ]; + + disabledTestPaths = [ + # Missing manifest-json.jsonld + "tests/test_conformance.py" ]; pythonImportsCheck = [ "csvw" ]; @@ -56,4 +83,4 @@ buildPythonPackage rec { license = lib.licenses.asl20; maintainers = [ ]; }; -} +}) diff --git a/pkgs/development/python-modules/frictionless/default.nix b/pkgs/development/python-modules/frictionless/default.nix index 599f8f0e8258..80013e731fd4 100644 --- a/pkgs/development/python-modules/frictionless/default.nix +++ b/pkgs/development/python-modules/frictionless/default.nix @@ -225,5 +225,6 @@ buildPythonPackage rec { changelog = "https://github.com/frictionlessdata/frictionless-py/blob/${src.rev}/CHANGELOG.md"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ zhaofengli ]; + mainProgram = "frictionless"; }; }