Run nixpkgs-fmt after the nixpkgs bump

This commit is contained in:
adisbladis 2021-12-25 16:00:20 -08:00
parent 3be424ac55
commit 2c63047ee1
4 changed files with 29 additions and 29 deletions

View file

@ -76,9 +76,9 @@ lib.makeScope pkgs.newScope (self: {
inherit version; inherit version;
/* Returns a package of editable sources whose changes will be available without needing to restart the /* Returns a package of editable sources whose changes will be available without needing to restart the
nix-shell. nix-shell.
In editablePackageSources you can pass a mapping from package name to source directory to have 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. those packages available in the resulting environment, whose source changes are immediately available.
*/ */
mkPoetryEditablePackage = 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 = mkPoetryPackages =
{ projectDir ? null { projectDir ? null
@ -231,8 +231,8 @@ lib.makeScope pkgs.newScope (self: {
requiredPythonModules = python.pkgs.requiredPythonModules; requiredPythonModules = python.pkgs.requiredPythonModules;
/* Include all the nested dependencies which are required for each package. /* Include all the nested dependencies which are required for each package.
This guarantees that using the "poetryPackages" attribute will return This guarantees that using the "poetryPackages" attribute will return
complete list of dependencies for the poetry project to be portable. complete list of dependencies for the poetry project to be portable.
*/ */
storePackages = requiredPythonModules (builtins.foldl' (acc: v: acc ++ v) [ ] (lib.attrValues inputAttrs)); storePackages = requiredPythonModules (builtins.foldl' (acc: v: acc ++ v) [ ] (lib.attrValues inputAttrs));
in 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. /* 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 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. those packages available in the resulting environment, whose source changes are immediately available.
Example: Example:
poetry2nix.mkPoetryEnv { poetrylock = ./poetry.lock; python = python3; } poetry2nix.mkPoetryEnv { poetrylock = ./poetry.lock; python = python3; }
*/ */
mkPoetryEnv = mkPoetryEnv =
{ projectDir ? null { projectDir ? null
@ -274,10 +274,10 @@ lib.makeScope pkgs.newScope (self: {
/* Creates a Python application from pyproject.toml and poetry.lock /* Creates a Python application from pyproject.toml and poetry.lock
The result also contains a .dependencyEnv attribute which is a python The result also contains a .dependencyEnv attribute which is a python
environment of all dependencies and this apps modules. This is useful if 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 you rely on dependencies to invoke your modules for deployment: e.g. this
allows `gunicorn my-module:app`. allows `gunicorn my-module:app`.
*/ */
mkPoetryApplication = mkPoetryApplication =
{ projectDir ? null { projectDir ? null
@ -372,7 +372,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: { mkDefaultPoetryOverrides = defaults: {
__functor = defaults; __functor = defaults;
@ -396,26 +396,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; }); 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 = { overrides = {
/* /*
Returns the specified overlay in a list Returns the specified overlay in a list
*/ */
withoutDefaults = overlay: [ withoutDefaults = overlay: [
overlay overlay
]; ];
/* /*
Returns the specified overlay and returns a list Returns the specified overlay and returns a list
combining it with poetry2nix default overrides combining it with poetry2nix default overrides
*/ */
withDefaults = overlay: [ withDefaults = overlay: [
self.defaultPoetryOverrides self.defaultPoetryOverrides

View file

@ -174,11 +174,11 @@ let
lib.optionals (builtins.toString path != "/" && ! isGitRoot) (findGitIgnores parent) ++ gitIgnores; lib.optionals (builtins.toString path != "/" && ! isGitRoot) (findGitIgnores parent) ++ gitIgnores;
/* /*
Provides a source filtering mechanism that: Provides a source filtering mechanism that:
- Filters gitignore's - Filters gitignore's
- Filters pycache/pyc files - Filters pycache/pyc files
- Uses cleanSourceFilter to filter out .git/.hg, .o/.so, editor backup files & nix result symlinks - Uses cleanSourceFilter to filter out .git/.hg, .o/.so, editor backup files & nix result symlinks
*/ */
cleanPythonSources = { src }: cleanPythonSources = { src }:
let let

View file

@ -9,7 +9,7 @@ in
}: }:
let let
poetry = pkgs.callPackage ../pkgs/poetry { python = pkgs.python3; inherit poetry2nix; }; poetry = pkgs.callPackage ../pkgs/poetry { python = pkgs.python3; inherit poetry2nix; };
poetry2nix = import ./.. { inherit pkgs;inherit poetry; }; poetry2nix = import ./.. { inherit pkgs; inherit poetry; };
poetryLib = import ../lib.nix { inherit pkgs; lib = pkgs.lib; stdenv = pkgs.stdenv; }; poetryLib = import ../lib.nix { inherit pkgs; lib = pkgs.lib; stdenv = pkgs.stdenv; };
pep425 = pkgs.callPackage ../pep425.nix { inherit poetryLib; }; pep425 = pkgs.callPackage ../pep425.nix { inherit poetryLib; };
pep425Python37 = pkgs.callPackage ../pep425.nix { inherit poetryLib; python = pkgs.python37; }; pep425Python37 = pkgs.callPackage ../pep425.nix { inherit poetryLib; python = pkgs.python37; };
@ -26,7 +26,7 @@ builtins.removeAttrs
override-default = callTest ./override-default-support { }; override-default = callTest ./override-default-support { };
common-pkgs-1 = callTest ./common-pkgs-1 { }; common-pkgs-1 = callTest ./common-pkgs-1 { };
common-pkgs-2 = callTest ./common-pkgs-2 { }; common-pkgs-2 = callTest ./common-pkgs-2 { };
pep425 = pkgs.callPackage ./pep425 { inherit pep425;inherit pep425OSX;inherit pep425Python37; }; pep425 = pkgs.callPackage ./pep425 { inherit pep425; inherit pep425OSX; inherit pep425Python37; };
env = callTest ./env { }; env = callTest ./env { };
pytest-randomly = callTest ./pytest-randomly { }; pytest-randomly = callTest ./pytest-randomly { };
file-src-deps = callTest ./file-src-deps { }; file-src-deps = callTest ./file-src-deps { };

View file

@ -1,7 +1,7 @@
/* It is assumed that propagated dependencies are included in the poetryPackages. /* It is assumed that propagated dependencies are included in the poetryPackages.
The "certifi" is direct dependency of "requests" library. The "certifi" is direct dependency of "requests" library.
Note: this test assumes that "certifi" lib is going to be a dep of "requests" in the future. Note: this test assumes that "certifi" lib is going to be a dep of "requests" in the future.
*/ */
{ lib, poetry2nix, python3, python37 }: { lib, poetry2nix, python3, python37 }:
let let