From 242c4025eddd0635d9f7ca76c459126ef6fe1afd Mon Sep 17 00:00:00 2001 From: happysalada Date: Wed, 26 Jul 2023 17:31:52 +0900 Subject: [PATCH] python310Packages.unstructured-api-tools: init at 0.10.10 --- .../unstructured-api-tools/default.nix | 93 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 95 insertions(+) create mode 100644 pkgs/development/python-modules/unstructured-api-tools/default.nix diff --git a/pkgs/development/python-modules/unstructured-api-tools/default.nix b/pkgs/development/python-modules/unstructured-api-tools/default.nix new file mode 100644 index 00000000000..7b3b5c8983c --- /dev/null +++ b/pkgs/development/python-modules/unstructured-api-tools/default.nix @@ -0,0 +1,93 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonOlder +# propagated build inputs +, click +, fastapi +, jinja2 +, mypy +, nbconvert +, python-multipart +, pandas +, types-requests +, types-ujson +, uvicorn +, autoflake +# native check inputs +, pytestCheckHook +, black +, coverage +, flake8 +, httpx +, ipython +, pytest-cov +, requests +, requests-toolbelt +, nbdev +, pytest-mock +}: +let + version = "0.10.10"; +in +buildPythonPackage { + pname = "unstructured-api-tools"; + inherit version; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "Unstructured-IO"; + repo = "unstructured-api-tools"; + rev = version; + hash = "sha256-CJ5bsII24hw03JN4+8VywYRYCsnMlYHjmaIIn0zttIs="; + }; + + propagatedBuildInputs = [ + click + fastapi + jinja2 + mypy + nbconvert + python-multipart + pandas + types-requests + types-ujson + uvicorn + autoflake + ] ++ uvicorn.optional-dependencies.standard; + + pythonImportsCheck = [ "unstructured_api_tools" ]; + + # test require file generation but it complains about a missing file mypy + doCheck = false; + # preCheck = '' + # substituteInPlace Makefile \ + # --replace "PYTHONPATH=." "" \ + # --replace "mypy" "${mypy}/bin/mypy" + # make generate-test-api + # ''; + + nativeCheckInputs = [ + pytestCheckHook + black + coverage + flake8 + httpx + ipython + pytest-cov + requests + requests-toolbelt + nbdev + pytest-mock + ]; + + meta = with lib; { + description = ""; + homepage = "https://github.com/Unstructured-IO/unstructured-api-tools"; + changelog = "https://github.com/Unstructured-IO/unstructured-api-tools/blob/${version}/CHANGELOG.md"; + license = licenses.asl20; + maintainers = with maintainers; [ happysalada ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a34506c4b85..b171e8e9ba7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13129,6 +13129,8 @@ self: super: with self; { unstructured = callPackage ../development/python-modules/unstructured { }; + unstructured-api-tools = callPackage ../development/python-modules/unstructured-api-tools { }; + unstructured-inference = callPackage ../development/python-modules/unstructured-inference { }; untangle = callPackage ../development/python-modules/untangle { };