diff --git a/pkgs/development/python-modules/future-typing/default.nix b/pkgs/development/python-modules/future-typing/default.nix new file mode 100644 index 000000000000..61a87e02253d --- /dev/null +++ b/pkgs/development/python-modules/future-typing/default.nix @@ -0,0 +1,28 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +, typing-extensions +}: + +buildPythonPackage rec { + pname = "future-typing"; + version = "0.4.1"; + + src = fetchPypi { + pname = "future_typing"; + inherit version; + sha256 = "65fdc5034a95db212790fee5e977fb0a2df8deb60dccf3bac17d6d2b1a9bbacd"; + }; + + doCheck = false; # No tests in pypi source. Did not get tests from GitHub source to work. + + pythonImportsCheck = [ "future_typing" ]; + + meta = with lib; { + description = "Use generic type hints and new union syntax `|` with python 3.6+"; + homepage = "https://github.com/PrettyWood/future-typing"; + license = licenses.mit; + maintainers = with maintainers; [ kfollesdal ]; + }; +} 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 0a55972df9ef..e1db5a15cbe7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2979,6 +2979,8 @@ in { future-fstrings = callPackage ../development/python-modules/future-fstrings { }; + future-typing = callPackage ../development/python-modules/future-typing { }; + fuzzyfinder = callPackage ../development/python-modules/fuzzyfinder { }; fuzzywuzzy = callPackage ../development/python-modules/fuzzywuzzy { }; @@ -9606,6 +9608,8 @@ in { typesystem = callPackage ../development/python-modules/typesystem { }; + typical = callPackage ../development/python-modules/typical { }; + typing = null; typing-extensions = callPackage ../development/python-modules/typing-extensions { };