[WIP] Perform pip -e install in configure step already.
Related to #279 (closed)
I propose to call pip install -e
for a DUNE python module in the configuration step already, instead when building all
.
The editable install would be disabled when disabling the venv setup.
There is then only the target
No target related to the venv setup is remaining in metadata_${envtargetname}
remaining in all
. Maybe this could also be removed when not using the venv.all
any more.
@tkoch With this you would have no pip install -e
and no metadata target any more when calling make all
., and even no one left when disabling the venv. What do you think?
Current Status: We will incorporate these changes into the changes of !1148 (merged).
TODO:
-
Replace the ,
separator in cmake_flagswith something differentby<SEP>
. -
Incorporate the changes into !1148 (merged).
Merge request reports
Activity
assigned to @tkoch
Nightly tests seem to work (one failed pipeline but that looks like a runner problem).
@samuel.burbulla could you try the github test scenario workflow if you haven't already done so.
Also I would like to make sure that changes in the Python sources are correctly picked up with this approach. For example: Can one add a new script or change a script? What about changes to one of the recompiled Python modules like
_fem.so
. That will of course require amake all
but I would hope that no newpip install -e
is needed. We should make sure.How can I test only one different branch in dune-common?
What do you mean? You can add the branch name in the github workflow and it is combined with master of the other modules if the branch name doesn't exist there. On the
dune-nightly-test
git repo you can trigger a pipeline and provide the variableCI_BUILD_REF_NAME
with the branch name you want to use (again main will be used if the branch name doesn't exist).But I'm not sure this answers your question?
Just a remark: a nice benefit of this approach is that the
requirements satisfied
output duringmake all
would disappear which I'm not quite sure how to do otherwise. The editable installation happens with--no-index
so no packages are downloaded but the local wheels are checked and that is causing the verbosepip
output we are seeing. Looking for packages there is used in the nightly tests to obtaining e.g. thedune.common
package form its previously generated wheel when buildingdune-geometry
. But that should still work with @samuel.burbulla changes - it would just not happen duringmake all
.Moving the generation of the
metadata
file as well should actually be possible as well as long as it happens after thedune
package was taken care of.Edited by Andreas DednerSimply replacing the metadata targets did not work out. Maybe I did something wrong. @andreas.dedner Do you have a specific idea in mind?
I managed to perform the generation of the metadata files in the configuration step.
Now,
make
remains only with[ 20%] Built target _typeregistry [100%] Built target dunecommon [100%] Built target _common
I tested the internal dune-venv, an external venv and installing the packaged source distribution. Everything works as expected in my opinion.
@andreas.dedner Could you have a look and test?
Hi Samuel. Thanks for looking at this. Did you test the full nightly builds as well with branch?
Btw: our pypi packages seem broken at the moment due to some pip issue. https://github.com/adedner/dune-testpypi/actions/runs/2273111986 There is a pre release version of pip that is used that then leads to some version conflict with our >=21 versioning. A simple --pre install on my system locally now also fails. I have no idea why. If you have any idea how what the problem could be let me know Andreas
The nightly builds are working (except some minor issues with dune-alugrid unrelated to my changes). I also triggered a run on the dune-testpypi on this branch which was successful.
The pypi packages are working again with the changes on feature/generalize-packaging-script, adding a
.a
helps to include the pre-release.@samuel.burbulla can you update the MR description about the metadata target?
- Resolved by Samuel Burbulla
added 38 commits
-
4cbae614...103c05be - 36 commits from branch
master
- c0a3521c - Perform pip -e install in configure step already.
- 5203e2ef - Remove one ALL.
-
4cbae614...103c05be - 36 commits from branch
I'm sorry I have very limited time at the moment :(. So I'm just going to throw this in here (probably the wrong place) but I see a third solution to the not "polluting" the all target issue.
dunecontrol all
could run bothmake all
andmake python_install_editable
. Thendunecontroll all
would do the same as before but there is also the possibility to build the targets separately.Edited by Timo Koch
added 21 commits
-
5203e2ef...c31f2b54 - 18 commits from branch
master
- 3af2fab0 - Perform pip -e install in configure step already.
- a879b979 - Remove one ALL.
- 453c1d87 - Move generation of metadata file into configuration.
Toggle commit list-
5203e2ef...c31f2b54 - 18 commits from branch
added 1 commit
- d5c4e5fe - Add some escaping backslashes to correctly parse cmake_flags.
added 1 commit
- 79ea69de - Use delimiter "," to correctly parse cmake_flags.
added 72 commits
-
79ea69de...183ca5b6 - 71 commits from branch
master
- b6941e0b - Perform pip -e install in configure step already.
-
79ea69de...183ca5b6 - 71 commits from branch
Ready from my side. I will run the pipelines, GitHub testpypi and Nightly tests again.
@andreas.dedner When all of the pipelines succeed, could you have a final look?
Two remarks:
-
I had to remove the DEPENDS flag of the
dune_python_install_package
function as it can not be appended anymore. In my tests this seems not to be necessary and also simplifies the call of the function. I propose to deprecate the argument with a warning. Do you see any problems with that? -
The list of cmake_flags had to be transformed into a string with "," as delimiter, because different platforms show differing behaviour now when the list is expanded. Sometimes I needed two escape characters, sometimes not... The function in packagemetadata.py has been adapted accordingly, is this fine or does this occur anywhere else?
If there are no objections, I will merge this in the next days.
-
@samuel.burbulla @santiago.ospina: the changes here are going to clash heavily with !1148 (merged). Perhaps it is possible to combine this directly in !1148 (merged) without merging this MR? @samuel.burbulla, have you had a look at Santiago's changes?
That makes sense. As far as I understand, changes here fit with the idea of installing any python package from this function. Maybe a recap for @samuel.burbulla: !1148 (merged) is a work in progress that reactors
dune_python_install_package
into small functions that can be combined to either install the bindings or any other python package from source. See !1148 (comment 116789) for details of the intended sub-functions.Personally, either type of merging that you prefer is ok. In any case, the merge conflicts will have to be sorted out somewhere...
I agree somehow that it makes sense to combine those MRs. Unfortunately, I do not understand everything what's going on in !1148 (merged), so I'm not sure if I will merge this correctly. Therefore, my proposal is to rebase !1148 (merged) on this MR, what basically coincides with merging this MR first and rebasing !1148 (merged) on master.
General question: Isn't it preferable to have smaller MRs with clear objectives/changes and a working pipeline that are merged separately?
Regarding !1148 (merged), I will have a look, add comments and raise questions.
assigned to @samuel.burbulla and unassigned @tkoch
How does this integrate with the efforts in !1104 (closed)?
that's clear but does it make it more difficult conceptually to realize !1104 (closed)?
- Resolved by Samuel Burbulla
Closed because changes are incorporated in !1148 (merged).
mentioned in merge request !1148 (merged)