about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/poetry2nix/poetry2nix/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-01-03 23:55:00 +0000
committerAlyssa Ross <hi@alyssa.is>2022-02-19 11:03:39 +0000
commitf4cf97a04cd5d0b86aa46baec9fb228a8f671c03 (patch)
tree28192415ff39a661d0001563bf81cc93fa25d16d /nixpkgs/pkgs/development/tools/poetry2nix/poetry2nix/default.nix
parentf8422837c9bde058e8f2de37702e7e94b2226040 (diff)
parent18c84ea816348e2a098390101b92d1e39a9dbd45 (diff)
downloadnixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.gz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.bz2
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.lz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.xz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.zst
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.zip
Merge commit '18c84ea816348e2a098390101b92d1e39a9dbd45'
Conflicts:
	nixpkgs/nixos/modules/misc/documentation.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/go-modules/generic/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix
	nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
	nixpkgs/pkgs/development/python-modules/django-mailman3/default.nix
	nixpkgs/pkgs/servers/mail/mailman/web.nix
	nixpkgs/pkgs/top-level/aliases.nix
	nixpkgs/pkgs/top-level/all-packages.nix
	nixpkgs/pkgs/top-level/impure.nix
Diffstat (limited to 'nixpkgs/pkgs/development/tools/poetry2nix/poetry2nix/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/poetry2nix/poetry2nix/default.nix54
1 files changed, 29 insertions, 25 deletions
diff --git a/nixpkgs/pkgs/development/tools/poetry2nix/poetry2nix/default.nix b/nixpkgs/pkgs/development/tools/poetry2nix/poetry2nix/default.nix
index dae0a02b6175..07e0063d6c5b 100644
--- a/nixpkgs/pkgs/development/tools/poetry2nix/poetry2nix/default.nix
+++ b/nixpkgs/pkgs/development/tools/poetry2nix/poetry2nix/default.nix
@@ -5,7 +5,7 @@
 }:
 let
   # Poetry2nix version
-  version = "1.21.0";
+  version = "1.24.1";
 
   inherit (poetryLib) isCompatible readTOML moduleName;
 
