-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add install instructions for editable Python installation #721
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See earlier PR - #720.
Co-authored-by: Jørgen Schartum Dokken <dokken@simula.no>
I think this PR is a little more complete than #720 |
720 is not complete as it doesn't specify the build requirements. |
As user, I struggle to understand
|
It has too much text. Too much to read and too much that can go out of date. The instructions are for developers, who can do a bit of work themselves. |
I dont this this is fair. It is far from trivial to get this to work. The other PR doesn’t even have valid instructions, as it is missing pins and build dependencies |
I'm not sure what the cause of the issue is, but if you don't use build-isolation, you get the following error when import basix:
|
I guess that my question is more: how come that |
@francesco-ballarin It is a bug in scikit-build-core latest version for editable builds that will be fixed upstream at some point. |
Note that even pining scikit-build-core doesn’t help wrt removing build isolation. So there are two scikit bugs here:
|
A compromise would be to use split install in one of the CIs, as it would then be easily maintainable and easily accessed by developers. |
I think that this run on the CI is trying to do this, but perhaps needs updating? Or do you mean something else by split install? |
It does a split install, but not a split editable installation. Most developers would probably use the editable install option (which has the requirements described above). |
We change it to editable. Or include both (is there any benefit to having both?) |
Well, it would give better coverage. In any case, we would need the build_requirements.txt to be Added to Basix. |
@@ -5,13 +5,20 @@ | |||
Basix can be installed using | |||
|
|||
```console | |||
pip install . | |||
python3 -m pip install . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The former was fine. Less is more.
For Python development, an editable install can be done with | ||
|
||
```console | ||
python3 -m pip -v install -r build-requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-v
not required
|
||
```console | ||
python3 -m pip -v install -r build-requirements.txt | ||
python3 -m pip -v install --config-settings=build-dir="build" --config-settings=cmake.build-type="Debug" --no-build-isolation -e . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-v not required
### Python interface | ||
|
||
After installing the C++ library, install the Python interface by running in | ||
the directory `python/`: | ||
|
||
```console | ||
pip install . | ||
python3 -m pip install . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use short version.
@@ -0,0 +1,2 @@ | |||
scikit-build-core[pyproject]==0.5.1 # Pinned due to https://github.com/scikit-build/scikit-build-core/issues/532 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't pin scikit-build-core
; we support it, but it has a specific issue with editable install. spack
, for example, could use a higher version without problems.
Add a note on editable builds and the scikit-build-core
version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use markdown. We avoid rst where possible.
Basix Python interface | ||
======================== | ||
|
||
This document explains how to install the Basix Python interface, given that the C++ interface has been built. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shorten text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See earlier version comments.
|
||
2. Ensure the build time requirements are installed:: | ||
|
||
python3 -m pip -v install -r build-requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use pip
(shorter) and no need for -v
.
|
||
3. Build Basix Python interface:: | ||
|
||
python3 -m pip -v install --no-build-isolation . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comments.
Closing this as the editable issue was fixed by #727. Can be re-opened with any refinements of the docs. |
Tested with:
and
Resolves #719