Merge pull request #195316 from adisbladis/poetry2nix-1_34_0

poetry2nix: 1.33.0 -> 1.34.1

authored by

adisbladis and committed by
GitHub
39490a5f 5e48b0da

+247 -63
+21 -22
pkgs/development/tools/poetry2nix/poetry2nix/default.nix
··· 5 5 }: 6 6 let 7 7 # Poetry2nix version 8 - version = "1.33.0"; 8 + version = "1.34.1"; 9 9 10 10 inherit (poetryLib) isCompatible readTOML normalizePackageName normalizePackageSet; 11 11 ··· 27 27 , attrs 28 28 , includeBuildSystem ? true 29 29 , groups ? [ ] 30 + , checkGroups ? [ "dev" ] 30 31 }: 31 32 let 32 33 getInputs = attr: attrs.${attr} or [ ]; ··· 73 74 nativeBuildInputs = mkInput "nativeBuildInputs" [ ]; 74 75 checkInputs = mkInput "checkInputs" ( 75 76 getDeps (pyProject.tool.poetry."dev-dependencies" or { }) # <poetry-1.2.0 76 - ++ getDeps (pyProject.tool.poetry.group."dev".dependencies or { }) # >=poetry-1.2.0 77 + # >=poetry-1.2.0 dependency groups 78 + ++ lib.flatten (map (g: getDeps (pyProject.tool.poetry.group.${g}.dependencies or { })) checkGroups) 77 79 ); 78 80 }; 79 81 ··· 131 133 , editablePackageSources ? { } 132 134 , pyProject ? readTOML pyproject 133 135 , groups ? [ ] 136 + , checkGroups ? [ "dev" ] 134 137 }: 135 138 let 136 139 /* The default list of poetry2nix override overlays */ ··· 182 185 builtins.map 183 186 ( 184 187 pkgMeta: 185 - if builtins.elem pkgMeta.name nixpkgsBuildSystems then { 186 - name = pkgMeta.name; 187 - value = super."${pkgMeta.name}"; 188 - } else rec { 189 - name = normalizePackageName pkgMeta.name; 188 + let normalizedName = normalizePackageName pkgMeta.name; in 189 + { 190 + name = normalizedName; 190 191 value = self.mkPoetryDep ( 191 192 pkgMeta // { 192 193 inherit pwd preferWheels; 193 194 source = pkgMeta.source or null; 194 - files = lockFiles.${name}; 195 + files = lockFiles.${normalizedName}; 195 196 pythonPackages = self; 196 197 197 - sourceSpec = 198 - let 199 - normalizedName = normalizePackageName pkgMeta.name; 200 - in 201 - ( 202 - (normalizePackageSet pyProject.tool.poetry.dependencies or { }).${normalizedName} 203 - or (normalizePackageSet pyProject.tool.poetry.dev-dependencies or { }).${normalizedName} 204 - or (normalizePackageSet pyProject.tool.poetry.group.dev.dependencies { }).${normalizedName} # Poetry 1.2.0+ 205 - or { } 206 - ); 198 + sourceSpec = ( 199 + (normalizePackageSet pyProject.tool.poetry.dependencies or { }).${normalizedName} 200 + or (normalizePackageSet pyProject.tool.poetry.dev-dependencies or { }).${normalizedName} 201 + or (normalizePackageSet pyProject.tool.poetry.group.dev.dependencies { }).${normalizedName} # Poetry 1.2.0+ 202 + or { } 203 + ); 207 204 } 208 205 ); 209 206 } 210 207 ) 211 208 (lib.reverseList compatible) 212 209 ); 210 + buildSystems = builtins.listToAttrs (builtins.map (x: { name = x; value = super.${x}; }) nixpkgsBuildSystems); 213 211 in 214 - lockPkgs // { 212 + lockPkgs // buildSystems // { 215 213 # Create a dummy null package for the current project in case any dependencies depend on the root project (issue #307) 216 214 ${pyProject.tool.poetry.name} = null; 217 215 }; ··· 262 260 packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) overlays; 263 261 py = python.override { inherit packageOverrides; self = py; }; 264 262 265 - inputAttrs = mkInputAttrs { inherit py pyProject groups; attrs = { }; includeBuildSystem = false; }; 263 + inputAttrs = mkInputAttrs { inherit py pyProject groups checkGroups; attrs = { }; includeBuildSystem = false; }; 266 264 267 265 requiredPythonModules = python.pkgs.requiredPythonModules; 268 266 /* Include all the nested dependencies which are required for each package. ··· 364 362 , pwd ? projectDir 365 363 , preferWheels ? false 366 364 , groups ? [ ] 365 + , checkGroups ? [ "dev" ] 367 366 , ... 368 367 }@attrs: 369 368 let 370 369 poetryPython = self.mkPoetryPackages { 371 - inherit pyproject poetrylock overrides python pwd preferWheels groups; 370 + inherit pyproject poetrylock overrides python pwd preferWheels groups checkGroups; 372 371 }; 373 372 py = poetryPython.python; 374 373 ··· 383 382 ]; 384 383 passedAttrs = builtins.removeAttrs attrs specialAttrs; 385 384 386 - inputAttrs = mkInputAttrs { inherit py pyProject attrs groups; }; 385 + inputAttrs = mkInputAttrs { inherit py pyProject attrs groups checkGroups; }; 387 386 388 387 app = py.pkgs.buildPythonPackage ( 389 388 passedAttrs // inputAttrs // {
+1
pkgs/development/tools/poetry2nix/poetry2nix/known-build-systems.json
··· 7 7 "flitBuildHook", 8 8 "cython", 9 9 "hatchling", 10 + "hatch-vcs", 10 11 "setuptools", 11 12 "setuptools-scm" 12 13 ]
+112 -12
pkgs/development/tools/poetry2nix/poetry2nix/overrides/build-systems.json
··· 790 790 "setuptools" 791 791 ], 792 792 "apipkg": [ 793 + "hatch-vcs", 793 794 "hatchling", 794 795 "setuptools" 795 796 ], ··· 1918 1919 ], 1919 1920 "black": [ 1920 1921 { 1921 - "buildSystem": "hatch-fancy-pypi-readme", 1922 - "from": "22.10.0" 1922 + "buildSystem": "setuptools", 1923 + "until": "22.10.0" 1924 + }, 1925 + { 1926 + "buildSystem": "setuptools-scm", 1927 + "until": "22.10.0" 1923 1928 }, 1924 1929 { 1925 1930 "buildSystem": "hatchling", ··· 1929 1934 "buildSystem": "hatch-vcs", 1930 1935 "from": "22.10.0" 1931 1936 }, 1932 - "setuptools", 1933 - "setuptools-scm" 1937 + { 1938 + "buildSystem": "hatch-fancy-pypi-readme", 1939 + "from": "22.10.0" 1940 + } 1934 1941 ], 1935 1942 "black-macchiato": [ 1936 1943 "setuptools" 1937 1944 ], 1945 + "blacken-docs": [ 1946 + "setuptools" 1947 + ], 1938 1948 "bleach": [ 1939 1949 "setuptools" 1940 1950 ], ··· 3367 3377 "setuptools" 3368 3378 ], 3369 3379 "dbus-fast": [ 3370 - "poetry-core" 3380 + "poetry-core", 3381 + "setuptools" 3371 3382 ], 3372 3383 "dbus-next": [ 3373 3384 "setuptools" ··· 3977 3988 "setuptools-scm" 3978 3989 ], 3979 3990 "docformatter": [ 3991 + { 3992 + "buildSystem": "poetry-core", 3993 + "from": "1.5.0" 3994 + }, 3980 3995 "setuptools" 3981 3996 ], 3982 3997 "docker": [ ··· 4452 4467 "eradicate": [ 4453 4468 "setuptools" 4454 4469 ], 4470 + "erppeek": [ 4471 + "setuptools" 4472 + ], 4455 4473 "escapism": [ 4456 4474 "setuptools" 4457 4475 ], ··· 4664 4682 ], 4665 4683 "fastapi-mail": [ 4666 4684 "poetry-core", 4667 - "setuptools" 4685 + "setuptools", 4686 + "hatchling" 4668 4687 ], 4669 4688 "fastapi-restful": [ 4670 4689 "poetry" ··· 6861 6880 "itemloaders": [ 6862 6881 "setuptools" 6863 6882 ], 6883 + "iteration-utilities": [ 6884 + "setuptools" 6885 + ], 6864 6886 "itsdangerous": [ 6865 6887 "setuptools" 6866 6888 ], ··· 6987 7009 "setuptools" 6988 7010 ], 6989 7011 "jinja2": [ 7012 + "setuptools" 7013 + ], 7014 + "jinja2-ansible-filters": [ 6990 7015 "setuptools" 6991 7016 ], 6992 7017 "jinja2-git": [ ··· 7198 7223 "setuptools" 7199 7224 ], 7200 7225 "jupyter-core": [ 7201 - "setuptools" 7226 + { 7227 + "buildSystem": "hatchling", 7228 + "from": "4.11.0" 7229 + }, 7230 + { 7231 + "buildSystem": "setuptools", 7232 + "until": "4.11.0" 7233 + } 7202 7234 ], 7203 7235 "jupyter-lsp": [ 7204 7236 "setuptools" ··· 7958 7990 "manhole": [ 7959 7991 "setuptools" 7960 7992 ], 7993 + "manage-fastapi": [ 7994 + "poetry" 7995 + ], 7961 7996 "manimpango": [ 7962 7997 "cython", 7963 7998 "setuptools" ··· 8243 8278 "migen": [ 8244 8279 "setuptools" 8245 8280 ], 8281 + "mike": [ 8282 + "setuptools" 8283 + ], 8246 8284 "milc": [ 8247 8285 "setuptools" 8248 8286 ], ··· 8325 8363 ], 8326 8364 "mkdocs-gen-files": [ 8327 8365 "poetry" 8366 + ], 8367 + "mkdocs-git-revision-date-localized-plugin": [ 8368 + "setuptools" 8328 8369 ], 8329 8370 "mkdocs-gitlab": [ 8330 8371 "setuptools" ··· 8339 8380 "mkdocs-macros": [ 8340 8381 "setuptools" 8341 8382 ], 8383 + "mkdocs-macros-plugin": [ 8384 + "setuptools" 8385 + ], 8342 8386 "mkdocs-material": [ 8343 8387 "setuptools" 8344 8388 ], ··· 8352 8396 "setuptools" 8353 8397 ], 8354 8398 "mkdocs-swagger-ui-tag": [ 8399 + "setuptools" 8400 + ], 8401 + "mkdocs-table-reader-plugin": [ 8355 8402 "setuptools" 8356 8403 ], 8357 8404 "mkdocstrings": [ ··· 8661 8708 "poetry-core", 8662 8709 "setuptools" 8663 8710 ], 8711 + "mypy-boto3-cognito": [ 8712 + "setuptools" 8713 + ], 8664 8714 "mypy-boto3-cognito-idp": [ 8665 8715 "setuptools" 8666 8716 ], ··· 8774 8824 "setuptools" 8775 8825 ], 8776 8826 "nbconvert": [ 8777 - "setuptools" 8827 + { 8828 + "buildSystem": "setuptools", 8829 + "until": "7.0.0" 8830 + }, 8831 + { 8832 + "buildSystem": "hatchling", 8833 + "from": "7.0.0" 8834 + } 8778 8835 ], 8779 8836 "nbdime": [ 8780 8837 "setuptools", 8781 8838 "setuptools-scm" 8782 8839 ], 8783 8840 "nbformat": [ 8784 - "flit-core", 8785 - "setuptools" 8841 + { 8842 + "buildSystem": "setuptools", 8843 + "until": "5.4.0" 8844 + }, 8845 + { 8846 + "buildSystem": "flit-core", 8847 + "from": "5.4.0", 8848 + "until": "5.6.0" 8849 + }, 8850 + { 8851 + "buildSystem": "hatchling", 8852 + "from": "5.6.0" 8853 + }, 8854 + { 8855 + "buildSystem": "hatch-nodejs-version", 8856 + "from": "5.6.0" 8857 + } 8786 8858 ], 8787 8859 "nbmerge": [ 8788 8860 "setuptools" ··· 10084 10156 "setuptools" 10085 10157 ], 10086 10158 "pipdeptree": [ 10159 + "hatch-vcs", 10087 10160 "hatchling", 10088 10161 "setuptools" 10089 10162 ], ··· 10363 10436 "prayer-times-calculator": [ 10364 10437 "setuptools" 10365 10438 ], 10439 + "pre-commit": [ 10440 + "setuptools" 10441 + ], 10366 10442 "pre-commit-hooks": [ 10443 + "setuptools" 10444 + ], 10445 + "pre-commit-po-hooks": [ 10367 10446 "setuptools" 10368 10447 ], 10369 10448 "precis-i18n": [ ··· 11058 11137 "pydeps": [ 11059 11138 "setuptools" 11060 11139 ], 11140 + "pydeprecate": [ 11141 + "setuptools" 11142 + ], 11061 11143 "pydes": [ 11062 11144 "setuptools" 11063 11145 ], ··· 11389 11471 "setuptools" 11390 11472 ], 11391 11473 "pyhamcrest": [ 11474 + "hatch-vcs", 11392 11475 "hatchling", 11393 11476 "setuptools" 11394 11477 ], ··· 13718 13801 "flit-core", 13719 13802 "setuptools" 13720 13803 ], 13804 + "pyyaml-include": [ 13805 + "setuptools" 13806 + ], 13721 13807 "pyzbar": [ 13722 13808 "setuptools" 13723 13809 ], ··· 13725 13811 "setuptools" 13726 13812 ], 13727 13813 "pyzmq": [ 13814 + "packaging", 13728 13815 "setuptools" 13729 13816 ], 13730 13817 "pyzufall": [ ··· 14676 14763 "setuptools" 14677 14764 ], 14678 14765 "seaborn": [ 14679 - "flit-core", 14680 - "setuptools" 14766 + { 14767 + "buildSystem": "setuptools", 14768 + "until": "0.12.0" 14769 + }, 14770 + { 14771 + "buildSystem": "flit-core", 14772 + "from": "0.12.0" 14773 + } 14681 14774 ], 14682 14775 "seabreeze": [ 14683 14776 "cython", ··· 16653 16746 "types-colorama": [ 16654 16747 "setuptools" 16655 16748 ], 16749 + "types-cryptography": [ 16750 + "setuptools" 16751 + ], 16656 16752 "types-dateutil": [ 16657 16753 "setuptools" 16658 16754 ], ··· 17048 17144 "setuptools-scm" 17049 17145 ], 17050 17146 "vector": [ 17147 + "hatch-vcs", 17051 17148 "hatchling" 17052 17149 ], 17053 17150 "vega": [ ··· 17085 17182 "setuptools" 17086 17183 ], 17087 17184 "versiontools": [ 17185 + "setuptools" 17186 + ], 17187 + "verspec": [ 17088 17188 "setuptools" 17089 17189 ], 17090 17190 "vertica-python": [
+91 -14
pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix
··· 130 130 self.dopy 131 131 self.ncclient 132 132 ]; 133 - } // lib.optionalAttrs (lib.versionOlder old.version "5.0") { 134 - prePatch = pkgs.python.pkgs.ansible.prePatch or ""; 135 - postInstall = pkgs.python.pkgs.ansible.postInstall or ""; 133 + } 134 + ); 135 + 136 + ansible-base = super.ansible-base.overridePythonAttrs ( 137 + old: 138 + { 139 + prePatch = ''sed -i "s/\[python, /[/" lib/ansible/executor/task_executor.py''; 140 + postInstall = '' 141 + for m in docs/man/man1/*; do 142 + install -vD $m -t $out/share/man/man1 143 + done 144 + ''; 145 + } 146 + // lib.optionalAttrs (lib.versionOlder old.version "2.4") { 147 + prePatch = ''sed -i "s,/usr/,$out," lib/ansible/constants.py''; 136 148 } 137 149 ); 138 150 ··· 194 206 }.${version} or ( 195 207 lib.warn "Unknown bcrypt version: '${version}'. Please update getCargoHash." lib.fakeHash 196 208 ); 197 - sha256 = getCargoHash super.bcrypt.version; 198 209 in 199 210 super.bcrypt.overridePythonAttrs ( 200 211 old: { ··· 206 217 (old.nativeBuildInputs or [ ]) 207 218 ++ lib.optionals (lib.versionAtLeast old.version "4") 208 219 (with pkgs.rustPlatform; [ rust.rustc rust.cargo cargoSetupHook self.setuptools-rust ]); 209 - } // lib.optionalAttrs (lib.versionAtLeast old.version "4") rec { 220 + } // lib.optionalAttrs (lib.versionAtLeast old.version "4") { 210 221 cargoDeps = 211 222 pkgs.rustPlatform.fetchCargoTarball 212 223 { ··· 269 280 propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; 270 281 }); 271 282 283 + cerberus = super.cerberus.overridePythonAttrs (old: { 284 + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; 285 + }); 286 + 272 287 cssselect2 = super.cssselect2.overridePythonAttrs ( 273 288 old: { 274 289 buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; ··· 341 356 } 342 357 ); 343 358 359 + copier = super.copier.overrideAttrs (old: { 360 + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.git ]; 361 + }); 362 + 344 363 cryptography = 345 364 let 346 365 getCargoHash = version: { ··· 355 374 lib.warn "Unknown cryptography version: '${version}'. Please update getCargoHash." lib.fakeHash 356 375 ); 357 376 sha256 = getCargoHash super.cryptography.version; 377 + isWheel = lib.hasSuffix ".whl" super.cryptography.src; 358 378 scrypto = 359 - if lib.versionAtLeast super.cryptography.version "35" && sha256 == null then 379 + if isWheel then 360 380 ( 361 381 super.cryptography.override { preferWheel = true; } 362 382 ) else super.cryptography; ··· 367 387 nativeBuildInputs = (old.nativeBuildInputs or [ ]) 368 388 ++ lib.optional (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ] 369 389 ++ lib.optional (!self.isPyPy) pyBuildPackages.cffi 370 - ++ lib.optional (lib.versionAtLeast old.version "3.5") 390 + ++ lib.optional (lib.versionAtLeast old.version "3.5" && !isWheel) 371 391 (with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]); 372 392 buildInputs = (old.buildInputs or [ ]) 373 393 ++ [ (if lib.versionAtLeast old.version "37" then pkgs.openssl_3 else pkgs.openssl_1_1) ] ··· 375 395 propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.cffi ]; 376 396 } // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") { 377 397 CRYPTOGRAPHY_DONT_BUILD_RUST = "1"; 378 - } // lib.optionalAttrs (lib.versionAtLeast old.version "35" && sha256 != null) rec { 398 + } // lib.optionalAttrs (lib.versionAtLeast old.version "3.5" && !isWheel) rec { 379 399 cargoDeps = 380 400 pkgs.rustPlatform.fetchCargoTarball { 381 401 src = old.src; ··· 806 826 } 807 827 ); 808 828 829 + ipython = super.ipython.overridePythonAttrs ( 830 + old: { 831 + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; 832 + } 833 + ); 834 + 809 835 isort = super.isort.overridePythonAttrs ( 810 836 old: { 811 837 propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; ··· 884 910 ); 885 911 886 912 jupyter-packaging = super.jupyter-packaging.overridePythonAttrs (old: { 887 - propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.wheel ]; 913 + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools self.wheel ]; 888 914 }); 889 915 890 916 jupyterlab-widgets = super.jupyterlab-widgets.overridePythonAttrs ( ··· 1058 1084 self.setuptools-scm 1059 1085 self.setuptools-scm-git-archive 1060 1086 ]; 1087 + 1088 + # Clang doesn't understand -fno-strict-overflow, and matplotlib builds with -Werror 1089 + hardeningDisable = if stdenv.isDarwin then [ "strictoverflow" ] else [ ]; 1061 1090 1062 1091 passthru = old.passthru or { } // passthru; 1063 1092 ··· 1251 1280 }; 1252 1281 in 1253 1282 { 1283 + # fails to build with format=pyproject and setuptools >= 65 1284 + format = if (old.format == "poetry2nix") then "setuptools" else old.format; 1254 1285 nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.gfortran ]; 1255 1286 buildInputs = (old.buildInputs or [ ]) ++ [ blas ]; 1256 1287 enableParallelBuilding = true; ··· 1271 1302 ); 1272 1303 1273 1304 open3d = super.open3d.overridePythonAttrs (old: { 1274 - buildInputs = (old.buildInputs or [ ]) ++ (with pkgs; [ 1275 - udev 1276 - ]); 1305 + buildInputs = (old.buildInputs or [ ]) ++ [ 1306 + pkgs.udev 1307 + pkgs.libusb1 1308 + ]; 1277 1309 # TODO(Sem Mulder): Add overridable flags for CUDA/PyTorch/Tensorflow support. 1278 1310 autoPatchelfIgnoreMissingDeps = true; 1279 1311 }); ··· 1441 1473 { 1442 1474 # "Vendor" dependencies (for build-system support) 1443 1475 postPatch = '' 1444 - find . 1445 - 1446 1476 echo "import sys" >> ${initFile} 1447 1477 for path in $propagatedBuildInputs; do 1448 1478 echo "sys.path.insert(0, \"$path\")" >> ${initFile} ··· 1714 1744 PROJ_INCDIR = "${pkgs.proj.dev}/include"; 1715 1745 } 1716 1746 ); 1747 + 1748 + pyrealsense2 = super.pyrealsense2.overridePythonAttrs (old: { 1749 + buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.libusb1.out ]; 1750 + }); 1717 1751 1718 1752 pyrfr = super.pyrfr.overridePythonAttrs (old: { 1719 1753 nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.swig ]; ··· 2271 2305 }).wheel; 2272 2306 }; 2273 2307 2308 + watchfiles = 2309 + let 2310 + # Watchfiles does not include Cargo.lock in tarball released on PyPi for versions up to 0.17.0 2311 + getRepoHash = version: { 2312 + "0.17.0" = "1swpf265h9qq30cx55iy6jjirba3wml16wzb68k527ynrxr7hvqx"; 2313 + "0.16.1" = "1ss6gzcr6js2d2sddgz1p52gyiwpqmgrxm8r6wim7gnm4wvhav8a"; 2314 + "0.15.0" = "14k3avrj7v794kk4mk2xggn40a4s0zg8iq8wmyyyrf7va6hz29hf"; 2315 + "0.14.1" = "1pgfbhxrvr3dw46x9piqj3ydxgn4lkrfp931q0cajinrpv4acfay"; 2316 + "0.14" = "0lml67ilyly0i632pffdy1gd07404vx90xnkw8q6wf6xp5afmkka"; 2317 + "0.13" = "0rkz8yr01mmxm2lcmbnr9i5c7n371mksij7v3ws0aqlrh3kgww02"; 2318 + "0.12" = "16788a0d8n1bb705f0k3dvav2fmbbl6pcikwpgarl1l3fcfff8kl"; 2319 + "0.11" = "0vx56h9wfxj7x3aq7jign4rnlfm7x9nhjwmsv8p22acbzbs10dgv"; 2320 + "0.10" = "0ypdy9sq4211djqh4ni5ap9l7whq9hw0vhsxjfl3a0a4czlldxqp"; 2321 + }.${version}; 2322 + sha256 = getRepoHash super.watchfiles.version; 2323 + in 2324 + super.watchfiles.overridePythonAttrs (old: rec { 2325 + src = pkgs.fetchFromGitHub { 2326 + owner = "samuelcolvin"; 2327 + repo = "watchfiles"; 2328 + rev = "v${old.version}"; 2329 + inherit sha256; 2330 + }; 2331 + cargoDeps = pkgs.rustPlatform.importCargoLock { 2332 + lockFile = "${src.out}/Cargo.lock"; 2333 + }; 2334 + buildInputs = (old.buildInputs or [ ]) ++ lib.optionals stdenv.isDarwin [ 2335 + pkgs.darwin.apple_sdk.frameworks.Security 2336 + pkgs.darwin.apple_sdk.frameworks.CoreServices 2337 + pkgs.libiconv 2338 + ]; 2339 + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ 2340 + pkgs.rustPlatform.cargoSetupHook 2341 + pkgs.rustPlatform.maturinBuildHook 2342 + ]; 2343 + }); 2344 + 2274 2345 weasyprint = super.weasyprint.overridePythonAttrs ( 2275 2346 old: { 2276 2347 inherit (pkgs.python3.pkgs.weasyprint) patches; ··· 2528 2599 'root_dirs.extend(jupyter_path())' \ 2529 2600 'root_dirs.extend(jupyter_path() + [os.path.join("@out@", "share", "jupyter")])' \ 2530 2601 --subst-var out 2602 + '' + lib.optionalString (lib.versionAtLeast self.nbconvert.version "7.0") '' 2603 + substituteInPlace \ 2604 + ./hatch_build.py \ 2605 + --replace \ 2606 + 'if self.target_name not in ["wheel", "sdist"]:' \ 2607 + 'if True:' 2531 2608 ''; 2532 2609 }); 2533 2610 }
+21 -14
pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix
··· 3 3 inherit (lib.strings) escapeRegex hasPrefix hasSuffix hasInfix splitString removePrefix removeSuffix; 4 4 targetMachine = poetryLib.getTargetMachine stdenv; 5 5 6 - # The 'cpxy" as determined by `python.version` 7 - # 8 - # e.g "2.7.17" -> "cp27" 9 - # "3.5.9" -> "cp35" 10 - pythonTag = 6 + pythonVer = 11 7 let 12 8 ver = builtins.splitVersion python.version; 13 9 major = builtins.elemAt ver 0; 14 10 minor = builtins.elemAt ver 1; 11 + tags = [ "cp" "py" ]; 15 12 in 16 - "cp${major}${minor}"; 17 - abiTag = "${pythonTag}m"; 13 + { inherit major minor tags; }; 14 + abiTag = "cp${pythonVer.major}${pythonVer.minor}m"; 18 15 19 16 # 20 17 # Parses wheel file returning an attribute set ··· 50 47 then [ ] 51 48 else (builtins.filter (x: hasInfix v x.file) candidates) ++ (findBestMatches vs candidates); 52 49 53 - # pyver = "cpXX" 54 - # x = "cpXX" | "py2" | "py3" | "py2.py3" 55 - isPyVersionCompatible = pyver: x: 50 + # x = "cpXX" | "py2" | "py3" | "py2.py3" 51 + isPyVersionCompatible = pyver@{ major, minor, tags }: x: 56 52 let 57 - normalize = y: ''cp${removePrefix "cp" (removePrefix "py" y)}''; 58 - isCompat = p: x: hasPrefix (normalize x) p; 53 + isCompat = m: 54 + builtins.elem m.tag tags 55 + && m.major == major 56 + && builtins.compareVersions minor m.minor >= 0; 57 + parseMarker = v: 58 + let 59 + tag = builtins.substring 0 2 v; 60 + major = builtins.substring 2 1 v; 61 + end = builtins.substring 3 3 v; 62 + minor = if builtins.stringLength end > 0 then end else "0"; 63 + in 64 + { inherit major minor tag; }; 65 + markers = splitString "." x; 59 66 in 60 - lib.lists.any (isCompat pyver) (splitString "." x); 67 + lib.lists.any isCompat (map parseMarker markers); 61 68 62 69 # 63 70 # Selects the best matching wheel file from a list of files ··· 95 102 let 96 103 f = toWheelAttrs x.file; 97 104 in 98 - (withPython pythonTag abiTag f) && (withPlatforms f); 105 + (withPython pythonVer abiTag f) && (withPlatforms f); 99 106 filtered = builtins.filter filterWheel filesWithoutSources; 100 107 choose = files: 101 108 let
+1 -1
pkgs/development/tools/poetry2nix/poetry2nix/plugins.nix
··· 19 19 inherit (drv) src version meta; 20 20 21 21 buildInputs = drv.buildInputs ++ drv.propagatedBuildInputs ++ buildInputs; 22 - nativeBuildInputs = drv.nativeBuildInputs ++ nativeBuildInputs; 22 + nativeBuildInputs = builtins.filter (x: x.name != "python-output-dist-hook") (drv.nativeBuildInputs ++ nativeBuildInputs); 23 23 24 24 dontConfigure = true; 25 25 dontBuild = true;