Format with nixpkgs-fmt 0.9

This commit is contained in:
adisbladis 2020-05-19 21:06:02 +01:00
parent 08446e038a
commit db06bdd6e7
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
24 changed files with 994 additions and 1050 deletions

View file

@ -69,14 +69,12 @@ let
baseOverlay = self: super: baseOverlay = self: super:
let let
getDep = depName: self.${depName}; getDep = depName: self.${depName};
lockPkgs = builtins.listToAttrs lockPkgs = builtins.listToAttrs (
(
builtins.map builtins.map
( (
pkgMeta: rec { pkgMeta: rec {
name = moduleName pkgMeta.name; name = moduleName pkgMeta.name;
value = self.mkPoetryDep value = self.mkPoetryDep (
(
pkgMeta // { pkgMeta // {
inherit pwd preferWheels; inherit pwd preferWheels;
source = pkgMeta.source or null; source = pkgMeta.source or null;
@ -86,11 +84,13 @@ let
} }
); );
} }
) compatible )
compatible
); );
in in
lockPkgs; lockPkgs;
overlays = builtins.map getFunctorFn overlays = builtins.map
getFunctorFn
( (
[ [
( (
@ -145,8 +145,7 @@ let
, editablePackageSources ? { } , editablePackageSources ? { }
}: }:
let let
py = mkPoetryPackages py = mkPoetryPackages (
(
{ {
inherit pyproject poetrylock overrides python pwd preferWheels; inherit pyproject poetrylock overrides python pwd preferWheels;
} }
@ -155,12 +154,14 @@ let
(name: src: (name: src:
# Creates a "fake" python module that just points to the editable source directory # Creates a "fake" python module that just points to the editable source directory
# See https://docs.python.org/3.8/library/site.html for info on such .pth files # See https://docs.python.org/3.8/library/site.html for info on such .pth files
py.python.pkgs.toPythonModule py.python.pkgs.toPythonModule (pkgs.runCommandNoCC "${name}-editable"
(pkgs.runCommandNoCC "${name}-editable" { } '' { } ''
mkdir -p "$out/${py.python.sitePackages}" mkdir -p "$out/${py.python.sitePackages}"
echo "${toString src}" > "$out/${py.python.sitePackages}/${name}.pth" echo "${toString src}" > "$out/${py.python.sitePackages}/${name}.pth"
'') ''
) editablePackageSources; )
)
editablePackageSources;
in in
py.python.withPackages (_: py.poetryPackages ++ editablePackages); py.python.withPackages (_: py.poetryPackages ++ editablePackages);
@ -214,16 +215,17 @@ let
pkg = py.pkgs."${dep}"; pkg = py.pkgs."${dep}";
constraints = deps.${dep}.python or ""; constraints = deps.${dep}.python or "";
isCompat = compat constraints; isCompat = compat constraints;
in if isCompat then pkg else null in
) depAttrs; if isCompat then pkg else null
)
depAttrs;
getInputs = attr: attrs.${attr} or [ ]; getInputs = attr: attrs.${attr} or [ ];
mkInput = attr: extraInputs: getInputs attr ++ extraInputs; mkInput = attr: extraInputs: getInputs attr ++ extraInputs;
buildSystemPkgs = poetryLib.getBuildSystemPkgs { buildSystemPkgs = poetryLib.getBuildSystemPkgs {
inherit pyProject; inherit pyProject;
pythonPackages = py.pkgs; pythonPackages = py.pkgs;
}; };
app = py.pkgs.buildPythonPackage app = py.pkgs.buildPythonPackage (
(
passedAttrs // { passedAttrs // {
pname = moduleName pyProject.tool.poetry.name; pname = moduleName pyProject.tool.poetry.name;
version = pyProject.tool.poetry.version; version = pyProject.tool.poetry.version;
@ -243,9 +245,8 @@ let
passthru = { passthru = {
python = py; python = py;
dependencyEnv = dependencyEnv = (
(lib.makeOverridable lib.makeOverridable ({ app, ... }@attrs:
({ app, ... }@attrs:
let let
args = builtins.removeAttrs attrs [ "app" ] // { args = builtins.removeAttrs attrs [ "app" ] // {
extraLibs = [ app ]; extraLibs = [ app ];

View file

@ -9,8 +9,7 @@
systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ]; systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
# Memoize nixpkgs for different platforms for efficiency. # Memoize nixpkgs for different platforms for efficiency.
nixpkgsFor = forAllSystems nixpkgsFor = forAllSystems (
(
system: system:
import nixpkgs { import nixpkgs {
inherit system; inherit system;
@ -23,8 +22,7 @@
overlay = import ./overlay.nix; overlay = import ./overlay.nix;
# TODO: I feel like `packages` is the wrong place for the poetry2nix attr # TODO: I feel like `packages` is the wrong place for the poetry2nix attr
packages = forAllSystems packages = forAllSystems (
(
system: { system: {
inherit (nixpkgsFor.${system}) poetry poetry2nix; inherit (nixpkgsFor.${system}) poetry poetry2nix;
} }

View file

@ -14,7 +14,8 @@ in
removePathDependenciesHook = callPackage removePathDependenciesHook = callPackage
( (
{}: {}:
makeSetupHook { makeSetupHook
{
name = "remove-path-dependencies.sh"; name = "remove-path-dependencies.sh";
deps = [ ]; deps = [ ];
substitutions = { substitutions = {
@ -28,7 +29,8 @@ in
pipBuildHook = callPackage pipBuildHook = callPackage
( (
{ pip, wheel }: { pip, wheel }:
makeSetupHook { makeSetupHook
{
name = "pip-build-hook.sh"; name = "pip-build-hook.sh";
deps = [ pip wheel ]; deps = [ pip wheel ];
substitutions = { substitutions = {
@ -40,7 +42,8 @@ in
poetry2nixFixupHook = callPackage poetry2nixFixupHook = callPackage
( (
{}: {}:
makeSetupHook { makeSetupHook
{
name = "fixup-hook.sh"; name = "fixup-hook.sh";
deps = [ ]; deps = [ ];
} ./fixup-hook.sh } ./fixup-hook.sh

20
lib.nix
View file

@ -20,7 +20,7 @@ let
minor = l: lib.elemAt l 1; minor = l: lib.elemAt l 1;
joinVersion = v: lib.concatStringsSep "." v; joinVersion = v: lib.concatStringsSep "." v;
in in
joinVersion ( if major pyVer == major ver && minor pyVer == minor ver then ver else pyVer); joinVersion (if major pyVer == major ver && minor pyVer == minor ver then ver else pyVer);
# Compare a semver expression with a version # Compare a semver expression with a version
isCompatible = version: isCompatible = version:
@ -45,13 +45,12 @@ let
state = operators."${operator}" acc.state (satisfiesSemver version v); state = operators."${operator}" acc.state (satisfiesSemver version v);
}; };
initial = { operator = "&&"; state = true; }; initial = { operator = "&&"; state = true; };
in if expr == "" then true else (builtins.foldl' combine initial tokens).state; in
if expr == "" then true else (builtins.foldl' combine initial tokens).state;
fromTOML = builtins.fromTOML or fromTOML = builtins.fromTOML or
( (
toml: builtins.fromJSON toml: builtins.fromJSON (
( builtins.readFile (
builtins.readFile
(
pkgs.runCommand "from-toml" pkgs.runCommand "from-toml"
{ {
inherit toml; inherit toml;
@ -88,8 +87,7 @@ let
# file: filename including extension # file: filename including extension
# hash: SRI hash # hash: SRI hash
# kind: Language implementation and version tag # kind: Language implementation and version tag
predictURLFromPypi = lib.makeOverridable predictURLFromPypi = lib.makeOverridable (
(
{ pname, file, hash, kind }: { pname, file, hash, kind }:
"https://files.pythonhosted.org/packages/${kind}/${lib.toLower (builtins.substring 0 1 file)}/${pname}/${file}" "https://files.pythonhosted.org/packages/${kind}/${lib.toLower (builtins.substring 0 1 file)}/${pname}/${file}"
); );
@ -102,8 +100,7 @@ let
# file: filename including extension # file: filename including extension
# hash: SRI hash # hash: SRI hash
# kind: Language implementation and version tag # kind: Language implementation and version tag
fetchWheelFromPypi = lib.makeOverridable fetchWheelFromPypi = lib.makeOverridable (
(
{ pname, file, hash, kind, curlOpts ? "" }: { pname, file, hash, kind, curlOpts ? "" }:
let let
version = builtins.elemAt (builtins.split "-" file) 2; version = builtins.elemAt (builtins.split "-" file) 2;
@ -143,8 +140,7 @@ let
# file: filename including extension # file: filename including extension
# hash: SRI hash # hash: SRI hash
# kind: Language implementation and version tag https://www.python.org/dev/peps/pep-0427/#file-name-convention # kind: Language implementation and version tag https://www.python.org/dev/peps/pep-0427/#file-name-convention
fetchFromPypi = lib.makeOverridable fetchFromPypi = lib.makeOverridable (
(
{ pname, file, hash, kind }: { pname, file, hash, kind }:
if lib.strings.hasSuffix "whl" file then fetchWheelFromPypi { inherit pname file hash kind; } if lib.strings.hasSuffix "whl" file then fetchWheelFromPypi { inherit pname file hash kind; }
else else

View file

@ -58,7 +58,7 @@ pythonPackages.callPackage
binaryDist = selectWheel fileCandidates; binaryDist = selectWheel fileCandidates;
sourceDist = builtins.filter isSdist fileCandidates; sourceDist = builtins.filter isSdist fileCandidates;
eggs = builtins.filter isEgg fileCandidates; eggs = builtins.filter isEgg fileCandidates;
entries = ( if preferWheel then binaryDist ++ sourceDist else sourceDist ++ binaryDist) ++ eggs; entries = (if preferWheel then binaryDist ++ sourceDist else sourceDist ++ binaryDist) ++ eggs;
lockFileEntry = builtins.head entries; lockFileEntry = builtins.head entries;
_isEgg = isEgg lockFileEntry; _isEgg = isEgg lockFileEntry;
in in
@ -111,7 +111,8 @@ pythonPackages.callPackage
propagatedBuildInputs = propagatedBuildInputs =
let let
compat = isCompatible (poetryLib.getPythonVersion python); compat = isCompatible (poetryLib.getPythonVersion python);
deps = lib.filterAttrs (n: v: v) deps = lib.filterAttrs
(n: v: v)
( (
lib.mapAttrs lib.mapAttrs
( (
@ -120,7 +121,8 @@ pythonPackages.callPackage
constraints = v.python or ""; constraints = v.python or "";
in in
compat constraints compat constraints
) dependencies )
dependencies
); );
depAttrs = lib.attrNames deps; depAttrs = lib.attrNames deps;
in in

View file

@ -110,7 +110,8 @@ let
"The values in sources.json should not have an 'outPath' attribute" "The values in sources.json should not have an 'outPath' attribute"
else else
spec // { outPath = fetch config.pkgs name spec; } spec // { outPath = fetch config.pkgs name spec; }
) config.sources; )
config.sources;
# The "config" used by the fetchers # The "config" used by the fetchers
mkConfig = mkConfig =

View file

@ -6,16 +6,14 @@
self: super: self: super:
{ {
astroid = super.astroid.overridePythonAttrs astroid = super.astroid.overridePythonAttrs (
(
old: rec { old: rec {
buildInputs = old.buildInputs ++ [ self.pytest-runner ]; buildInputs = old.buildInputs ++ [ self.pytest-runner ];
doCheck = false; doCheck = false;
} }
); );
av = super.av.overridePythonAttrs av = super.av.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ nativeBuildInputs = old.nativeBuildInputs ++ [
pkgs.pkgconfig pkgs.pkgconfig
@ -24,8 +22,7 @@ self: super:
} }
); );
bcrypt = super.bcrypt.overridePythonAttrs bcrypt = super.bcrypt.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ pkgs.libffi ]; buildInputs = old.buildInputs ++ [ pkgs.libffi ];
} }
@ -34,16 +31,14 @@ self: super:
cffi = cffi =
# cffi is bundled with pypy # cffi is bundled with pypy
if self.python.implementation == "pypy" then null else ( if self.python.implementation == "pypy" then null else (
super.cffi.overridePythonAttrs super.cffi.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ pkgs.libffi ]; buildInputs = old.buildInputs ++ [ pkgs.libffi ];
} }
) )
); );
cftime = super.cftime.overridePythonAttrs cftime = super.cftime.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ buildInputs = old.buildInputs ++ [
self.cython self.cython
@ -51,8 +46,7 @@ self: super:
} }
); );
configparser = super.configparser.overridePythonAttrs configparser = super.configparser.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ buildInputs = old.buildInputs ++ [
self.toml self.toml
@ -64,16 +58,14 @@ self: super:
} }
); );
cryptography = super.cryptography.overridePythonAttrs cryptography = super.cryptography.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ pkgs.openssl ]; buildInputs = old.buildInputs ++ [ pkgs.openssl ];
} }
); );
django = ( django = (
super.django.overridePythonAttrs super.django.overridePythonAttrs (
(
old: { old: {
propagatedNativeBuildInputs = (old.propagatedNativeBuildInputs or [ ]) propagatedNativeBuildInputs = (old.propagatedNativeBuildInputs or [ ])
++ [ pkgs.gettext ]; ++ [ pkgs.gettext ];
@ -81,8 +73,7 @@ self: super:
) )
); );
django-bakery = super.django-bakery.overridePythonAttrs django-bakery = super.django-bakery.overridePythonAttrs (
(
old: { old: {
configurePhase = '' configurePhase = ''
if ! test -e LICENSE; then if ! test -e LICENSE; then
@ -92,8 +83,7 @@ self: super:
} }
); );
dlib = super.dlib.overridePythonAttrs dlib = super.dlib.overridePythonAttrs (
(
old: { old: {
# Parallel building enabled # Parallel building enabled
inherit (pkgs.python.pkgs.dlib) patches; inherit (pkgs.python.pkgs.dlib) patches;
@ -109,16 +99,14 @@ self: super:
# Environment markers are not always included (depending on how a dep was defined) # Environment markers are not always included (depending on how a dep was defined)
enum34 = if self.pythonAtLeast "3.4" then null else super.enum34; enum34 = if self.pythonAtLeast "3.4" then null else super.enum34;
faker = super.faker.overridePythonAttrs faker = super.faker.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ self.pytest-runner ]; buildInputs = old.buildInputs ++ [ self.pytest-runner ];
doCheck = false; doCheck = false;
} }
); );
fancycompleter = super.fancycompleter.overridePythonAttrs fancycompleter = super.fancycompleter.overridePythonAttrs (
(
old: { old: {
postPatch = '' postPatch = ''
substituteInPlace setup.py \ substituteInPlace setup.py \
@ -128,23 +116,20 @@ self: super:
} }
); );
fastparquet = super.fastparquet.overridePythonAttrs fastparquet = super.fastparquet.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ self.pytest-runner ]; buildInputs = old.buildInputs ++ [ self.pytest-runner ];
} }
); );
grandalf = super.grandalf.overridePythonAttrs grandalf = super.grandalf.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ self.pytest-runner ]; buildInputs = old.buildInputs ++ [ self.pytest-runner ];
doCheck = false; doCheck = false;
} }
); );
h5py = super.h5py.overridePythonAttrs h5py = super.h5py.overridePythonAttrs (
(
old: old:
if old.format != "wheel" then rec { if old.format != "wheel" then rec {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkgconfig ]; nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkgconfig ];
@ -156,15 +141,13 @@ self: super:
} else old } else old
); );
horovod = super.horovod.overridePythonAttrs horovod = super.horovod.overridePythonAttrs (
(
old: { old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.openmpi ]; propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.openmpi ];
} }
); );
imagecodecs = super.imagecodecs.overridePythonAttrs imagecodecs = super.imagecodecs.overridePythonAttrs (
(
old: { old: {
patchPhase = '' patchPhase = ''
substituteInPlace setup.py \ substituteInPlace setup.py \
@ -222,22 +205,19 @@ self: super:
); );
# importlib-metadata has an incomplete dependency specification # importlib-metadata has an incomplete dependency specification
importlib-metadata = super.importlib-metadata.overridePythonAttrs importlib-metadata = super.importlib-metadata.overridePythonAttrs (
(
old: { old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ lib.optional self.python.isPy2 self.pathlib2; propagatedBuildInputs = old.propagatedBuildInputs ++ lib.optional self.python.isPy2 self.pathlib2;
} }
); );
isort = super.isort.overridePythonAttrs isort = super.isort.overridePythonAttrs (
(
old: { old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.setuptools ]; propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.setuptools ];
} }
); );
jupyter = super.jupyter.overridePythonAttrs jupyter = super.jupyter.overridePythonAttrs (
(
old: rec { old: rec {
# jupyter is a meta-package. Everything relevant comes from the # jupyter is a meta-package. Everything relevant comes from the
# dependencies. It does however have a jupyter.py file that conflicts # dependencies. It does however have a jupyter.py file that conflicts
@ -246,8 +226,7 @@ self: super:
} }
); );
kiwisolver = super.kiwisolver.overridePythonAttrs kiwisolver = super.kiwisolver.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ buildInputs = old.buildInputs ++ [
# cppy is at the time of writing not in nixpkgs # cppy is at the time of writing not in nixpkgs
@ -256,8 +235,7 @@ self: super:
} }
); );
lap = super.lap.overridePythonAttrs lap = super.lap.overridePythonAttrs (
(
old: { old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [ propagatedBuildInputs = old.propagatedBuildInputs ++ [
self.numpy self.numpy
@ -265,8 +243,7 @@ self: super:
} }
); );
llvmlite = super.llvmlite.overridePythonAttrs llvmlite = super.llvmlite.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.llvm ]; nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.llvm ];
@ -289,30 +266,26 @@ self: super:
} }
); );
lockfile = super.lockfile.overridePythonAttrs lockfile = super.lockfile.overridePythonAttrs (
(
old: { old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.pbr ]; propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.pbr ];
} }
); );
lxml = super.lxml.overridePythonAttrs lxml = super.lxml.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = with pkgs; old.nativeBuildInputs ++ [ pkgconfig libxml2.dev libxslt.dev ]; nativeBuildInputs = with pkgs; old.nativeBuildInputs ++ [ pkgconfig libxml2.dev libxslt.dev ];
buildInputs = with pkgs; old.buildInputs ++ [ libxml2 libxslt ]; buildInputs = with pkgs; old.buildInputs ++ [ libxml2 libxslt ];
} }
); );
markupsafe = super.markupsafe.overridePythonAttrs markupsafe = super.markupsafe.overridePythonAttrs (
(
old: { old: {
src = old.src.override { pname = builtins.replaceStrings [ "markupsafe" ] [ "MarkupSafe" ] old.pname; }; src = old.src.override { pname = builtins.replaceStrings [ "markupsafe" ] [ "MarkupSafe" ] old.pname; };
} }
); );
matplotlib = super.matplotlib.overridePythonAttrs matplotlib = super.matplotlib.overridePythonAttrs (
(
old: old:
let let
enableGhostscript = old.passthru.enableGhostscript or false; enableGhostscript = old.passthru.enableGhostscript or false;
@ -353,16 +326,14 @@ self: super:
preferWheel = true; preferWheel = true;
}; };
mccabe = super.mccabe.overridePythonAttrs mccabe = super.mccabe.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ self.pytest-runner ]; buildInputs = old.buildInputs ++ [ self.pytest-runner ];
doCheck = false; doCheck = false;
} }
); );
netcdf4 = super.netcdf4.overridePythonAttrs netcdf4 = super.netcdf4.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ buildInputs = old.buildInputs ++ [
self.cython self.cython
@ -385,8 +356,7 @@ self: super:
} }
); );
numpy = super.numpy.overridePythonAttrs numpy = super.numpy.overridePythonAttrs (
(
old: old:
let let
blas = old.passthru.args.blas or pkgs.openblasCompat; blas = old.passthru.args.blas or pkgs.openblasCompat;
@ -394,7 +364,8 @@ self: super:
cfg = pkgs.writeTextFile { cfg = pkgs.writeTextFile {
name = "site.cfg"; name = "site.cfg";
text = ( text = (
lib.generators.toINI { } { lib.generators.toINI
{ } {
${blasImplementation} = { ${blasImplementation} = {
include_dirs = "${blas}/include"; include_dirs = "${blas}/include";
library_dirs = "${blas}/lib"; library_dirs = "${blas}/lib";
@ -420,16 +391,14 @@ self: super:
} }
); );
openexr = super.openexr.overridePythonAttrs openexr = super.openexr.overridePythonAttrs (
(
old: rec { old: rec {
buildInputs = old.buildInputs ++ [ pkgs.openexr pkgs.ilmbase ]; buildInputs = old.buildInputs ++ [ pkgs.openexr pkgs.ilmbase ];
NIX_CFLAGS_COMPILE = [ "-I${pkgs.openexr.dev}/include/OpenEXR" "-I${pkgs.ilmbase.dev}/include/OpenEXR" ]; NIX_CFLAGS_COMPILE = [ "-I${pkgs.openexr.dev}/include/OpenEXR" "-I${pkgs.ilmbase.dev}/include/OpenEXR" ];
} }
); );
peewee = super.peewee.overridePythonAttrs peewee = super.peewee.overridePythonAttrs (
(
old: old:
let let
withPostgres = old.passthru.withPostgres or false; withPostgres = old.passthru.withPostgres or false;
@ -443,31 +412,27 @@ self: super:
} }
); );
pillow = super.pillow.overridePythonAttrs pillow = super.pillow.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = [ pkgs.pkgconfig ] ++ old.nativeBuildInputs; nativeBuildInputs = [ pkgs.pkgconfig ] ++ old.nativeBuildInputs;
buildInputs = with pkgs; [ freetype libjpeg zlib libtiff libwebp tcl lcms2 ] ++ old.buildInputs; buildInputs = with pkgs; [ freetype libjpeg zlib libtiff libwebp tcl lcms2 ] ++ old.buildInputs;
} }
); );
psycopg2 = super.psycopg2.overridePythonAttrs psycopg2 = super.psycopg2.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.postgresql ]; nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.postgresql ];
} }
); );
psycopg2-binary = super.psycopg2-binary.overridePythonAttrs psycopg2-binary = super.psycopg2-binary.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.postgresql ]; nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.postgresql ];
} }
); );
pyarrow = pyarrow =
if lib.versionAtLeast super.pyarrow.version "0.16.0" then super.pyarrow.overridePythonAttrs if lib.versionAtLeast super.pyarrow.version "0.16.0" then super.pyarrow.overridePythonAttrs (
(
old: old:
let let
parseMinor = drv: lib.concatStringsSep "." (lib.take 2 (lib.splitVersion drv.version)); parseMinor = drv: lib.concatStringsSep "." (lib.take 2 (lib.splitVersion drv.version));
@ -508,8 +473,7 @@ self: super:
dontUseCmakeConfigure = true; dontUseCmakeConfigure = true;
} }
) else super.pyarrow.overridePythonAttrs ) else super.pyarrow.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ nativeBuildInputs = old.nativeBuildInputs ++ [
self.cython self.cython
@ -517,17 +481,14 @@ self: super:
} }
); );
pycairo = pycairo = (
(
drv: ( drv: (
drv.overridePythonAttrs drv.overridePythonAttrs (
(
_: { _: {
format = "other"; format = "other";
} }
) )
).overridePythonAttrs ).overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ nativeBuildInputs = old.nativeBuildInputs ++ [
@ -541,13 +502,13 @@ self: super:
pkgs.xlibsWrapper pkgs.xlibsWrapper
]; ];
mesonFlags = [ "-Dpython=${ if self.isPy3k then "python3" else "python"}" ]; mesonFlags = [ "-Dpython=${if self.isPy3k then "python3" else "python"}" ];
} }
) )
) super.pycairo; )
super.pycairo;
pycocotools = super.pycocotools.overridePythonAttrs pycocotools = super.pycocotools.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ buildInputs = old.buildInputs ++ [
self.cython self.cython
@ -556,24 +517,21 @@ self: super:
} }
); );
pygobject = super.pygobject.overridePythonAttrs pygobject = super.pygobject.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkgconfig ]; nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkgconfig ];
buildInputs = old.buildInputs ++ [ pkgs.glib pkgs.gobject-introspection ]; buildInputs = old.buildInputs ++ [ pkgs.glib pkgs.gobject-introspection ];
} }
); );
pylint = super.pylint.overridePythonAttrs pylint = super.pylint.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ self.pytest-runner ]; buildInputs = old.buildInputs ++ [ self.pytest-runner ];
doCheck = false; doCheck = false;
} }
); );
pyopenssl = super.pyopenssl.overridePythonAttrs pyopenssl = super.pyopenssl.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ pkgs.openssl ]; buildInputs = old.buildInputs ++ [ pkgs.openssl ];
} }
@ -587,8 +545,7 @@ self: super:
withWebKit = drv.passthru.args.withWebKit or false; withWebKit = drv.passthru.args.withWebKit or false;
withWebSockets = drv.passthru.args.withWebSockets or false; withWebSockets = drv.passthru.args.withWebSockets or false;
in in
super.pyqt5.overridePythonAttrs super.pyqt5.overridePythonAttrs (
(
old: { old: {
format = "other"; format = "other";
@ -682,8 +639,7 @@ self: super:
} }
); );
pytest-datadir = super.pytest-datadir.overridePythonAttrs pytest-datadir = super.pytest-datadir.overridePythonAttrs (
(
old: { old: {
postInstall = '' postInstall = ''
rm -f $out/LICENSE rm -f $out/LICENSE
@ -691,8 +647,7 @@ self: super:
} }
); );
pytest = super.pytest.overridePythonAttrs pytest = super.pytest.overridePythonAttrs (
(
old: { old: {
doCheck = false; doCheck = false;
} }
@ -700,8 +655,7 @@ self: super:
pytest-runner = super.pytest-runner or super.pytestrunner; pytest-runner = super.pytest-runner or super.pytestrunner;
python-jose = super.python-jose.overridePythonAttrs python-jose = super.python-jose.overridePythonAttrs (
(
old: { old: {
postPath = '' postPath = ''
substituteInPlace setup.py --replace "'pytest-runner'," "" substituteInPlace setup.py --replace "'pytest-runner'," ""
@ -710,8 +664,7 @@ self: super:
} }
); );
python-prctl = super.python-prctl.overridePythonAttrs python-prctl = super.python-prctl.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ buildInputs = old.buildInputs ++ [
pkgs.libcap pkgs.libcap
@ -719,16 +672,14 @@ self: super:
} }
); );
pyzmq = super.pyzmq.overridePythonAttrs pyzmq = super.pyzmq.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkgconfig ]; nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkgconfig ];
propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.zeromq ]; propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.zeromq ];
} }
); );
rockset = super.rockset.overridePythonAttrs rockset = super.rockset.overridePythonAttrs (
(
old: rec { old: rec {
postPatch = '' postPatch = ''
cp ./setup_rockset.py ./setup.py cp ./setup_rockset.py ./setup.py
@ -736,8 +687,7 @@ self: super:
} }
); );
scaleapi = super.scaleapi.overridePythonAttrs scaleapi = super.scaleapi.overridePythonAttrs (
(
old: { old: {
postPatch = '' postPatch = ''
substituteInPlace setup.py --replace "install_requires = ['requests>=2.4.2', 'enum34']" "install_requires = ['requests>=2.4.2']" || true substituteInPlace setup.py --replace "install_requires = ['requests>=2.4.2', 'enum34']" "install_requires = ['requests>=2.4.2']" || true
@ -745,15 +695,13 @@ self: super:
} }
); );
pandas = super.pandas.overridePythonAttrs pandas = super.pandas.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ self.cython ]; nativeBuildInputs = old.nativeBuildInputs ++ [ self.cython ];
} }
); );
panel = super.panel.overridePythonAttrs panel = super.panel.overridePythonAttrs (
(
old: { old: {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.nodejs ]; nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.nodejs ];
} }
@ -761,8 +709,7 @@ self: super:
# Pybind11 is an undeclared dependency of scipy that we need to pick from nixpkgs # Pybind11 is an undeclared dependency of scipy that we need to pick from nixpkgs
# Make it not fail with infinite recursion # Make it not fail with infinite recursion
pybind11 = super.pybind11.overridePythonAttrs pybind11 = super.pybind11.overridePythonAttrs (
(
old: { old: {
cmakeFlags = (old.cmakeFlags or [ ]) ++ [ cmakeFlags = (old.cmakeFlags or [ ]) ++ [
"-DPYBIND11_TEST=off" "-DPYBIND11_TEST=off"
@ -771,8 +718,7 @@ self: super:
} }
); );
scipy = super.scipy.overridePythonAttrs scipy = super.scipy.overridePythonAttrs (
(
old: old:
if old.format != "wheel" then { if old.format != "wheel" then {
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.gfortran ]; nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.gfortran ];
@ -790,8 +736,7 @@ self: super:
} else old } else old
); );
scikit-learn = super.scikit-learn.overridePythonAttrs scikit-learn = super.scikit-learn.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ buildInputs = old.buildInputs ++ [
pkgs.gfortran pkgs.gfortran
@ -808,8 +753,7 @@ self: super:
} }
); );
shapely = super.shapely.overridePythonAttrs shapely = super.shapely.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ [ pkgs.geos self.cython ]; buildInputs = old.buildInputs ++ [ pkgs.geos self.cython ];
inherit (pkgs.python3.pkgs.shapely) patches GEOS_LIBRARY_PATH; inherit (pkgs.python3.pkgs.shapely) patches GEOS_LIBRARY_PATH;
@ -818,16 +762,14 @@ self: super:
shellingham = shellingham =
if lib.versionAtLeast super.shellingham.version "1.3.2" then ( if lib.versionAtLeast super.shellingham.version "1.3.2" then (
super.shellingham.overridePythonAttrs super.shellingham.overridePythonAttrs (
(
old: { old: {
format = "pyproject"; format = "pyproject";
} }
) )
) else super.shellingham; ) else super.shellingham;
tables = super.tables.overridePythonAttrs tables = super.tables.overridePythonAttrs (
(
old: { old: {
HDF5_DIR = "${pkgs.hdf5}"; HDF5_DIR = "${pkgs.hdf5}";
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkgconfig ]; nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkgconfig ];
@ -835,8 +777,7 @@ self: super:
} }
); );
tensorpack = super.tensorpack.overridePythonAttrs tensorpack = super.tensorpack.overridePythonAttrs (
(
old: { old: {
postPatch = '' postPatch = ''
substituteInPlace setup.cfg --replace "# will call find_packages()" "" substituteInPlace setup.cfg --replace "# will call find_packages()" ""
@ -844,8 +785,7 @@ self: super:
} }
); );
urwidtrees = super.urwidtrees.overridePythonAttrs urwidtrees = super.urwidtrees.overridePythonAttrs (
(
old: { old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [ propagatedBuildInputs = old.propagatedBuildInputs ++ [
self.urwid self.urwid
@ -853,8 +793,7 @@ self: super:
} }
); );
vose-alias-method = super.vose-alias-method.overridePythonAttrs vose-alias-method = super.vose-alias-method.overridePythonAttrs (
(
old: { old: {
postInstall = '' postInstall = ''
rm -f $out/LICENSE rm -f $out/LICENSE
@ -862,8 +801,7 @@ self: super:
} }
); );
uvloop = super.uvloop.overridePythonAttrs uvloop = super.uvloop.overridePythonAttrs (
(
old: { old: {
buildInputs = old.buildInputs ++ lib.optionals stdenv.isDarwin [ buildInputs = old.buildInputs ++ lib.optionals stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.ApplicationServices pkgs.darwin.apple_sdk.frameworks.ApplicationServices
@ -877,8 +815,7 @@ self: super:
pkgs.python3.pkgs.override { pkgs.python3.pkgs.override {
python = self.python; python = self.python;
} }
).wheel.overridePythonAttrs ).wheel.overridePythonAttrs (
(
old: old:
if old.format == "other" then old else { if old.format == "other" then old else {
inherit (super.wheel) pname name version src; inherit (super.wheel) pname name version src;
@ -888,8 +825,7 @@ self: super:
zipp = zipp =
( (
if lib.versionAtLeast super.zipp.version "2.0.0" then ( if lib.versionAtLeast super.zipp.version "2.0.0" then (
super.zipp.overridePythonAttrs super.zipp.overridePythonAttrs (
(
old: { old: {
prePatch = '' prePatch = ''
substituteInPlace setup.py --replace \ substituteInPlace setup.py --replace \
@ -899,8 +835,7 @@ self: super:
} }
) )
) else super.zipp ) else super.zipp
).overridePythonAttrs ).overridePythonAttrs (
(
old: { old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [ propagatedBuildInputs = old.propagatedBuildInputs ++ [
self.toml self.toml

View file

@ -37,14 +37,17 @@ let
# Make a tree out of expression groups (parens) # Make a tree out of expression groups (parens)
findSubExpressions = expr: findSubExpressions = expr:
let let
acc = builtins.foldl' findSubExpressionsFun { acc = builtins.foldl'
findSubExpressionsFun
{
exprs = [ ]; exprs = [ ];
expr = expr; expr = expr;
pos = 0; pos = 0;
openP = 0; openP = 0;
exprPos = 0; exprPos = 0;
startPos = 0; startPos = 0;
} (lib.stringToCharacters expr); }
(lib.stringToCharacters expr);
tailExpr = (substr acc.exprPos acc.pos expr); tailExpr = (substr acc.exprPos acc.pos expr);
tailExprs = if tailExpr != "" then [ tailExpr ] else [ ]; tailExprs = if tailExpr != "" then [ tailExpr ] else [ ];
in in
@ -53,7 +56,7 @@ let
let let
splitCond = ( splitCond = (
s: builtins.map s: builtins.map
(x: stripStr ( if builtins.typeOf x == "list" then (builtins.elemAt x 0) else x)) (x: stripStr (if builtins.typeOf x == "list" then (builtins.elemAt x 0) else x))
(builtins.split " (and|or) " (s + " ")) (builtins.split " (and|or) " (s + " "))
); );
mapfn = expr: ( mapfn = expr: (
@ -71,8 +74,9 @@ let
in in
builtins.foldl' builtins.foldl'
( (
acc: v: acc ++ ( if builtins.typeOf v == "string" then parse v else [ (parseExpressions v) ]) acc: v: acc ++ (if builtins.typeOf v == "string" then parse v else [ (parseExpressions v) ])
) [ ] exprs; ) [ ]
exprs;
# Transform individual expressions to structured expressions # Transform individual expressions to structured expressions
# This function also performs variable substitution, replacing environment markers with their explicit values # This function also performs variable substitution, replacing environment markers with their explicit values
@ -159,8 +163,7 @@ let
let let
parts = builtins.splitVersion c; parts = builtins.splitVersion c;
pruned = lib.take ((builtins.length parts) - 1) parts; pruned = lib.take ((builtins.length parts) - 1) parts;
upper = builtins.toString upper = builtins.toString (
(
(lib.toInt (builtins.elemAt pruned (builtins.length pruned - 1))) + 1 (lib.toInt (builtins.elemAt pruned (builtins.length pruned - 1))) + 1
); );
upperConstraint = builtins.concatStringsSep "." (ireplace (builtins.length pruned - 1) upper pruned); upperConstraint = builtins.concatStringsSep "." (ireplace (builtins.length pruned - 1) upper pruned);
@ -207,10 +210,13 @@ let
) else throw "Unsupported type" ) else throw "Unsupported type"
) else if builtins.typeOf v == "list" then ( ) else if builtins.typeOf v == "list" then (
let let
ret = builtins.foldl' reduceExpressionsFun { ret = builtins.foldl'
reduceExpressionsFun
{
value = true; value = true;
cond = "and"; cond = "and";
} v; }
v;
in in
acc // { acc // {
value = cond."${acc.cond}" acc.value ret.value; value = cond."${acc.cond}" acc.value ret.value;
@ -219,10 +225,13 @@ let
); );
in in
( (
builtins.foldl' reduceExpressionsFun { builtins.foldl'
reduceExpressionsFun
{
value = true; value = true;
cond = "and"; cond = "and";
} exprs }
exprs
).value; ).value;
in in
e: builtins.foldl' (acc: v: v acc) e [ e: builtins.foldl' (acc: v: v acc) e [

View file

@ -39,8 +39,7 @@ let
# Prune constraint # Prune constraint
parts = builtins.splitVersion c; parts = builtins.splitVersion c;
pruned = lib.take ((builtins.length parts) - 1) parts; pruned = lib.take ((builtins.length parts) - 1) parts;
upper = builtins.toString upper = builtins.toString (
(
(lib.toInt (builtins.elemAt pruned (builtins.length pruned - 1))) + 1 (lib.toInt (builtins.elemAt pruned (builtins.length pruned - 1))) + 1
); );
upperConstraint = builtins.concatStringsSep "." (ireplace (builtins.length pruned - 1) upper pruned); upperConstraint = builtins.concatStringsSep "." (ireplace (builtins.length pruned - 1) upper pruned);
@ -82,6 +81,7 @@ let
satisfiesSemver = version: constraint: satisfiesSemver = version: constraint:
let let
inherit (parseConstraint constraint) op v; inherit (parseConstraint constraint) op v;
in if constraint == "*" then true else operators."${op}" version v; in
if constraint == "*" then true else operators."${op}" version v;
in in
{ inherit satisfiesSemver; } { inherit satisfiesSemver; }

View file

@ -11,8 +11,7 @@ poetry2nix.mkPoetryApplication {
(import ./poetry-git-overlay.nix { inherit pkgs; }) (import ./poetry-git-overlay.nix { inherit pkgs; })
( (
self: super: { self: super: {
pyramid-deferred-sqla = super.pyramid-deferred-sqla.overridePythonAttrs pyramid-deferred-sqla = super.pyramid-deferred-sqla.overridePythonAttrs (
(
old: { old: {
postPatch = '' postPatch = ''
touch LICENSE touch LICENSE

View file

@ -1,8 +1,7 @@
{ pkgs }: { pkgs }:
self: super: { self: super: {
pyramid-deferred-sqla = super.pyramid-deferred-sqla.overridePythonAttrs pyramid-deferred-sqla = super.pyramid-deferred-sqla.overridePythonAttrs (
(
_: { _: {
src = pkgs.fetchgit { src = pkgs.fetchgit {
url = "https://github.com/niteoweb/pyramid_deferred_sqla.git"; url = "https://github.com/niteoweb/pyramid_deferred_sqla.git";

View file

@ -1,7 +1,7 @@
{ pkgs ? import <nixpkgs> { } }: { pkgs ? import <nixpkgs> { } }:
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; };
pep425 = pkgs.callPackage ../pep425.nix { }; pep425 = pkgs.callPackage ../pep425.nix { };
pep425Python37 = pkgs.callPackage ../pep425.nix { python = pkgs.python37; }; pep425Python37 = pkgs.callPackage ../pep425.nix { python = pkgs.python37; };
pep425OSX = pkgs.callPackage ../pep425.nix { isLinux = false; }; pep425OSX = pkgs.callPackage ../pep425.nix { isLinux = false; };
@ -15,7 +15,7 @@ builtins.removeAttrs
override-default = callTest ./override-default-support { }; override-default = callTest ./override-default-support { };
top-packages-1 = callTest ./common-pkgs-1 { }; top-packages-1 = callTest ./common-pkgs-1 { };
top-packages-2 = callTest ./common-pkgs-2 { }; top-packages-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 { };
git-deps = callTest ./git-deps { }; git-deps = callTest ./git-deps { };
git-deps-pinned = callTest ./git-deps-pinned { }; git-deps-pinned = callTest ./git-deps-pinned { };
@ -49,4 +49,5 @@ builtins.removeAttrs
# manylinux requires nixpkgs with https://github.com/NixOS/nixpkgs/pull/75763 # manylinux requires nixpkgs with https://github.com/NixOS/nixpkgs/pull/75763
# Once this is available in 19.09 and unstable we can re-enable the manylinux test # Once this is available in 19.09 and unstable we can re-enable the manylinux test
manylinux = callTest ./manylinux { }; manylinux = callTest ./manylinux { };
} skipTests }
skipTests

View file

@ -9,8 +9,7 @@ let
# Test support for overriding the app passed to the environment # Test support for overriding the app passed to the environment
overridden = ( overridden = (
app.overrideAttrs app.overrideAttrs (old: {
(old: {
name = "${old.pname}-overridden-${old.version}"; name = "${old.pname}-overridden-${old.version}";
}) })
); );
@ -18,7 +17,8 @@ let
app = overridden; app = overridden;
}; };
in in
runCommand "app-env-test" { } '' runCommand "app-env-test"
{ } ''
${depEnv}/bin/gunicorn --bind=unix:socket trivial:app & ${depEnv}/bin/gunicorn --bind=unix:socket trivial:app &
sleep 1 sleep 1
${curl}/bin/curl --unix-socket socket localhost ${curl}/bin/curl --unix-socket socket localhost

View file

@ -13,7 +13,8 @@ let
}; };
}; };
in in
runCommand "env-test" { } '' runCommand "env-test"
{ } ''
cp -r --no-preserve=mode ${./src} src cp -r --no-preserve=mode ${./src} src
echo 'print("Changed")' > src/trivial/__main__.py echo 'print("Changed")' > src/trivial/__main__.py
if [[ $(${env}/bin/python -m trivial) != "Changed" ]]; then if [[ $(${env}/bin/python -m trivial) != "Changed" ]]; then

View file

@ -7,7 +7,8 @@ let
src = lib.cleanSource ./.; src = lib.cleanSource ./.;
}; };
in in
runCommandNoCC "egg-test" { } '' runCommandNoCC "egg-test"
{ } ''
${drv}/bin/egg-test ${drv}/bin/egg-test
touch $out touch $out
'' ''

View file

@ -6,7 +6,8 @@ let
poetrylock = ./poetry.lock; poetrylock = ./poetry.lock;
}; };
in in
runCommand "env-test" { } '' runCommand "env-test"
{ } ''
${env}/bin/python -c 'import alembic' ${env}/bin/python -c 'import alembic'
touch $out touch $out
'' ''

View file

@ -6,7 +6,6 @@ poetry2nix.mkPoetryApplication {
poetrylock = ./poetry.lock; poetrylock = ./poetry.lock;
src = lib.cleanSource ./.; src = lib.cleanSource ./.;
overrides = poetry2nix.overrides.withDefaults overrides = poetry2nix.overrides.withDefaults (import ./poetry-git-overlay.nix { inherit pkgs; });
(import ./poetry-git-overlay.nix { inherit pkgs; });
} }

View file

@ -1,8 +1,7 @@
{ pkgs }: { pkgs }:
self: super: { self: super: {
alembic = super.alembic.overrideAttrs alembic = super.alembic.overrideAttrs (
(
_: { _: {
src = pkgs.fetchgit { src = pkgs.fetchgit {
url = "https://github.com/sqlalchemy/alembic.git"; url = "https://github.com/sqlalchemy/alembic.git";

View file

@ -8,7 +8,8 @@ let
}; };
p = pkg.python.withPackages (ps: [ ps.numpy ps.opencv-python ]); p = pkg.python.withPackages (ps: [ ps.numpy ps.opencv-python ]);
in in
runCommand "test" { } '' runCommand "test"
{ } ''
${p}/bin/python -c "import cv2" ${p}/bin/python -c "import cv2"
touch $out touch $out
'' ''

View file

@ -7,11 +7,9 @@ let
pyproject = ./pyproject.toml; pyproject = ./pyproject.toml;
overrides = [ overrides = [
( (
poetry2nix.defaultPoetryOverrides.overrideOverlay poetry2nix.defaultPoetryOverrides.overrideOverlay (
(
self: super: { self: super: {
alembic = super.alembic.overrideAttrs alembic = super.alembic.overrideAttrs (
(
old: { old: {
TESTING_FOOBAR = 42; TESTING_FOOBAR = 42;
} }
@ -22,7 +20,8 @@ let
]; ];
}; };
in in
runCommand "test" { } '' runCommand "test"
{ } ''
x=${builtins.toString (p.python.pkgs.alembic.TESTING_FOOBAR)} x=${builtins.toString (p.python.pkgs.alembic.TESTING_FOOBAR)}
[ "$x" = "42" ] || exit 1 [ "$x" = "42" ] || exit 1
mkdir $out mkdir $out

View file

@ -5,11 +5,9 @@ let
src = ./.; src = ./.;
poetrylock = ./poetry.lock; poetrylock = ./poetry.lock;
pyproject = ./pyproject.toml; pyproject = ./pyproject.toml;
overrides = poetry2nix.overrides.withDefaults overrides = poetry2nix.overrides.withDefaults (
(
self: super: { self: super: {
alembic = super.alembic.overrideAttrs alembic = super.alembic.overrideAttrs (
(
old: { old: {
TESTING_FOOBAR = 42; TESTING_FOOBAR = 42;
} }
@ -18,7 +16,8 @@ let
); );
}; };
in in
runCommand "test" { } '' runCommand "test"
{ } ''
x=${builtins.toString (p.python.pkgs.alembic.TESTING_FOOBAR)} x=${builtins.toString (p.python.pkgs.alembic.TESTING_FOOBAR)}
[ "$x" = "42" ] || exit 1 [ "$x" = "42" ] || exit 1
mkdir $out mkdir $out

View file

@ -17,4 +17,4 @@ let
}; };
isWheelAttr = drv.passthru.python.pkgs.maturin.src.isWheel or false; isWheelAttr = drv.passthru.python.pkgs.maturin.src.isWheel or false;
in in
assert isWheelAttr; drv assert isWheelAttr; drv

View file

@ -6,4 +6,4 @@ let
}; };
isWheelAttr = py.python.pkgs.tensorflow.src.isWheel or false; isWheelAttr = py.python.pkgs.tensorflow.src.isWheel or false;
in in
assert isWheelAttr; (py.python.withPackages (_: py.poetryPackages)).override (args: { ignoreCollisions = true; }) assert isWheelAttr; (py.python.withPackages (_: py.poetryPackages)).override (args: { ignoreCollisions = true; })

View file

@ -13,8 +13,7 @@ in
release = release =
let let
pythonEnv = pkgs.python3.withPackages pythonEnv = pkgs.python3.withPackages (
(
ps: [ ps: [
ps.pythonix ps.pythonix
] ]
@ -56,7 +55,8 @@ in
pkgs.python3 pkgs.python3
pkgs.nix pkgs.nix
]; ];
nixSrc = pkgs.runCommandNoCC "${pkgs.nix.name}-sources" { } '' nixSrc = pkgs.runCommandNoCC "${pkgs.nix.name}-sources"
{ } ''
mkdir $out mkdir $out
tar -x --strip=1 -f ${pkgs.nix.src} -C $out tar -x --strip=1 -f ${pkgs.nix.src} -C $out
''; '';