git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #171580 from adisbladis/poetry2nix-1_28_0

poetry2nix: 1.27.1 -> 1.28.0

commit98df69fed4c3b430f49aad540161ed47d38a012c authoradisbladis <adisbladis@gmail.com> dateThu 5 May 2022, 10:55 (5 years ago) parent482f349063015e
4 files changed+262−12
pkgs/development/tools/poetry2nix/poetry2nix/default.nix+10−2 pkgs/development/tools/poetry2nix/poetry2nix/lib.nix+1−1 pkgs/development/tools/poetry2nix/poetry2nix/overrides/build-systems.json+153−5 pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix+98−4
pkgs/development/tools/poetry2nix/poetry2nix/default.nix+10−2
@@ -5,7 +5,7 @@
55}:
66let
77 # Poetry2nix version
8− version = "1.27.1";
8+ version = "1.28.0";
99
1010 inherit (poetryLib) isCompatible readTOML moduleName;
1111
@@ -287,12 +287,20 @@ lib.makeScope pkgs.newScope (self: {
287287 (name: value: projectDir + "/${value.path}")
288288 (lib.filterAttrs (name: dep: dep.develop or false && hasAttr "path" dep) set);
289289
290− editablePackageSources' = (
290+ excludedEditablePackageNames = builtins.filter
291+ (pkg: editablePackageSources."${pkg}" == null)
292+ (builtins.attrNames editablePackageSources);
293+
294+ allEditablePackageSources = (
291295 (getEditableDeps (pyProject.tool.poetry."dependencies" or { }))
292296 // (getEditableDeps (pyProject.tool.poetry."dev-dependencies" or { }))
293297 // editablePackageSources
294298 );
295299
300+ editablePackageSources' = builtins.removeAttrs
301+ allEditablePackageSources
302+ excludedEditablePackageNames;
303+
296304 poetryPython = self.mkPoetryPackages {
297305 inherit pyproject poetrylock overrides python pwd preferWheels pyProject;
298306 editablePackageSources = editablePackageSources';
pkgs/development/tools/poetry2nix/poetry2nix/lib.nix+1−1
@@ -180,7 +180,7 @@ let
180180 hasGitIgnore = builtins.pathExists gitIgnore;
181181 gitIgnores = if hasGitIgnore then [ gitIgnore ] else [ ];
182182 in
183− lib.optionals (builtins.toString path != "/" && ! isGitRoot) (findGitIgnores parent) ++ gitIgnores;
183+ lib.optionals (builtins.pathExists path && builtins.toString path != "/" && ! isGitRoot) (findGitIgnores parent) ++ gitIgnores;
184184
185185 /*
186186 Provides a source filtering mechanism that:
pkgs/development/tools/poetry2nix/poetry2nix/overrides/build-systems.json+153−5
@@ -29,6 +29,9 @@
2929 "aioflo": [
3030 "poetry-core"
3131 ],
32+ "aiogithubapi": [
33+ "poetry-core"
34+ ],
3235 "aioguardian": [
3336 "poetry-core"
3437 ],
@@ -89,9 +92,21 @@
8992 "amqtt": [
9093 "poetry-core"
9194 ],
95+ "ansible-doctor": [
96+ "poetry-core"
97+ ],
98+ "ansible-later": [
99+ "poetry-core"
100+ ],
101+ "ansible-runner": [
102+ "pbr"
103+ ],
92104 "apache-beam": [
93105 "cython"
94106 ],
107+ "aplpy": [
108+ "cython"
109+ ],
95110 "argon2_cffi": [
96111 "flitBuildHook"
97112 ],
@@ -114,15 +129,24 @@
114129 "atomman": [
115130 "cython"
116131 ],
132+ "atpublic": [
133+ "pdm-pep517"
134+ ],
117135 "autarco": [
118136 "poetry-core"
119137 ],
120138 "authcaptureproxy": [
121139 "poetry-core"
122140 ],
141+ "av": [
142+ "cython"
143+ ],
123144 "awesomeversion": [
124145 "poetry-core"
125146 ],
147+ "aws-adfs": [
148+ "poetry-core"
149+ ],
126150 "aws-error-utils": [
127151 "poetry"
128152 ],
@@ -147,6 +171,9 @@
147171 "boltztrap2": [
148172 "cython"
149173 ],
174+ "bsblan": [
175+ "poetry-core"
176+ ],
150177 "build": [
151178 "flit-core"
152179 ],
@@ -183,6 +210,9 @@
183210 "clikit": [
184211 "poetry-core"
185212 ],
213+ "cloudflare-dyndns": [
214+ "poetry"
215+ ],
186216 "collections-extended": [
187217 "poetry-core"
188218 ],
@@ -210,7 +240,8 @@
210240 "poetry-core"
211241 ],
212242 "cssselect2": [
213− "flit"
243+ "flit",
244+ "flit-core"
214245 ],
215246 "cwcwidth": [
216247 "cython"
@@ -224,9 +255,15 @@
224255 "cypari2": [
225256 "cython"
226257 ],
258+ "cypherpunkpay": [
259+ "poetry-core"
260+ ],
227261 "cysignals": [
228262 "cython"
229263 ],
264+ "datadog": [
265+ "hatchling"
266+ ],
230267 "datrie": [
231268 "cython"
232269 ],
@@ -260,6 +297,9 @@
260297 "doc8": [
261298 "pbr"
262299 ],
300+ "docstring-parser": [
301+ "poetry-core"
302+ ],
263303 "dtlssocket": [
264304 "cython"
265305 ],
@@ -301,7 +341,8 @@
301341 "poetry-core"
302342 ],
303343 "entrypoints": [
304− "flit"
344+ "flit",
345+ "flit-core"
305346 ],
306347 "enturclient": [
307348 "poetry-core"
@@ -309,6 +350,13 @@
309350 "enumatch": [
310351 "poetry"
311352 ],
353+ "exceptiongroup": [
354+ "flit-core",
355+ "flitBuildHook"
356+ ],
357+ "falcon": [
358+ "cython"
359+ ],
312360 "fastapi": [
313361 "flitBuildHook"
314362 ],
@@ -378,6 +426,9 @@
378426 "generic": [
379427 "poetry-core"
380428 ],
429+ "gensim": [
430+ "cython"
431+ ],
381432 "glances-api": [
382433 "poetry-core"
383434 ],
@@ -492,9 +543,15 @@
492543 "ipwhl": [
493544 "flitBuildHook"
494545 ],
546+ "iso8601": [
547+ "poetry-core"
548+ ],
495549 "isort": [
496550 "poetry-core"
497551 ],
552+ "jarowinkler": [
553+ "cython"
554+ ],
498555 "jedi-language-server": [
499556 "poetry"
500557 ],
@@ -519,6 +576,12 @@
519576 "jupyterlab": [
520577 "jupyter-packaging"
521578 ],
579+ "jupyterlab-code-formatter": [
580+ "jupyter-packaging"
581+ ],
582+ "jupyterlab-pygments": [
583+ "jupyter-packaging"
584+ ],
522585 "keystoneauth1": [
523586 "pbr"
524587 ],
@@ -537,6 +600,9 @@
537600 "ldappool": [
538601 "pbr"
539602 ],
603+ "levenshtein": [
604+ "cython"
605+ ],
540606 "libgpuarray": [
541607 "cython"
542608 ],
@@ -564,6 +630,9 @@
564630 "lockfile": [
565631 "pbr"
566632 ],
633+ "lsassy": [
634+ "poetry-core"
635+ ],
567636 "luftdaten": [
568637 "poetry-core"
569638 ],
@@ -585,6 +654,9 @@
585654 "marisa-trie": [
586655 "cython"
587656 ],
657+ "markdown-it-py": [
658+ "flit-core"
659+ ],
588660 "mask-rcnn": [
589661 "cython"
590662 ],
@@ -607,6 +679,9 @@
607679 "memory-allocator": [
608680 "cython"
609681 ],
682+ "meteofrance-api": [
683+ "poetry"
684+ ],
610685 "metprint": [
611686 "poetry-core"
612687 ],
@@ -618,6 +693,7 @@
618693 "poetry"
619694 ],
620695 "mkdocs-jupyter": [
696+ "ipython_genutils",
621697 "poetry-core"
622698 ],
623699 "mkdocs-literate-nav": [
@@ -674,6 +750,9 @@
674750 "netdata": [
675751 "poetry-core"
676752 ],
753+ "netutils": [
754+ "poetry-core"
755+ ],
677756 "newversion": [
678757 "poetry-core"
679758 ],
@@ -689,6 +768,9 @@
689768 "nkdfu": [
690769 "flitBuildHook"
691770 ],
771+ "notebook-shim": [
772+ "jupyter-packaging"
773+ ],
692774 "notus-scanner": [
693775 "poetry-core"
694776 ],
@@ -728,6 +810,9 @@
728810 "openvino": [
729811 "cython"
730812 ],
813+ "ordered-set": [
814+ "flit-core"
815+ ],
731816 "ormar": [
732817 "poetry-core"
733818 ],
@@ -807,6 +892,9 @@
807892 "poetry": [
808893 "poetry-core"
809894 ],
895+ "poetry-dynamic-versioning": [
896+ "poetry-core"
897+ ],
810898 "poetry2conda": [
811899 "poetry"
812900 ],
@@ -930,6 +1018,9 @@
9301018 "pymaven-patch": [
9311019 "pbr"
9321020 ],
1021+ "pymdown-extensions": [
1022+ "hatchling"
1023+ ],
9331024 "pymfy": [
9341025 "poetry-core"
9351026 ],
@@ -954,6 +1045,9 @@
9541045 "pyoverkiz": [
9551046 "poetry-core"
9561047 ],
1048+ "pyparsing": [
1049+ "flit-core"
1050+ ],
9571051 "pypass": [
9581052 "pbr"
9591053 ],
@@ -978,12 +1072,21 @@
9781072 "pyproject-flake8": [
9791073 "flit-core"
9801074 ],
1075+ "pypsrp": [
1076+ "poetry-core"
1077+ ],
9811078 "pyquil": [
9821079 "poetry-core"
9831080 ],
1081+ "pyrad": [
1082+ "poetry-core"
1083+ ],
9841084 "pyregion": [
9851085 "cython"
9861086 ],
1087+ "pyrevolve": [
1088+ "cython"
1089+ ],
9871090 "pyrmvtransport": [
9881091 "flit"
9891092 ],
@@ -999,6 +1102,9 @@
9991102 "pysigma": [
10001103 "poetry-core"
10011104 ],
1105+ "pysigma-backend-insightidr": [
1106+ "poetry-core"
1107+ ],
10021108 "pysigma-backend-splunk": [
10031109 "poetry-core"
10041110 ],
@@ -1008,14 +1114,30 @@
10081114 "pysigma-pipeline-sysmon": [
10091115 "poetry-core"
10101116 ],
1117+ "pysigma-pipeline-windows": [
1118+ "poetry-core"
1119+ ],
1120+ "pyslurm": [
1121+ "cython"
1122+ ],
10111123 "pysmf": [
10121124 "cython"
10131125 ],
10141126 "pysml": [
10151127 "poetry-core"
10161128 ],
1129+ "pysnmp-pyasn1": [
1130+ "poetry-core"
1131+ ],
1132+ "pysnmp-pysmi": [
1133+ "poetry-core"
1134+ ],
1135+ "pysnmplib": [
1136+ "poetry-core"
1137+ ],
10171138 "pysnow": [
1018− "poetry"
1139+ "poetry",
1140+ "poetry-core"
10191141 ],
10201142 "pysptk": [
10211143 "cython"
@@ -1035,6 +1157,9 @@
10351157 "pytest-httpserver": [
10361158 "poetry-core"
10371159 ],
1160+ "pytest-isort": [
1161+ "poetry-core"
1162+ ],
10381163 "pytest-mockservers": [
10391164 "poetry-core"
10401165 ],
@@ -1097,6 +1222,9 @@
10971222 "python-openstackclient": [
10981223 "pbr"
10991224 ],
1225+ "python-pae": [
1226+ "poetry-core"
1227+ ],
11001228 "python-pkcs11": [
11011229 "cython"
11021230 ],
@@ -1215,7 +1343,8 @@
12151343 "poetry-core"
12161344 ],
12171345 "rokuecp": [
1218− "poetry"
1346+ "poetry",
1347+ "poetry-core"
12191348 ],
12201349 "roombapy": [
12211350 "poetry-core"
@@ -1280,6 +1409,9 @@
12801409 "sentinel": [
12811410 "poetry-core"
12821411 ],
1412+ "seventeentrack": [
1413+ "poetry-core"
1414+ ],
12831415 "sfepy": [
12841416 "cython"
12851417 ],
@@ -1301,9 +1433,15 @@
13011433 "slowapi": [
13021434 "poetry-core"
13031435 ],
1436+ "socksio": [
1437+ "flit-core"
1438+ ],
13041439 "solo-python": [
13051440 "flitBuildHook"
13061441 ],
1442+ "soupsieve": [
1443+ "hatchling"
1444+ ],
13071445 "spacy-pkuseg": [
13081446 "cython"
13091447 ],
@@ -1425,7 +1563,8 @@
14251563 "cython"
14261564 ],
14271565 "testpath": [
1428− "flit"
1566+ "flit",
1567+ "flit-core"
14291568 ],
14301569 "testrepository": [
14311570 "pbr"
@@ -1505,6 +1644,9 @@
15051644 "typing-extensions": [
15061645 "flit-core"
15071646 ],
1647+ "uharfbuzz": [
1648+ "cython"
1649+ ],
15081650 "unpaddedbase64": [
15091651 "poetry-core"
15101652 ],
@@ -1550,8 +1692,14 @@
15501692 "yoda": [
15511693 "cython"
15521694 ],
1695+ "yte": [
1696+ "poetry-core"
1697+ ],
15531698 "zeversolarlocal": [
15541699 "flit-core",
15551700 "flitBuildHook"
1701+ ],
1702+ "zwave-me-ws": [
1703+ "poetry-core"
15561704 ]
15571705}
pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix+98−4
@@ -8,13 +8,14 @@ let
88 { self
99 , drv
1010 , attr
11+ , extraAttrs ? [ ]
1112 }:
1213 let
1314 buildSystem = if attr == "cython" then self.python.pythonForBuild.pkgs.cython else self.${attr};
1415 in
1516 (
1617 # Flit only works on Python3
17− if (attr == "flit-core" || attr == "flit") && !self.isPy3k then drv
18+ if (attr == "flit-core" || attr == "flit" || attr == "hatchling") && !self.isPy3k then drv
1819 else
1920 drv.overridePythonAttrs (
2021 old:
@@ -23,7 +24,7 @@ let
2324 { }
2425 else
2526 {
26− nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.${attr} ];
27+ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.${attr} ] ++ map (a: self.${a}) extraAttrs;
2728 }
2829 )
2930 );
@@ -55,6 +56,16 @@ lib.composeManyExtensions [
5556 systems)
5657 buildSystems)
5758
59+ # Build systems with conditionals
60+ (self: super: {
61+
62+ platformdirs =
63+ if lib.versionAtLeast super.platformdirs.version "2.5.2"
64+ then addBuildSystem { inherit self; drv = super.platformdirs; attr = "hatchling"; extraAttrs = [ "hatch-vcs" ]; }
65+ else super.platformdirs;
66+
67+ })
68+
5869 # Build fixes
5970 (self: super:
6071 let
@@ -437,6 +448,17 @@ lib.composeManyExtensions [
437448 }
438449 );
439450
451+ # Setuptools >= 60 broke build_py_2to3
452+ docutils =
453+ if lib.versionOlder super.docutils.version "0.16" && lib.versionAtLeast super.setuptools.version "60" then
454+ (
455+ super.docutils.overridePythonAttrs (
456+ old: {
457+ SETUPTOOLS_USE_DISTUTILS = "stdlib";
458+ }
459+ )
460+ ) else super.docutils;
461+
440462 # Environment markers are not always included (depending on how a dep was defined)
441463 enum34 = if self.pythonAtLeast "3.4" then null else super.enum34;
442464
@@ -844,6 +866,17 @@ lib.composeManyExtensions [
844866 }
845867 );
846868
869+ lsassy =
870+ if super.lsassy.version == "3.1.1" then
871+ super.lsassy.overridePythonAttrs
872+ (old: {
873+ # pyproject.toml contains a constraint `rich = "^10.6.0"` which is not replicated in setup.py
874+ # hence pypi misses it and poetry pins rich to 11.0.0
875+ preConfigure = (old.preConfigure or "") + ''
876+ rm pyproject.toml
877+ '';
878+ }) else super.lsassy;
879+
847880 lxml = super.lxml.overridePythonAttrs (
848881 old: {
849882 nativeBuildInputs = with pkgs.buildPackages; (old.nativeBuildInputs or [ ]) ++ [ pkg-config libxml2.dev libxslt.dev ] ++ lib.optionals stdenv.isDarwin [ xcodebuild ];
@@ -1143,6 +1176,26 @@ lib.composeManyExtensions [
11431176 }
11441177 );
11451178
1179+ orjson =
1180+ let
1181+ getCargoHash = version: {
1182+ "3.6.7" = "sha256-sz2k9podPB6QSptkyOu7+BoVTrKhefizRtYU+MICPt4=";
1183+ "3.6.8" = "sha256-vpfceVtYkU09xszNIihY1xbqGWieqDquxwsAmDH8jd4=";
1184+ }.${version} or null;
1185+ in
1186+ super.orjson.overridePythonAttrs (old: {
1187+ cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
1188+ inherit (old) src;
1189+ name = "${old.pname}-${old.version}";
1190+ hash = getCargoHash old.version;
1191+ };
1192+ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
1193+ pkgs.rustPlatform.cargoSetupHook
1194+ pkgs.rustPlatform.maturinBuildHook
1195+ ];
1196+ buildInputs = (old.buildInputs or [ ]) ++ lib.optional pkgs.stdenv.isDarwin pkgs.libiconv;
1197+ });
1198+
11461199 osqp = super.osqp.overridePythonAttrs (
11471200 old: {
11481201 nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.cmake ];
@@ -1150,6 +1203,29 @@ lib.composeManyExtensions [
11501203 }
11511204 );
11521205
1206+
1207+ pandas = super.pandas.overridePythonAttrs (old: {
1208+
1209+ buildInputs = old.buildInputs or [ ] ++ lib.optional stdenv.isDarwin pkgs.libcxx;
1210+
1211+ # Doesn't work with -Werror,-Wunused-command-line-argument
1212+ # https://github.com/NixOS/nixpkgs/issues/39687
1213+ hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow";
1214+
1215+ # For OSX, we need to add a dependency on libcxx, which provides
1216+ # `complex.h` and other libraries that pandas depends on to build.
1217+ postPatch = lib.optionalString stdenv.isDarwin ''
1218+ cpp_sdk="${lib.getDev pkgs.libcxx}/include/c++/v1";
1219+ echo "Adding $cpp_sdk to the setup.py common_include variable"
1220+ substituteInPlace setup.py \
1221+ --replace "['pandas/src/klib', 'pandas/src']" \
1222+ "['pandas/src/klib', 'pandas/src', '$cpp_sdk']"
1223+ '';
1224+
1225+
1226+ enableParallelBuilding = true;
1227+ });
1228+
11531229 pantalaimon = super.pantalaimon.overridePythonAttrs (old: {
11541230 nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.installShellFiles ];
11551231 postInstall = old.postInstall or "" + ''
@@ -1196,8 +1272,12 @@ lib.composeManyExtensions [
11961272
11971273 pillow = super.pillow.overridePythonAttrs (
11981274 old: {
1199− nativeBuildInputs = [ pkg-config self.pytest-runner ] ++ (old.nativeBuildInputs or [ ]);
1200− buildInputs = with pkgs; [ freetype libjpeg zlib libtiff libwebp tcl lcms2 ] ++ (old.buildInputs or [ ]);
1275+ nativeBuildInputs = (old.nativeBuildInputs or [ ])
1276+ ++ [ pkg-config self.pytest-runner ];
1277+ buildInputs = with pkgs; (old.buildInputs or [ ])
1278+ ++ [ freetype libjpeg zlib libtiff libwebp tcl lcms2 ]
1279+ ++ lib.optionals (lib.versionAtLeast old.version "7.1.0") [ xorg.libxcb ]
1280+ ++ lib.optionals (self.isPyPy) [ tk xorg.libX11 ];
12011281 }
12021282 );
12031283
@@ -1246,6 +1326,14 @@ lib.composeManyExtensions [
12461326 }
12471327 );
12481328
1329+ psycopg2cffi = super.psycopg2cffi.overridePythonAttrs (
1330+ old: {
1331+ buildInputs = (old.buildInputs or [ ])
1332+ ++ lib.optional stdenv.isDarwin pkgs.openssl;
1333+ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ];
1334+ }
1335+ );
1336+
12491337 py-solc-x = super.py-solc-x.overridePythonAttrs (
12501338 old: {
12511339 preConfigure = ''
@@ -1860,6 +1948,12 @@ lib.composeManyExtensions [
18601948
18611949 });
18621950
1951+ soundfile = super.soundfile.overridePythonAttrs (old: {
1952+ postPatch = ''
1953+ substituteInPlace soundfile.py --replace "_find_library('sndfile')" "'${pkgs.libsndfile.out}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}'"
1954+ '';
1955+ });
1956+
18631957 systemd-python = super.systemd-python.overridePythonAttrs (old: {
18641958 buildInputs = old.buildInputs ++ [ pkgs.systemd ];
18651959 nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkg-config ];