-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Poetry 1.4.0 can't build (editable) dependencies requiring setuptools <64 #7583
Comments
related to #7574? not sure I understand how all the parts fit together but I'd try with that fix anyway |
Ah yeah, I forgot to post, but I tried installing from that PR and got the same error. |
I'm not sure how convincing the above I know that pip has an error message about this, perhaps you ought to run into that .
IIUC I think that the dependency on a recent setuptools is something that your project ought to be declaring, rather than a poetry issue? |
Apart from that the proposed command has to be improved:
@JacobHayes Can you try if |
That works fine:
I thought even before poetry 1.4.0, these editable deps were being built with
I think the issue is that my sub-dependency (not the current project) requires an older version of |
Also, I think I tried this with #7579, but perhaps I messed up the installation or was still pointing to the wrong installation. I can test again after that is merged. |
so I think pip makes this work by calling poetry is often at the vanguard of dropping support for such things (or less willing to sink effort into backwards compatibility, depending on your point of view). eg see also its insistence on pep-517 builds hard to say as yet how common it is for projects deliberately to pin to an old version of setuptools. it feels like an unusual thing to do; on the other hand you've raised this barely a day after poetry 1.4.0 was released so perhaps there are more like you out there. you say that you don't particularly care about support for older setuptools and I tend to think that we should encourage that position. ie I'd advocate for poetry telling people who run into this: you need to allow a newer setuptools (or fall back to the old installer, or just not use poetry). dunno whether this is worth a new error message specifically calling out this possible cause, perhaps it depends how many duplicates of this issue show up! Regardless, thanks for the report, it has sent me down an interesting technical rabbit-hole... |
We ran into the same issue that @JacobHayes mentioned since we updated to Poetry 1.4.0 with an editable dependency:
Poetry install fails with:
The check for pep517 succeeds:
For now we went back to Poetry 1.3.2 Edit |
please provide a reproducible example if you hope for anyone to look at this |
Wrong Tab |
We are generating an OpenAPI client(openapi-generator) and testing it in CI using editable mode. With 1.4, the client is not importable: <project>/core/tests/test_client.py:15:0: E0401: Unable to import 'openapi_client.apis' (import-error)
<project>/core/tests/test_client.py:15:0: E0611: No name 'apis' in module 'openapi_client' (no-name-in-module)
<project>/core/tests/test_client.py:27:0: E0401: Unable to import 'openapi_client.models' (import-error)
etc. Reverting to 1.3.1 worked |
@miguelvalente you have replied to a comment from a different issue altogether, I see no connection with this issue @adinhodovic: what you are describing also has no apparent connection with what this issue is about |
Can reproduce with a simple example of two projects (lib-a and lib-b), [tool.poetry]
name = "lib-a"
version = "0.1.0"
description = ""
authors = ["John Smith <john@example.com>"]
packages = [{include = "lib_a"}]
[tool.poetry.dependencies]
python = "~3.9"
requests = "^2.21.0"
[tool.poetry.group.dev.dependencies]
pytest = "^7.2.0"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api" [tool.poetry]
name = "lib-b"
version = "0.1.0"
description = ""
authors = ["John Smith <john@example.com>"]
packages = [{include = "lib_b"}]
[tool.poetry.dependencies]
python = "~3.9"
requests = "^2.21.0"
lib-a = {path = "../libA", develop = true}
[tool.poetry.group.dev.dependencies]
pytest = "^7.2.0"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api" Throws
when running |
@md384 you are using a (different) ancient backend you want something like [build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api" |
@dimbleby yes, that was the problem for us, changing that in our |
we have the same problem, also using the "develop = true" flag in on of our dependencies. Also going back to 1.3. |
After upgrading to poetry 1.4.2 we had an issue where setuptools was finding multiple top level packages, and changing the build-system to the above fixed our issue. This is a huge relief because it means that we don't have to change our |
I got struck by this problem: python-poetry/poetry#7583 While trying to install `gluetool-modules-internal` with path dependency on `gluetool-modules-framework` with `develop = true`. ``` • Installing gluetool-modules-framework (0.9.0 /var/home/mvadkert/git/gitlab.com/testing-farm/gluetool-modules): Failed ChefBuildError Backend operation failed: HookMissing('build_editable') ``` This resolves the problem. Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
Yeah, seems
|
I got struck by this problem: python-poetry/poetry#7583 While trying to install `gluetool-modules-internal` with path dependency on `gluetool-modules-framework` with `develop = true`. ``` • Installing gluetool-modules-framework (0.9.0 /var/home/mvadkert/git/gitlab.com/testing-farm/gluetool-modules): Failed ChefBuildError Backend operation failed: HookMissing('build_editable') ``` This resolves the problem. Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
I got struck by this problem: python-poetry/poetry#7583 While trying to install `gluetool-modules-internal` with path dependency on `gluetool-modules-framework` with `develop = true`. ``` • Installing gluetool-modules-framework (0.9.0 /var/home/mvadkert/git/gitlab.com/testing-farm/gluetool-modules): Failed ChefBuildError Backend operation failed: HookMissing('build_editable') ``` This resolves the problem. Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
I got struck by this problem: python-poetry/poetry#7583 While trying to install `gluetool-modules-internal` with path dependency on `gluetool-modules-framework` with `develop = true`. ``` • Installing gluetool-modules-framework (0.9.0 /var/home/mvadkert/git/gitlab.com/testing-farm/gluetool-modules): Failed ChefBuildError Backend operation failed: HookMissing('build_editable') ``` This resolves the problem. Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
I got struck by this problem: python-poetry/poetry#7583 While trying to install `gluetool-modules-internal` with path dependency on `gluetool-modules-framework` with `develop = true`. ``` • Installing gluetool-modules-framework (0.9.0 /var/home/mvadkert/git/gitlab.com/testing-farm/gluetool-modules): Failed ChefBuildError Backend operation failed: HookMissing('build_editable') ``` This resolves the problem. Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
This comment was marked as spam.
This comment was marked as spam.
This is still happening, although the circumstances for it are admittedly weird. |
This is for anyone that uses Homebrew on Mac having this issue. I've installed poetry with homebrew and I don't recommend it because over time running brew upgrades created a version mistmatch between the python formula and the poetry formula and I had python 3.11 with a poetry that used the forumla for python 3.12.
Now poetry will be tied to that python version you chose and those errors will go away. |
refs https://python-poetry.org/docs/pyproject#poetry-and-pep-517 Fixes an error encountered when trying to add a local version of this package as an editable dependency to another local project: ``` poetry add -e <path-to-repo> ... ChefBuildError Backend operation failed: HookMissing('build_editable') at ~/.pyenv/versions/3.11.4/lib/python3.11/site-packages/poetry/installation/chef.py:147 in _prepare 143│ 144│ error = ChefBuildError("\n\n".join(message_parts)) 145│ 146│ if error is not None: → 147│ raise error from None 148│ 149│ return path 150│ 151│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path: Note: This error originates from the build backend, and is likely not a problem with poetry but with strawberry-django-auth (0.376.4 ~/repos/strawberry-django-auth) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 --editable "/Users/jwegner/Data/development/repos/jacobwegner/strawberry-django-auth"'. ``` refs python-poetry/poetry#7583 (comment)
Sorry if this is not helpful... but I had the same error and eventually discovered it was because the python version I had built via pyenv was missing libffi. I added |
pretty much all comments on this are unrelated to the thing that it actually reports, which is a very specific issue about editable dependencies and pins to old versions of setuptools. setuptools 64.0 was not that old when this was reported: but it is now a year older - the likelihood and value of anyone doing anything with this are both diminishing by the day. suggest that the issue might as well be be closed out, it seems to be acting only as a honeytrap |
Thanks, forgot this issue was still open. Agreed on diminishing returns to OP |
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. |
Poetry version: Poetry (version 1.4.0)
Python version: 3.11.2
OS version and name: macOS 13.2.1
pyproject.toml: https://gist.github.com/JacobHayes/110054b6c6d19ca9d6d811c8b4eca374
I am on the latest stable Poetry version, installed using a recommended method.
I have searched the issues of this repo and believe that this is not a duplicate.
I have consulted the FAQ and blog for any relevant entries or release notes.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option) and have included the output below.Issue
After upgrading to poetry 1.4.0, I get errors installing local editable deps that require setuptools <64. setuptools 64 changed how editable deps are installed, breaking static analysis tools. It's limited to some perhaps esoteric cases (namespace packages where you don't want to include the namespace itself... which you usually don't).
The error is
Backend operation failed: HookMissing('build_editable')
, which presumably was added in setuptools 64.In the grand scheme of setuptools versions, 64 is relatively new (Aug 2022) and think I've occasionally seen much older pins. That said, I don't particularly care if poetry supports the older setuptools versions (I'm slowly migrating away from a structure causing this issue anyway), but it would be good to have the setuptools>64 requirement for built packages documented (at least in the CHANGELOGs) and report a better error, if not some installer fallback.
Here's the sanitized output:
Trying the command (which was improperly quoted with the
python_version
) to check whether it is a poetry or build issue succeeds:The text was updated successfully, but these errors were encountered: