diff options
author | natsukium <tomoya.otabi@gmail.com> | 2023-11-28 09:29:49 +0900 |
---|---|---|
committer | Martin Weinelt <hexa@darmstadt.ccc.de> | 2023-12-20 20:15:26 +0100 |
commit | 4c0f60d1d859e0bc8ff4b2d979cc992db4d23ef7 (patch) | |
tree | d500c72067e96628dcd5a5be80df9873692de2c8 | |
parent | a1afcb22069de15288fc520cba814b3d9cc66d2e (diff) |
python311Packages.pydantic_1: init at 1.10.3
-rw-r--r-- | pkgs/development/python-modules/pydantic/1.nix | 76 | ||||
-rw-r--r-- | pkgs/top-level/python-packages.nix | 2 |
2 files changed, 78 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pydantic/1.nix b/pkgs/development/python-modules/pydantic/1.nix new file mode 100644 index 000000000000..e1fc840f0ee1 --- /dev/null +++ b/pkgs/development/python-modules/pydantic/1.nix @@ -0,0 +1,76 @@ +{ lib +, buildPythonPackage +, cython +, email-validator +, fetchFromGitHub +, pytest-mock +, pytestCheckHook +, python-dotenv +, pythonOlder +, setuptools +, typing-extensions +, libxcrypt +}: + +buildPythonPackage rec { + pname = "pydantic"; + version = "1.10.13"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "pydantic"; + repo = "pydantic"; + rev = "refs/tags/v${version}"; + hash = "sha256-ruDVcCLPVuwIkHOjYVuKOoP3hHHr7ItIY55Y6hUgR74="; + }; + + nativeBuildInputs = [ + setuptools + cython + ]; + + buildInputs = lib.optionals (pythonOlder "3.9") [ + libxcrypt + ]; + + propagatedBuildInputs = [ + typing-extensions + ]; + + passthru.optional-dependencies = { + dotenv = [ + python-dotenv + ]; + email = [ + email-validator + ]; + }; + + nativeCheckInputs = [ + pytest-mock + pytestCheckHook + ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies); + + pytestFlagsArray = [ + # https://github.com/pydantic/pydantic/issues/4817 + "-W" "ignore::pytest.PytestReturnNotNoneWarning" + ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + enableParallelBuilding = true; + + pythonImportsCheck = [ "pydantic" ]; + + meta = with lib; { + description = "Data validation and settings management using Python type hinting"; + homepage = "https://github.com/pydantic/pydantic"; + changelog = "https://github.com/pydantic/pydantic/blob/v${version}/HISTORY.md"; + license = licenses.mit; + maintainers = with maintainers; [ wd15 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6f15e7530ad2..5cf8fcc3fde2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10179,6 +10179,8 @@ self: super: with self; { pydantic = callPackage ../development/python-modules/pydantic { }; + pydantic_1 = callPackage ../development/python-modules/pydantic/1.nix { }; + pydantic-core = callPackage ../development/python-modules/pydantic-core { }; pydantic-extra-types = callPackage ../development/python-modules/pydantic-extra-types { }; |