Open InLaw opened 1 year ago
I can reproduce this. Exception means that the PyPDF used is too new for this build of odoo. Haven't looked into fixing this yet; Not sure when it changed either.
https://github.com/odoo/odoo/blob/16.0/requirements.txt#L42C1-L43C41
PyPDF2==1.26.0 ; python_version <= '3.10'
PyPDF2==2.12.1 ; python_version > '3.10'
/odoo/lock-x86_64-linux.json
"pypdf2": {
"sha256": "d16e4205cfee272fbdc0568b68d82be796540b1537508cef59388f839c191928",
"url": "https://files.pythonhosted.org/packages/8e/5e/c86a5643653825d3c913719e788e41386bee415c2b87b4f955432f2de6b2/pypdf2-3.0.1-py3-none-any.whl",
"version": "3.0.1"
},
dream2nix ignores the requirements/specifications (currently), right?
pypiSnapshotDate = "2023-04-01";
(that could be a nice and important note currently in the docs?)how would you patch pypdf2 in pip = { drvs = {
?
As workaround and easier/ad-hoc would be postPatch
it
dream2nix ignores the requirements/specifications (currently), right? it purely takes all packages (by name) from pypiSnapshotDate = "2023-04-01
No, it respects version, environment and extra markers. There's most probably something broken w.r.t. to the resolution at the moment, but we'll need to look into it a bit closer.
how would you patch pypdf2 in pip = { drvs = { ?
It uses drv parts. See odoos default.nix for an example of attribute overrides, i.e. doCheck
for pypdf2 is currently set to false there. You should be able to use `pip.drvs.pypdf2.mkDerivation.postPatch
when trying pip.drvs.pypdf2.mkDerivation.postPatch
/build
the node is not yet created in nix/store mv: cannot stat '/nix/store/k7fwq6fmpwzasasyxy3mw5vwr1gpj6j5-python3.11-pypdf2-3.0.1/lib/python3.11/site-packages/PyPDF2/_utils.py': No such file or directory
Where would be the place (in the dream2nix logic/workflow) for the package file renaming if pip.drvs.pypdf2.mkDerivation
"only" creates a whl file?
Still a problem on latest main.
dream2nix ignores the requirements/specifications (currently), right?
To elaborate on that: It respects those markers, but we currently only rely on the markers in odoos setup.py/setup.cfg/pyproject, we don't use requirements.txt
And https://github.com/odoo/odoo/blob/2d42fd69cada3b1f2716c3d0a20bec6170f9b226/setup.py mentions only "PyPDF2" thats why we are getting the most recent version here.
Will try to free some time to look into the details of switching to requirements.txt for this use-case, as I'll review https://github.com/nix-community/dream2nix/pull/543/files which deals with a similar issue.
is there a reason why python is in some packages fixed to
python38
and in others topython39
?/nix/store/xl6q8j50a5lcf0ixxpxnlyvnxk7ybd3l-python3.8-odoo-16.0/bin/odoo