Unable to build wheel for poetry-core 1.1.0 if poetry 1.1.15 is installed
- [ ] I am on the latest Poetry version.
- [x] I have searched the issues of this repo and believe that this is not a duplicate.
- [ ] If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
- OS version and name: MacOS X 10.15
- Poetry version: 1.1.15
- Link of a Gist with the contents of your pyproject.toml file: n/a
Issue
I am unable to get the build package to create a wheel of poetry-core 1.1.0 if poetry 1.1.15 is installed. If the virtualenv is empty (no poetry installed) it works. If only poetry-core 1.0.8 is installed it works. But if both poetry 1.1.15 and poetry-core 1.0.8 are installed I am unable to build a wheel for poetry-core 1.1.0.
To reproduce, I have a virtualenv with just poetry installed in it:
$ virtualenv -p python3.10 venv
$ source venv/bin/activate
$ pip install build; pip install poetry==1.1.15
I download the source tarball for the new version of poetry-core, untar it, and cd to the directory. I then run build to produce the wheel:
$ cd poetry-core-1.1.0/
~/poetry-core-1.1.0$ python -m build --wheel --no-isolation --outdir ../outdir/
* Getting dependencies for wheel...
Traceback (most recent call last):
File "/Users/david/poetrytest/venv/lib/python3.10/site-packages/pep517/wrappers.py", line 321, in _call_hook
raise BackendInvalid(
pep517.wrappers.BackendInvalid
ERROR Backend operation failed: BackendInvalid()
The --no-isolation is because we want to run it in the virtualenv and not create a new, nested, empty virtualenv for the build. But if you were to omit that option it would build the wheel just fine.
This may sound a little bit exotic, and it is. I'm the packager of poetry for the MacPorts package manager. The way MacPorts supports pep517 builds is to download the plain release tarball and then run python -m build --wheel --no-isolation --outdir ... as shown in order to create the wheel. They do the --no-isolation because a typical pep517 build (i.e. not one that is a build-backend like poetry-core is) needs to get access to the build backend that has previously been installed for it in the Python global package root.
poetry 1.1 is out of support, did you try with poetry 1.2?
This is about the upgrade path from poetry 1.1.15 to 1.2.
too bad then I guess, I don't expect anyone will be back-applying any change to 1.1.15 to address this (if we even understood how to do that)
You don't need to change poetry 1.x, and you have the right mindset of treating the old branches as immutable. The issue is with installing the latest version of poetry-core, and the fix would go in there, along with a new poetry-core release.
it sounds as though you understand more than I do about what fix would be needed - care to share? I expect an MR would be welcome!