@@ -76,9 +76,9 @@ lib.makeScope pkgs.newScope (self: {
   inherit version;
 
   /* Returns a package of editable sources whose changes will be available without needing to restart the
-     nix-shell.
-     In editablePackageSources you can pass a mapping from package name to source directory to have
-     those packages available in the resulting environment, whose source changes are immediately available.
+    nix-shell.
+    In editablePackageSources you can pass a mapping from package name to source directory to have
+    those packages available in the resulting environment, whose source changes are immediately available.
 
   */
   mkPoetryEditablePackage =
@@ -109,7 +109,7 @@ lib.makeScope pkgs.newScope (self: {
       };
 
   /*
-     Returns an attrset { python, poetryPackages, pyProject, poetryLock } for the given pyproject/lockfile.
+    Returns an attrset { python, poetryPackages, pyProject, poetryLock } for the given pyproject/lockfile.
   */
   mkPoetryPackages =
     { projectDir ? null
@@ -211,7 +211,7 @@ lib.makeScope pkgs.newScope (self: {
 
                   __toPluginAble = toPluginAble self;
 
-                  inherit (hooks) pipBuildHook removePathDependenciesHook poetry2nixFixupHook wheelUnpackHook;
+                  inherit (hooks) pipBuildHook removePathDependenciesHook removeGitDependenciesHook poetry2nixFixupHook wheelUnpackHook;
                 } // lib.optionalAttrs (! super ? setuptools-scm) {
                   # The canonical name is setuptools-scm
                   setuptools-scm = super.setuptools_scm;
@@ -231,8 +231,8 @@ lib.makeScope pkgs.newScope (self: {
 
       requiredPythonModules = python.pkgs.requiredPythonModules;
       /* Include all the nested dependencies which are required for each package.
-         This guarantees that using the "poetryPackages" attribute will return
-         complete list of dependencies for the poetry project to be portable.
+        This guarantees that using the "poetryPackages" attribute will return
+        complete list of dependencies for the poetry project to be portable.
       */
       storePackages = requiredPythonModules (builtins.foldl' (acc: v: acc ++ v) [ ] (lib.attrValues inputAttrs));
     in
@@ -246,11 +246,11 @@ lib.makeScope pkgs.newScope (self: {
     };
 
   /* Returns a package with a python interpreter and all packages specified in the poetry.lock lock file.
-     In editablePackageSources you can pass a mapping from package name to source directory to have
-     those packages available in the resulting environment, whose source changes are immediately available.
+    In editablePackageSources you can pass a mapping from package name to source directory to have
+    those packages available in the resulting environment, whose source changes are immediately available.
 
-     Example:
-       poetry2nix.mkPoetryEnv { poetrylock = ./poetry.lock; python = python3; }
+    Example:
+    poetry2nix.mkPoetryEnv { poetrylock = ./poetry.lock; python = python3; }
   */
   mkPoetryEnv =
     { projectDir ? null
@@ -261,6 +261,7 @@ lib.makeScope pkgs.newScope (self: {
     , python ? pkgs.python3
     , preferWheels ? false
     , editablePackageSources ? { }
+    , extraPackages ? ps: [ ]
     }:
     let
       poetryPython = self.mkPoetryPackages {
@@ -270,14 +271,14 @@ lib.makeScope pkgs.newScope (self: {
       inherit (poetryPython) poetryPackages;
 
     in
-    poetryPython.python.withPackages (_: poetryPackages);
+    poetryPython.python.withPackages (ps: poetryPackages ++ (extraPackages ps));
 
   /* Creates a Python application from pyproject.toml and poetry.lock
 
-     The result also contains a .dependencyEnv attribute which is a python
-     environment of all dependencies and this apps modules. This is useful if
-     you rely on dependencies to invoke your modules for deployment: e.g. this
-     allows `gunicorn my-module:app`.
+    The result also contains a .dependencyEnv attribute which is a python
+    environment of all dependencies and this apps modules. This is useful if
+    you rely on dependencies to invoke your modules for deployment: e.g. this
+    allows `gunicorn my-module:app`.
   */
   mkPoetryApplication =
     { projectDir ? null
@@ -313,7 +314,10 @@ lib.makeScope pkgs.newScope (self: {
 
       app = py.pkgs.buildPythonPackage (
         passedAttrs // inputAttrs // {
-          nativeBuildInputs = inputAttrs.nativeBuildInputs ++ [ py.pkgs.removePathDependenciesHook ];
+          nativeBuildInputs = inputAttrs.nativeBuildInputs ++ [
+            py.pkgs.removePathDependenciesHook
+            py.pkgs.removeGitDependenciesHook
+          ];
         } // {
           pname = moduleName pyProject.tool.poetry.name;
           version = pyProject.tool.poetry.version;
@@ -369,7 +373,7 @@ lib.makeScope pkgs.newScope (self: {
 
 
   /*
-  Create a new default set of overrides with the same structure as the built-in ones
+    Create a new default set of overrides with the same structure as the built-in ones
   */
   mkDefaultPoetryOverrides = defaults: {
     __functor = defaults;
@@ -393,26 +397,26 @@ lib.makeScope pkgs.newScope (self: {
   };
 
   /*
-  The default list of poetry2nix override overlays
+    The default list of poetry2nix override overlays
 
-  Can be overriden by calling defaultPoetryOverrides.overrideOverlay which takes an overlay function
+    Can be overriden by calling defaultPoetryOverrides.overrideOverlay which takes an overlay function
   */
   defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides.nix { inherit pkgs lib; });
 
   /*
-  Convenience functions for specifying overlays with or without the poerty2nix default overrides
+    Convenience functions for specifying overlays with or without the poerty2nix default overrides
   */
   overrides = {
     /*
-    Returns the specified overlay in a list
+      Returns the specified overlay in a list
     */
     withoutDefaults = overlay: [
       overlay
     ];
 
     /*
-    Returns the specified overlay and returns a list
-    combining it with poetry2nix default overrides
+      Returns the specified overlay and returns a list
+      combining it with poetry2nix default overrides
     */
     withDefaults = overlay: [
       self.defaultPoetryOverrides