diff --git a/pkgs/development/python-modules/future-typing/default.nix b/pkgs/development/python-modules/future-typing/default.nix index 22036e4572a9..61a87e02253d 100644 --- a/pkgs/development/python-modules/future-typing/default.nix +++ b/pkgs/development/python-modules/future-typing/default.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { sha256 = "65fdc5034a95db212790fee5e977fb0a2df8deb60dccf3bac17d6d2b1a9bbacd"; }; - doCheck = false; # No tests in pypi source + doCheck = false; # No tests in pypi source. Did not get tests from GitHub source to work. pythonImportsCheck = [ "future_typing" ]; diff --git a/pkgs/development/python-modules/typical/default.nix b/pkgs/development/python-modules/typical/default.nix new file mode 100644 index 000000000000..ec9cd4d17331 --- /dev/null +++ b/pkgs/development/python-modules/typical/default.nix @@ -0,0 +1,69 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, inflection +, pendulum +, fastjsonschema +, typing-extensions +, orjson +, future-typing +, poetry-core +, pydantic +, sqlalchemy +, pandas +, mypy +}: + +buildPythonPackage rec { + pname = "typical"; + version = "2.7.9"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "seandstewart"; + repo = "typical"; + rev = "v${version}"; + sha256 = "sha256-ITIsSM92zftnvqLiVGFl//IbBb8N3ffkkqohzOx2JO4="; + }; + + patches = [ + ./use-poetry-core.patch + ]; + + nativeBuildInputs = [ poetry-core ]; + + propagatedBuildInputs = [ + inflection + pendulum + fastjsonschema + orjson + typing-extensions + future-typing + ]; + + checkInputs = [ + pytestCheckHook + mypy + pydantic + sqlalchemy + pandas + ]; + + disabledTests = [ + "test_ujson" # We use orjson + ]; + + disabledTestPaths = [ + "benchmark/" + ]; + + pythonImportsCheck = [ "typic" ]; + + meta = with lib; { + homepage = "https://python-typical.org/"; + description = "Typical: Python's Typing Toolkit."; + license = licenses.mit; + maintainers = with maintainers; [ kfollesdal ]; + }; +} diff --git a/pkgs/development/python-modules/typical/use-poetry-core.patch b/pkgs/development/python-modules/typical/use-poetry-core.patch new file mode 100644 index 000000000000..f3c32e621aea --- /dev/null +++ b/pkgs/development/python-modules/typical/use-poetry-core.patch @@ -0,0 +1,13 @@ +diff --git a/pyproject.toml b/pyproject.toml +index a588a0d..43da394 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -154,7 +154,7 @@ exclude = ''' + + [build-system] + requires = ["poetry>=0.12"] +-build-backend = "poetry.masonry.api" ++build-backend = "poetry.core.masonry.api" + + [bumpver] + current_version = "v2.7.5" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9695a2372ad0..04329b091030 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9523,6 +9523,8 @@ in { typesystem = callPackage ../development/python-modules/typesystem { }; + typical = callPackage ../development/python-modules/typical { }; + typing = null; typing-extensions = callPackage ../development/python-modules/typing-extensions { };