10 Jul 2024 |
TyberiusPrime (smilodon inopinatus) | by doing
postPatch = ''
sed -i pyproject.toml -e 's/numpy==[0-9]\+\.[0-9]\+\.[0-9]\+;/numpy;/g'
# somehow the type information doesn't get build
substituteInPlace setup.py --replace-fail '[ r"python/cv2/py.typed" ] if sys.version_info >= (3, 6) else []' "[]" \
--replace-fail 'rearrange_cmake_output_data["cv2.typing"] = ["python/cv2" + r"/typing/.*\.py"]' "pass"
'';
| 10:04:57 |
TyberiusPrime (smilodon inopinatus) | (basically, by saying to not build the py.typed file) | 10:05:14 |
truh | My current workaround is p2n.defaultPoetryOverrides.extend (self: super: { opencv-contrib-python = super.opencv4; }) & dontCheckRuntimeDeps = true; but your patch thing looks more reasonable | 10:07:42 |
truh | Honestly feels like a bit of a waste not to use all those handcrafted build expressions in nixpkgs, I guess those only need to work with specific versions so maybe more problems than gain by using them. | 10:09:48 |
TyberiusPrime (smilodon inopinatus) | yeah, I've been at least stealing the patches from nixpkgs, but you're right, they only need to work with one exact version | 10:11:05 |
truh | I somewhat surprised opencv-python ever worked without the nixpkgs stuff, given that they download stuff during the cmake build | 10:11:12 |
TyberiusPrime (smilodon inopinatus) | In reply to @truh:matrix.org I somewhat surprised opencv-python ever worked without the nixpkgs stuff, given that they download stuff during the cmake build I can't comment on that, since I have no clue about opencv or it's build process. I just went and tried to fix as many packages as possible | 10:11:50 |
TyberiusPrime (smilodon inopinatus) | (and my test 'matrix' is already bonkers... I try to build 17k python packages, each individually locked by poetry, and that ends up being >100k package*version builds.) | 10:12:55 |
TyberiusPrime (smilodon inopinatus) | (my nixpkgs copy doesn't seem to have opencv-python at al. or maybe not in python-modules at least) | 10:13:34 |
truh |  Download Screenshot 2024-04-29 at 17.14.15.png | 10:13:54 |
truh | python3Packages.opencv4 is https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/opencv/4.x.nix | 10:14:42 |
TyberiusPrime (smilodon inopinatus) | no I do it because I've failed my will power check and now I have a brain bug that says 'must build more packagesssss' | 10:14:47 |
TyberiusPrime (smilodon inopinatus) | but I'll get this PR landed, and then I'll have a look at whether or not poetry2nix is actually reading the build-systems from pyproject.toml ^^ | 10:15:51 |
TyberiusPrime (smilodon inopinatus) | but I really wanted it to got from 41% build packages to 82%... I'm only at 80% | 10:16:29 |
truh | no more manual overrides for setuptools, etc? | 10:16:30 |
TyberiusPrime (smilodon inopinatus) | the PR started with 'hey, we can just add setuptools if we see a setup.py but no pyproject.toml', and then we can get rid of half of these build-overrides | 10:16:55 |
TyberiusPrime (smilodon inopinatus) | then I defined some largish package sets of 'important' python packages | 10:17:21 |
TyberiusPrime (smilodon inopinatus) | tried building every single one of them | 10:17:32 |
truh | I thought that couldn't be done because poetry2nix would need this info to be in the poetry.lock of the main project | 10:17:47 |
TyberiusPrime (smilodon inopinatus) | and found that poetry2nix can only do 41% of them. | 10:17:52 |
TyberiusPrime (smilodon inopinatus) | In reply to @truh:matrix.org I thought that couldn't be done because poetry2nix would need this info to be in the poetry.lock of the main project well, nobody told me. I just went down to where the actual package is being build, and said 'nix, look into the $src' | 10:18:38 |
TyberiusPrime (smilodon inopinatus) | so after all the resolution of 'what version we need' has been done. | 10:18:57 |
TyberiusPrime (smilodon inopinatus) | and of course that does have the drawback that nix has to download the source before it knows how to build the package | 10:19:15 |
truh | I guess if you don't need the info earlier than that it should work out. | 10:19:37 |
TyberiusPrime (smilodon inopinatus) | it's the same place that overrides/build-systems.json comes into play | 10:19:52 |
truh | Oh really, never made it that far into the abyss myself | 10:20:41 |
TyberiusPrime (smilodon inopinatus) | and now I'm thinking that there's terrible little difference between 'fileExists ${src}/pyproject.toml', and actually importTOML | 10:20:59 |
TyberiusPrime (smilodon inopinatus) | and yes, obviously it would be worlds nicer if poetry.lock actually had version-locked build-system information. | 10:21:15 |
TyberiusPrime (smilodon inopinatus) | but it don't | 10:21:18 |
TyberiusPrime (smilodon inopinatus) | and I think that we're pulling the build-system packages from nixpkgs anyway. | 10:21:32 |