-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Support for PEP 660 editable backend with different build-system #5655
Comments
What version of poetry are you using? Maybe try master? https://github.com/python-poetry/poetry/blob/master/src/poetry/installation/executor.py#L572-L573 We should already be running |
@abn Yes... I have a really hard time figuring what happened with poetry versions. Either there is a nasty/hidden item I am unable to remove, either there is definitely something wrong in the jump from 1.1 to 1.2. I started by cleaning any poetry related installations/folders, then got the same result with master whatever the installation method I use.
|
If this is your |
@zifeo can you post the logs for the same command but with Install Poetry from VCSpipx install --force --suffix=@git 'poetry @ git+https://github.com/python-poetry/poetry.git' @Secrus seems the issue here is during project inspection, we should in theory support any project that is built by a PEP 517 build backend. Unless I am missing something obvious here. I suspect the relevant code is here. poetry/src/poetry/inspection/info.py Lines 465 to 498 in 03e9c2b
|
@zifeo I don't think that is the right solution here though. What you have done is basically fed poetry that information. Ideally, that should come from |
|
Ah. Thanks @zifeo. This gives a better picture of what's going on. We seem to be overly restrictive on what constitutes a python project. We should really be checking for the presence of the |
@zifeo would be great if you can test the fix as detailed in python-poetry/poetry-core#368 (comment). Note that I'd recommend you remove the |
@abn Followed instruction and got a similar behaviour (no
|
Says it's using the old code. Did you do the |
@abn I copy pasted your commands from the pull request |
@zifeo looks like the command was incorrect. My bad. Try this. pipx inject --force --pip-args="--force --no-deps" poetry@5655 'poetry-core @ git+https://github.com/python-poetry/poetry-core.git@refs/pull/368/head' |
@abn Still failing:
|
Hmm. Thanks for testing @zifeo I'll try get a project setup to test. |
@zifeo tried to create a simple project to try it out. Seems to be working fine with the PR. See the example below. podman run --rm -i --entrypoint bash python:3.10 <<EOF
set -xe
export PATH=/root/.cargo/bin:/root/.local/bin:\$PATH
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -q
pip --quiet --disable-pip-version-check install pipx
pipx install maturin
pipx install --force --suffix=@5655 'poetry @ git+https://github.com/python-poetry/poetry.git'
pipx inject --force --pip-args="--force --no-deps" poetry@5655 'poetry-core @ git+https://github.com/python-poetry/poetry-core.git@refs/pull/368/head'
poetry@5655 new foobar
pushd foobar/
maturin new -b pyo3 native
poetry@5655 add --editable ./native
poetry@5655 show
cat native/pyproject.toml
EOF output
+ export PATH=/root/.cargo/bin:/root/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ PATH=/root/.cargo/bin:/root/.local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ curl --proto =https --tlsv1.2 -sSf https://sh.rustup.rs
+ sh -s -- -y -q
info: downloading installer
...
info: default toolchain set to 'stable-x86_64-unknown-linux-gnu'
stable-x86_64-unknown-linux-gnu installed - rustc 1.61.0 (fe5b13d68 2022-05-18)
Rust is installed now. Great!
...
source $HOME/.cargo/env
+ pip --quiet --disable-pip-version-check install pipx
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
+ pipx install maturin
creating virtual environment...
creating shared libraries...
upgrading shared libraries...
installing maturin...
installed package maturin 0.12.17, installed using Python 3.10.2
These apps are now globally available
- maturin
done! ✨ 🌟 ✨
+ pipx install --force --suffix=@5655 'poetry @ git+https://github.com/python-poetry/poetry.git'
creating virtual environment...
determining package name from 'poetry@ git+https://github.com/python-poetry/poetry.git'...
creating virtual environment...
installing poetry from spec 'poetry@ git+https://github.com/python-poetry/poetry.git'...
installed package poetry 1.2.0b2.dev0 (poetry@5655), installed using Python 3.10.2
These apps are now globally available
- poetry@5655
done! ✨ 🌟 ✨
+ pipx inject --force '--pip-args=--force --no-deps' poetry@5655 'poetry-core @ git+https://github.com/python-poetry/poetry-core.git@refs/pull/368/head'
creating virtual environment...
determining package name from 'poetry-core@ git+https://github.com/python-poetry/poetry-core.git@refs/pull/368/head'...
installing poetry-core from spec 'poetry-core@ git+https://github.com/python-poetry/poetry-core.git@refs/pull/368/head'...
done! ✨ 🌟 ✨
injected package poetry-core into venv poetry@5655
+ poetry@5655 new foobar
Created package foobar in foobar
/foobar /
+ pushd foobar/
+ maturin new -b pyo3 native
✨ Done! New project created native
+ poetry@5655 add --editable ./native
Creating virtualenv foobar-lWDpn5M1-py3.10 in /root/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...
Writing lock file
Package operations: 1 install, 0 updates, 0 removals
• Installing native (0.1.0 /foobar/native)
+ poetry@5655 show
native 0.1.0 native
+ cat native/pyproject.toml
[build-system]
requires = ["maturin>=0.12,<0.13"]
build-backend = "maturin"
[project]
name = "native"
requires-python = ">=3.6"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
Are you sure the [build-system]
requires = ["maturin>=0.12,<0.13"]
build-backend = "maturin" |
@abn I removed my dirty? lockfile to see my pyproject was a in subfolder 😟 The fix is indeed working well now, thanks for the reactivity. Can you clarify the behaviour with the --editable setup? When will it rebuild and when will it not ( |
When "editable" is used, this works the same way as If you update the code, the expectation is for you to run any build steps manually within the project. Alternatively, uninstall and reinstall: or update the package metadata. This is because as far as poetry is concerned, if the metadata has not changed it needs to do nothing for the package. |
@abn Thanks again, everything still work fine. When will the poetry-core be upgraded into poetry? I am looking to find a way to use the fix without pipx and most of the attempt fail because of https://github.com/python-poetry/poetry/blob/master/pyproject.toml#L47 |
Is there an estimate of when the next version with the fix will be available? I'm stuck on this as well. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
Currently poetry supports
setup.py
or poetry based local package:However other build-systems are not supported (e.g. https://maturin.rs/develop.html#pep-660-editable-installs)
The text was updated successfully, but these errors were encountered: