Merge pull request #111649 from tweag/poetry2nix-1_15_0

poetry2nix: 1.14.0 -> 1.15.2

authored by

adisbladis and committed by
GitHub
eeea7b19 add90df4

+234 -53
+1
.github/CODEOWNERS
··· 76 /pkgs/development/interpreters/python @FRidh 77 /pkgs/development/python-modules @FRidh @jonringer 78 /doc/languages-frameworks/python.section.md @FRidh 79 80 # Haskell 81 /pkgs/development/compilers/ghc @cdepillabout
··· 76 /pkgs/development/interpreters/python @FRidh 77 /pkgs/development/python-modules @FRidh @jonringer 78 /doc/languages-frameworks/python.section.md @FRidh 79 + /pkgs/development/tools/poetry2nix @adisbladis 80 81 # Haskell 82 /pkgs/development/compilers/ghc @cdepillabout
+57 -28
pkgs/development/tools/poetry2nix/poetry2nix/default.nix
··· 1 { pkgs ? import <nixpkgs> { } 2 , lib ? pkgs.lib 3 , poetry ? null 4 - , poetryLib ? import ./lib.nix { inherit lib pkgs; } 5 }: 6 let 7 inherit (poetryLib) isCompatible readTOML moduleName; ··· 71 lib.makeScope pkgs.newScope (self: { 72 73 # Poetry2nix version 74 - version = "1.14.0"; 75 76 /* 77 Returns an attrset { python, poetryPackages, pyProject, poetryLock } for the given pyproject/lockfile. ··· 84 , python ? pkgs.python3 85 , pwd ? projectDir 86 , preferWheels ? false 87 , __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping 88 }@attrs: 89 let 90 poetryPkg = poetry.override { inherit python; }; 91 pyProject = readTOML pyproject; 92 poetryLock = readTOML poetrylock; 93 lockFiles = 94 let ··· 180 181 inputAttrs = mkInputAttrs { inherit py pyProject; attrs = { }; includeBuildSystem = false; }; 182 183 in 184 { 185 python = py; 186 - poetryPackages = builtins.foldl' (acc: v: acc ++ v) [ ] (lib.attrValues inputAttrs); 187 poetryLock = poetryLock; 188 inherit pyProject; 189 }; ··· 203 , pwd ? projectDir 204 , python ? pkgs.python3 205 , preferWheels ? false 206 - # Example: { my-app = ./src; } 207 , editablePackageSources ? { } 208 }: 209 let 210 - py = self.mkPoetryPackages ( 211 - { 212 - inherit pyproject poetrylock overrides python pwd preferWheels; 213 - } 214 - ); 215 - 216 - inherit (py) pyProject; 217 - 218 - # Add executables from tool.poetry.scripts 219 - scripts = pyProject.tool.poetry.scripts or { }; 220 - hasScripts = scripts != { }; 221 - scriptsPackage = import ./shell-scripts.nix { 222 - inherit scripts lib; 223 - inherit (py) python; 224 }; 225 226 - hasEditable = editablePackageSources != { }; 227 - editablePackage = import ./editable.nix { 228 - inherit pkgs lib poetryLib editablePackageSources; 229 - inherit (py) pyProject python; 230 - }; 231 232 in 233 - py.python.withPackages ( 234 - _: py.poetryPackages 235 - ++ lib.optional hasEditable editablePackage 236 - ++ lib.optional hasScripts scriptsPackage 237 - ); 238 239 /* Creates a Python application from pyproject.toml and poetry.lock 240
··· 1 { pkgs ? import <nixpkgs> { } 2 , lib ? pkgs.lib 3 , poetry ? null 4 + , poetryLib ? import ./lib.nix { inherit lib pkgs; stdenv = pkgs.stdenv; } 5 }: 6 let 7 inherit (poetryLib) isCompatible readTOML moduleName; ··· 71 lib.makeScope pkgs.newScope (self: { 72 73 # Poetry2nix version 74 + version = "1.15.2"; 75 + 76 + /* Returns a package of editable sources whose changes will be available without needing to restart the 77 + nix-shell. 78 + In editablePackageSources you can pass a mapping from package name to source directory to have 79 + those packages available in the resulting environment, whose source changes are immediately available. 80 + 81 + */ 82 + mkPoetryEditablePackage = 83 + { projectDir ? null 84 + , pyproject ? projectDir + "/pyproject.toml" 85 + , python ? pkgs.python3 86 + , pyProject ? readTOML pyproject 87 + # Example: { my-app = ./src; } 88 + , editablePackageSources 89 + }: 90 + assert editablePackageSources != { }; 91 + import ./editable.nix { 92 + inherit pyProject python pkgs lib poetryLib editablePackageSources; 93 + }; 94 + 95 + /* Returns a package containing scripts defined in tool.poetry.scripts. 96 + */ 97 + mkPoetryScriptsPackage = 98 + { projectDir ? null 99 + , pyproject ? projectDir + "/pyproject.toml" 100 + , python ? pkgs.python3 101 + , pyProject ? readTOML pyproject 102 + , scripts ? pyProject.tool.poetry.scripts 103 + }: 104 + assert scripts != { }; 105 + import ./shell-scripts.nix { 106 + inherit lib python scripts; 107 + }; 108 109 /* 110 Returns an attrset { python, poetryPackages, pyProject, poetryLock } for the given pyproject/lockfile. ··· 117 , python ? pkgs.python3 118 , pwd ? projectDir 119 , preferWheels ? false 120 + # Example: { my-app = ./src; } 121 + , editablePackageSources ? { } 122 , __isBootstrap ? false # Hack: Always add Poetry as a build input unless bootstrapping 123 }@attrs: 124 let 125 poetryPkg = poetry.override { inherit python; }; 126 pyProject = readTOML pyproject; 127 + 128 + scripts = pyProject.tool.poetry.scripts or { }; 129 + hasScripts = scripts != { }; 130 + scriptsPackage = self.mkPoetryScriptsPackage { 131 + inherit python scripts; 132 + }; 133 + 134 + hasEditable = editablePackageSources != { }; 135 + editablePackage = self.mkPoetryEditablePackage { 136 + inherit pyProject python editablePackageSources; 137 + }; 138 + 139 poetryLock = readTOML poetrylock; 140 lockFiles = 141 let ··· 227 228 inputAttrs = mkInputAttrs { inherit py pyProject; attrs = { }; includeBuildSystem = false; }; 229 230 + storePackages = builtins.foldl' (acc: v: acc ++ v) [ ] (lib.attrValues inputAttrs); 231 in 232 { 233 python = py; 234 + poetryPackages = storePackages 235 + ++ lib.optional hasScripts scriptsPackage 236 + ++ lib.optional hasEditable editablePackage; 237 poetryLock = poetryLock; 238 inherit pyProject; 239 }; ··· 253 , pwd ? projectDir 254 , python ? pkgs.python3 255 , preferWheels ? false 256 , editablePackageSources ? { } 257 }: 258 let 259 + poetryPython = self.mkPoetryPackages { 260 + inherit pyproject poetrylock overrides python pwd preferWheels editablePackageSources; 261 }; 262 263 + inherit (poetryPython) poetryPackages; 264 265 in 266 + poetryPython.python.withPackages (_: poetryPackages); 267 268 /* Creates a Python application from pyproject.toml and poetry.lock 269
+19 -1
pkgs/development/tools/poetry2nix/poetry2nix/lib.nix
··· 1 - { lib, pkgs }: 2 let 3 inherit (import ./semver.nix { inherit lib ireplace; }) satisfiesSemver; 4 inherit (builtins) genList length; ··· 194 inherit src; 195 }; 196 }; 197 in 198 { 199 inherit ··· 207 cleanPythonSources 208 moduleName 209 getPythonVersion 210 ; 211 }
··· 1 + { lib, pkgs, stdenv }: 2 let 3 inherit (import ./semver.nix { inherit lib ireplace; }) satisfiesSemver; 4 inherit (builtins) genList length; ··· 194 inherit src; 195 }; 196 }; 197 + 198 + # Maps Nixpkgs CPU values to target machines known to be supported for manylinux* wheels. 199 + # (a.k.a. `uname -m` output from CentOS 7) 200 + # 201 + # This is current as of manylinux2014 (PEP-0599), and is a superset of manylinux2010 / manylinux1. 202 + # s390x is not supported in Nixpkgs, so we don't map it. 203 + manyLinuxTargetMachines = { 204 + x86_64 = "x86_64"; 205 + i686 = "i686"; 206 + aarch64 = "aarch64"; 207 + armv7l = "armv7l"; 208 + powerpc64 = "ppc64"; 209 + powerpc64le = "ppc64le"; 210 + }; 211 + 212 + # Machine tag for our target platform (if available) 213 + targetMachine = manyLinuxTargetMachines.${stdenv.targetPlatform.parsed.cpu.name} or null; 214 in 215 { 216 inherit ··· 224 cleanPythonSources 225 moduleName 226 getPythonVersion 227 + targetMachine 228 ; 229 }
+2 -2
pkgs/development/tools/poetry2nix/poetry2nix/mk-poetry-dep.nix
··· 31 inherit (poetryLib) isCompatible getManyLinuxDeps fetchFromPypi moduleName; 32 33 inherit (import ./pep425.nix { 34 - inherit lib python; 35 inherit (pkgs) stdenv; 36 }) selectWheel 37 ; ··· 161 builtins.fetchGit { 162 inherit (source) url; 163 rev = source.resolved_reference or source.reference; 164 - ref = sourceSpec.branch or sourceSpec.rev or sourceSpec.tag or "HEAD"; 165 } 166 ) 167 else if isUrl then
··· 31 inherit (poetryLib) isCompatible getManyLinuxDeps fetchFromPypi moduleName; 32 33 inherit (import ./pep425.nix { 34 + inherit lib poetryLib python; 35 inherit (pkgs) stdenv; 36 }) selectWheel 37 ; ··· 161 builtins.fetchGit { 162 inherit (source) url; 163 rev = source.resolved_reference or source.reference; 164 + ref = sourceSpec.branch or sourceSpec.rev or (if sourceSpec?tag then "refs/tags/${sourceSpec.tag}" else "HEAD"); 165 } 166 ) 167 else if isUrl then
+138 -11
pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
··· 132 } 133 ); 134 135 dictdiffer = super.dictdiffer.overridePythonAttrs ( 136 old: { 137 buildInputs = old.buildInputs ++ [ self.pytest-runner ]; ··· 235 old: 236 if old.format != "wheel" then rec { 237 nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkg-config ]; 238 - buildInputs = old.buildInputs ++ [ pkgs.hdf5 self.pkg-config self.cython ]; 239 configure_flags = "--hdf5=${pkgs.hdf5}"; 240 postConfigure = '' 241 ${self.python.executable} setup.py configure ${configure_flags} ··· 407 export LLVM_CONFIG=${pkgs.llvm}/bin/llvm-config 408 ''; 409 410 - __impureHostDeps = pkgs.lib.optionals pkgs.stdenv.isDarwin [ "/usr/lib/libm.dylib" ]; 411 412 passthru = old.passthru // { llvm = pkgs.llvm; }; 413 } ··· 549 } 550 ); 551 552 netcdf4 = super.netcdf4.overridePythonAttrs ( 553 old: { 554 buildInputs = old.buildInputs ++ [ ··· 615 } 616 ); 617 618 parsel = super.parsel.overridePythonAttrs ( 619 old: rec { 620 nativeBuildInputs = old.nativeBuildInputs ++ [ self.pytest-runner ]; ··· 642 } 643 ); 644 645 poetry-core = super.poetry-core.overridePythonAttrs (old: { 646 # "Vendor" dependencies (for build-system support) 647 postPatch = '' ··· 972 973 pytest = super.pytest.overridePythonAttrs ( 974 old: { 975 doCheck = false; 976 } 977 ); ··· 996 } 997 ); 998 999 ffmpeg-python = super.ffmpeg-python.overridePythonAttrs ( 1000 old: { 1001 buildInputs = old.buildInputs ++ [ self.pytest-runner ]; ··· 1168 # is explicitly disabled with USE_CUDA=0. 1169 find $out -name "*.so" -exec ${pkgs.patchelf}/bin/patchelf --remove-needed libcuda.so.1 {} \; 1170 ''; 1171 - buildInputs = old.buildInputs ++ lib.optionals enableCuda [ 1172 pkgs.linuxPackages.nvidia_x11 1173 pkgs.nccl.dev 1174 pkgs.nccl.out 1175 ]; 1176 propagatedBuildInputs = [ 1177 - super.numpy 1178 - super.future 1179 ]; 1180 }) 1181 ) ··· 1257 format = "wheel"; 1258 }; 1259 # If "wheel" is built from source 1260 - sourcePackage = ( 1261 pkgs.python3.pkgs.override { 1262 python = self.python; 1263 } 1264 - ).wheel.overridePythonAttrs ( 1265 - old: { 1266 - inherit (super.wheel) pname name version src; 1267 - } 1268 - ); 1269 in 1270 if isWheel then wheelPackage else sourcePackage; 1271 ··· 1303 } 1304 ); 1305 1306 supervisor = super.supervisor.overridePythonAttrs ( 1307 old: { 1308 propagatedBuildInputs = old.propagatedBuildInputs ++ [ ··· 1317 propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.toolz ]; 1318 } 1319 ); 1320 }
··· 132 } 133 ); 134 135 + datadog-lambda = super.datadog-lambda.overridePythonAttrs (old: { 136 + postPatch = '' 137 + substituteInPlace setup.py --replace "setuptools==" "setuptools>=" 138 + ''; 139 + buildInputs = old.buildInputs ++ [ self.setuptools ]; 140 + }); 141 + 142 + ddtrace = super.ddtrace.overridePythonAttrs (old: { 143 + buildInputs = old.buildInputs ++ 144 + (pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.IOKit ]) ++ [ self.cython ]; 145 + }); 146 + 147 dictdiffer = super.dictdiffer.overridePythonAttrs ( 148 old: { 149 buildInputs = old.buildInputs ++ [ self.pytest-runner ]; ··· 247 old: 248 if old.format != "wheel" then rec { 249 nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkg-config ]; 250 + buildInputs = old.buildInputs ++ [ pkgs.hdf5 self.pkgconfig self.cython ]; 251 configure_flags = "--hdf5=${pkgs.hdf5}"; 252 postConfigure = '' 253 ${self.python.executable} setup.py configure ${configure_flags} ··· 419 export LLVM_CONFIG=${pkgs.llvm}/bin/llvm-config 420 ''; 421 422 + __impureHostDeps = lib.optionals pkgs.stdenv.isDarwin [ "/usr/lib/libm.dylib" ]; 423 424 passthru = old.passthru // { llvm = pkgs.llvm; }; 425 } ··· 561 } 562 ); 563 564 + mysqlclient = super.mysqlclient.overridePythonAttrs ( 565 + old: { 566 + buildInputs = old.buildInputs ++ [ pkgs.libmysqlclient ]; 567 + } 568 + ); 569 + 570 netcdf4 = super.netcdf4.overridePythonAttrs ( 571 old: { 572 buildInputs = old.buildInputs ++ [ ··· 633 } 634 ); 635 636 + osqp = super.osqp.overridePythonAttrs ( 637 + old: { 638 + nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.cmake ]; 639 + dontUseCmakeConfigure = true; 640 + } 641 + ); 642 + 643 parsel = super.parsel.overridePythonAttrs ( 644 old: rec { 645 nativeBuildInputs = old.nativeBuildInputs ++ [ self.pytest-runner ]; ··· 667 } 668 ); 669 670 + # Work around https://github.com/nix-community/poetry2nix/issues/244 671 + # where git deps are not picked up as they should 672 + pip = 673 + if lib.versionAtLeast super.pip.version "20.3" then 674 + super.pip.overridePythonAttrs 675 + (old: 676 + let 677 + pname = "pip"; 678 + version = "20.2.4"; 679 + in 680 + { 681 + name = pname + "-" + version; 682 + inherit version; 683 + src = pkgs.fetchFromGitHub { 684 + owner = "pypa"; 685 + repo = pname; 686 + rev = version; 687 + sha256 = "eMVV4ftgV71HLQsSeaOchYlfaJVgzNrwUynn3SA1/Do="; 688 + name = "${pname}-${version}-source"; 689 + }; 690 + }) else super.pip; 691 + 692 poetry-core = super.poetry-core.overridePythonAttrs (old: { 693 # "Vendor" dependencies (for build-system support) 694 postPatch = '' ··· 1019 1020 pytest = super.pytest.overridePythonAttrs ( 1021 old: { 1022 + # Fixes https://github.com/pytest-dev/pytest/issues/7891 1023 + postPatch = old.postPatch or "" + '' 1024 + sed -i '/\[metadata\]/aversion = ${old.version}' setup.cfg 1025 + ''; 1026 doCheck = false; 1027 } 1028 ); ··· 1047 } 1048 ); 1049 1050 + # pytest-splinter seems to put a .marker file in an empty directory 1051 + # presumably so it's tracked by and can be installed with MANIFEST.in, see 1052 + # https://github.com/pytest-dev/pytest-splinter/commit/a48eeef662f66ff9d3772af618748e73211a186b 1053 + # 1054 + # This directory then gets used as an empty initial profile directory and is 1055 + # zipped up. But if the .marker file is in the Nix store, it has the 1056 + # creation date of 1970, and Zip doesn't work with such old files, so it 1057 + # fails at runtime! 1058 + # 1059 + # We fix this here by just removing the file after the installation 1060 + # 1061 + # The error you get without this is: 1062 + # 1063 + # E ValueError: ZIP does not support timestamps before 1980 1064 + # /nix/store/55b9ip7xkpimaccw9pa0vacy5q94f5xa-python3-3.7.6/lib/python3.7/zipfile.py:357: ValueError 1065 + pytest-splinter = super.pytest-splinter.overrideAttrs (old: { 1066 + postInstall = old.postInstall or "" + '' 1067 + rm $out/${super.python.sitePackages}/pytest_splinter/profiles/firefox/.marker 1068 + ''; 1069 + }); 1070 + 1071 + 1072 ffmpeg-python = super.ffmpeg-python.overridePythonAttrs ( 1073 old: { 1074 buildInputs = old.buildInputs ++ [ self.pytest-runner ]; ··· 1241 # is explicitly disabled with USE_CUDA=0. 1242 find $out -name "*.so" -exec ${pkgs.patchelf}/bin/patchelf --remove-needed libcuda.so.1 {} \; 1243 ''; 1244 + buildInputs = (old.buildInputs or [ ]) 1245 + ++ [ self.typing-extensions ] 1246 + ++ lib.optionals enableCuda [ 1247 pkgs.linuxPackages.nvidia_x11 1248 pkgs.nccl.dev 1249 pkgs.nccl.out 1250 ]; 1251 propagatedBuildInputs = [ 1252 + self.numpy 1253 + self.future 1254 ]; 1255 }) 1256 ) ··· 1332 format = "wheel"; 1333 }; 1334 # If "wheel" is built from source 1335 + sourcePackage = (( 1336 pkgs.python3.pkgs.override { 1337 python = self.python; 1338 } 1339 + ).wheel.override { 1340 + inherit (self) buildPythonPackage bootstrapped-pip setuptools; 1341 + }).overrideAttrs (old: { 1342 + inherit (super.wheel) pname name version src; 1343 + }); 1344 in 1345 if isWheel then wheelPackage else sourcePackage; 1346 ··· 1378 } 1379 ); 1380 1381 + packaging = super.packaging.overridePythonAttrs ( 1382 + old: { 1383 + buildInputs = old.buildInputs ++ 1384 + # From 20.5 until 20.7, packaging used flit for packaging (heh) 1385 + # See https://github.com/pypa/packaging/pull/352 and https://github.com/pypa/packaging/pull/367 1386 + lib.optional (lib.versionAtLeast old.version "20.5" && lib.versionOlder old.version "20.8") [ self.flit-core ]; 1387 + } 1388 + ); 1389 + 1390 supervisor = super.supervisor.overridePythonAttrs ( 1391 old: { 1392 propagatedBuildInputs = old.propagatedBuildInputs ++ [ ··· 1401 propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.toolz ]; 1402 } 1403 ); 1404 + 1405 + # For some reason the toml dependency of tqdm declared here: 1406 + # https://github.com/tqdm/tqdm/blob/67130a23646ae672836b971e1086b6ae4c77d930/pyproject.toml#L2 1407 + # is not translated correctly to a nix dependency. 1408 + tqdm = super.tqdm.overrideAttrs ( 1409 + old: { 1410 + buildInputs = [ super.toml ] ++ old.buildInputs; 1411 + } 1412 + ); 1413 + 1414 + watchdog = super.watchdog.overrideAttrs ( 1415 + old: { 1416 + buildInputs = old.buildInputs or [ ] 1417 + ++ pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.CoreServices; 1418 + } 1419 + ); 1420 + 1421 + # pyee cannot find `vcversioner` and other "setup requirements", so it tries to 1422 + # download them from the internet, which only works when nix sandboxing is disabled. 1423 + # Additionally, since pyee uses vcversioner to specify its version, we need to do this 1424 + # manually specify its version. 1425 + pyee = super.pyee.overrideAttrs ( 1426 + old: { 1427 + postPatch = old.postPatch or "" + '' 1428 + sed -i setup.py \ 1429 + -e '/setup_requires/,/],/d' \ 1430 + -e 's/vcversioner={},/version="${old.version}",/' 1431 + ''; 1432 + } 1433 + ); 1434 + 1435 + # nixpkgs has setuptools_scm 4.1.2 1436 + # but newrelic has a seemingly unnecessary version constraint for <4 1437 + # So we patch that out 1438 + newrelic = super.newrelic.overridePythonAttrs ( 1439 + old: { 1440 + postPatch = old.postPatch or "" + '' 1441 + substituteInPlace setup.py --replace '"setuptools_scm>=3.2,<4"' '"setuptools_scm"' 1442 + ''; 1443 + } 1444 + ); 1445 + 1446 + 1447 }
+12 -7
pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix
··· 1 - { lib, stdenv, python, isLinux ? stdenv.isLinux }: 2 let 3 inherit (lib.strings) hasSuffix hasInfix splitString removeSuffix; 4 5 # The 'cpxy" as determined by `python.version` 6 # ··· 72 withPlatform = 73 if isLinux 74 then 75 - ( 76 - x: x.platform == "manylinux1_${stdenv.hostPlatform.linuxArch}" 77 - || x.platform == "manylinux2010_${stdenv.hostPlatform.linuxArch}" 78 - || x.platform == "manylinux2014_${stdenv.hostPlatform.linuxArch}" 79 - || x.platform == "any" 80 - ) 81 else (x: hasInfix "macosx" x.platform || x.platform == "any"); 82 filterWheel = x: 83 let
··· 1 + { lib, stdenv, poetryLib, python, isLinux ? stdenv.isLinux }: 2 let 3 inherit (lib.strings) hasSuffix hasInfix splitString removeSuffix; 4 + inherit (poetryLib) targetMachine; 5 6 # The 'cpxy" as determined by `python.version` 7 # ··· 73 withPlatform = 74 if isLinux 75 then 76 + if targetMachine != null 77 + then 78 + ( 79 + x: x.platform == "manylinux1_${targetMachine}" 80 + || x.platform == "manylinux2010_${targetMachine}" 81 + || x.platform == "manylinux2014_${targetMachine}" 82 + || x.platform == "any" 83 + ) 84 + else 85 + (x: x.platform == "any") 86 else (x: hasInfix "macosx" x.platform || x.platform == "any"); 87 filterWheel = x: 88 let
+3 -3
pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix
··· 1 { lib, stdenv, poetryLib }: python: 2 let 3 - inherit (poetryLib) ireplace; 4 5 # Like builtins.substring but with stop being offset instead of length 6 substr = start: stop: s: builtins.substring start (stop - start) s; ··· 95 else if stdenv.isDarwin then "darwin" 96 else throw "Unsupported platform" 97 ); 98 - platform_machine = stdenv.hostPlatform.linuxArch; 99 platform_python_implementation = 100 let 101 impl = python.passthru.implementation; ··· 132 mVal = ''[a-zA-Z0-9\'"_\. ]+''; 133 mOp = "in|[!=<>]+"; 134 e = stripStr exprs.value; 135 - m = builtins.map stripStr (builtins.match "^(${mVal}) *(${mOp}) *(${mVal})$" e); 136 m0 = processVar (builtins.elemAt m 0); 137 m2 = processVar (builtins.elemAt m 2); 138 in
··· 1 { lib, stdenv, poetryLib }: python: 2 let 3 + inherit (poetryLib) ireplace targetMachine; 4 5 # Like builtins.substring but with stop being offset instead of length 6 substr = start: stop: s: builtins.substring start (stop - start) s; ··· 95 else if stdenv.isDarwin then "darwin" 96 else throw "Unsupported platform" 97 ); 98 + platform_machine = targetMachine; 99 platform_python_implementation = 100 let 101 impl = python.passthru.implementation; ··· 132 mVal = ''[a-zA-Z0-9\'"_\. ]+''; 133 mOp = "in|[!=<>]+"; 134 e = stripStr exprs.value; 135 + m = builtins.map stripStr (builtins.match ''^(${mVal}) *(${mOp}) *(${mVal})$'' e); 136 m0 = processVar (builtins.elemAt m 0); 137 m2 = processVar (builtins.elemAt m 2); 138 in
+1
pkgs/development/tools/poetry2nix/poetry2nix/pkgs/poetry/update
··· 3 4 rev=$(curl -s https://api.github.com/repos/python-poetry/poetry/releases/latest | jq -r '.name') 5 nix-prefetch-github --rev "$rev" python-poetry poetry > src.json 6 7 src=$(nix-build --no-out-link --expr 'with import <nixpkgs> {}; fetchFromGitHub (lib.importJSON ./src.json)') 8 cp $src/pyproject.toml $src/poetry.lock .
··· 3 4 rev=$(curl -s https://api.github.com/repos/python-poetry/poetry/releases/latest | jq -r '.name') 5 nix-prefetch-github --rev "$rev" python-poetry poetry > src.json 6 + echo >> src.json 7 8 src=$(nix-build --no-out-link --expr 'with import <nixpkgs> {}; fetchFromGitHub (lib.importJSON ./src.json)') 9 cp $src/pyproject.toml $src/poetry.lock .
+1 -1
pkgs/development/tools/poetry2nix/update
··· 16 mkdir build 17 cp *.* build/ 18 cp -r pkgs hooks bin build/ 19 - rm build/shell.nix build/generate.py build/overlay.nix build/flake.nix 20 21 cat > build/README.md << EOF 22 Dont change these files here, they are maintained at https://github.com/nix-community/poetry2nix
··· 16 mkdir build 17 cp *.* build/ 18 cp -r pkgs hooks bin build/ 19 + rm build/shell.nix build/generate.py build/overlay.nix build/flake.* 20 21 cat > build/README.md << EOF 22 Dont change these files here, they are maintained at https://github.com/nix-community/poetry2nix