about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pydantic
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2023-04-21 18:40:50 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2023-04-21 18:44:36 +0200
commitad25ec8ecbbb2c4eea92bb250052b09fcd4adaf9 (patch)
tree8c50e02cc1e7024f119501af5bd9503b4d6640fb /pkgs/development/python-modules/pydantic
parent789bb04f46b562f7ffa0d6f5a8291e6dfd295b27 (diff)
python310Packages.pydantic: Expose optional dependencies
and don't propagate themn by default.
Diffstat (limited to 'pkgs/development/python-modules/pydantic')
-rw-r--r--pkgs/development/python-modules/pydantic/default.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/development/python-modules/pydantic/default.nix b/pkgs/development/python-modules/pydantic/default.nix
index 2de8e95d8b202..7247420e9dfc9 100644
--- a/pkgs/development/python-modules/pydantic/default.nix
+++ b/pkgs/development/python-modules/pydantic/default.nix
@@ -75,16 +75,23 @@ buildPythonPackage rec {
 
   propagatedBuildInputs = [
     devtools
-    email-validator
     pyupgrade
-    python-dotenv
     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