Skip to content
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-core 1.0.1 release breaks installation poetry via pip #3650

Closed
3 tasks done
playpauseandstop opened this issue Feb 5, 2021 · 30 comments · Fixed by python-poetry/poetry-core#134
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@playpauseandstop
Copy link
Contributor

  • I am on the latest Poetry version.
  • 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 (-vvv option).
  • OS version and name: ubuntu-latest at GHA
  • Poetry version: 1.1.4

Issue

Unfortunately, poetry-core==1.0.1 release breaks poetry, when installed via pip.

Steps to reproduce

  1. Create virtual environment for test: python3 -m venv /path/to/venv
  2. Install poetry within venv: /path/to/venv/bin/python3 -m pip install poetry==1.1.4
  3. Attempt to get help: /path/to/venv/bin/poetry --help
  4. Results in error below,
Traceback (most recent call last):
  File "bin/poetry", line 5, in <module>
    from poetry.console import main
  File "/path/to/venv/lib/python3.8/site-packages/poetry/console/__init__.py", line 1, in <module>
    from .application import Application
  File "/path/to/venv/lib/python3.8/site-packages/poetry/console/application.py", line 7, in <module>
    from .commands.about import AboutCommand
  File "/path/to/venv/lib/python3.8/site-packages/poetry/console/commands/__init__.py", line 4, in <module>
    from .check import CheckCommand
  File "/path/to/venv/lib/python3.8/site-packages/poetry/console/commands/check.py", line 2, in <module>
    from poetry.factory import Factory
  File "/path/to/venv/lib/python3.8/site-packages/poetry/factory.py", line 16, in <module>
    from .packages.locker import Locker
  File "/path/to/venv/lib/python3.8/site-packages/poetry/packages/__init__.py", line 2, in <module>
    from .locker import Locker
  File "/path/to/venv/lib/python3.8/site-packages/poetry/packages/locker.py", line 28, in <module>
    from poetry.core.packages.package import Dependency
ImportError: cannot import name 'Dependency' from 'poetry.core.packages.package' (/path/to/venv/python3.8/site-packages/poetry/core/packages/package.py)

How to fix

Install poetry-core==1.0.0 version, when installing poetry via pip.

Reason

poetry.core.packages.package is not a source of Dependency class, it only imports it for type checking: https://github.com/python-poetry/poetry-core/blob/master/poetry/core/packages/package.py#L27

ps. Yes, I understand, that installing poetry via pip is not an official installation method. But at a moment it is an easiest way to install poetry at GitHub Actions

@playpauseandstop playpauseandstop added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 5, 2021
@jdark-tremor
Copy link

Changing line 28 from from poetry.core.packages.package import Dependency to from poetry.core.packages.dependency import Dependency in site-packages/poetry/packages/locker.py fixed it for me.

@djerraballi
Copy link

Ran into this as well, immediately breaked pipelines.. probably need to yank 1.0.1

@gzamb
Copy link

gzamb commented Feb 5, 2021

Was just updating a repo and ran into the same problem. Had to downgrade back to explicitly use 1.0.0 for it to fix

@willronchetti
Copy link

Same issue for us across all our builds/packages.

@ghost
Copy link

ghost commented Feb 5, 2021

same here, all my build pipelines are failing

@arlopezg
Copy link

arlopezg commented Feb 5, 2021

Pipelines stopped working about 30mins ago

@wxcsdhr
Copy link

wxcsdhr commented Feb 5, 2021

Same here. it breaks poetry itself, we have poetry==1.1.4 but the pipelines are failing because of this error

@gitpushdashf
Copy link

Same issue. Fresh Docker container, pip3 install poetry, poetry is broken.

@jeremiq
Copy link

jeremiq commented Feb 5, 2021

Version locking poetry to 1.0.0 avoids this error. Not great, but it got our builds working again.

pip3 install poetry==1.0.0

@tokuchan
Copy link

tokuchan commented Feb 5, 2021

I too, am experiencing this difficulty. I use pipx in my CI to manage things like poetry, so it really sucks that it broke. I got unstuck by running pipx run --spec=poetry==1.0.0 poetry help.

@jvlar
Copy link

jvlar commented Feb 5, 2021

you can lock poetry-core version as you install poetry 1.1.4 pip install poetry-core==1.0.0 poetry==1.1.4

@arthurhenrique
Copy link

arthurhenrique commented Feb 5, 2021

It would be good if poetry had some integration tests ... To avoid these errors.

@eburdon
Copy link

eburdon commented Feb 5, 2021

Running poetry add "poetry-core=1.0.0" did not resolve for me; Github actions still installed poetry-core-1.0.1.

Edit: this was actually due to a bad ci.yml file; using workaround and pinning with pip install poetry-core==1.0.0 poetry==1.1.4 appears to have worked.

@wisprp
Copy link

wisprp commented Feb 5, 2021

So many Friday releases in danger because of it.

frankier added a commit to mood-mapping-muppets/repo that referenced this issue Feb 5, 2021
@karthikns16
Copy link

Yes Friday its, please fix this ASAP

@emyller
Copy link

emyller commented Feb 5, 2021

Installing poetry works for me, but poetry config virtualenvs.create false breaks the hell our of my Docker build with the same error above.

werwty added a commit to cloudigrade/cloudigrade that referenced this issue Feb 5, 2021
Let's pin it to 1.0.0 for now, and revert this commit once it is fixed.

See also: python-poetry/poetry#3650
@arlopezg
Copy link

arlopezg commented Feb 5, 2021 via email

@elliottmoos
Copy link

Installing doesn't break for me, but poetry config repositories.<repo> <url> breaks with this error.

@gitpushdashf
Copy link

Installing is fine, but any poetry command is broken.

Workaround for install: pip3 install poetry-core==1.0.0 poetry==1.1.4

Workaround for Poetry projects in pyproject.toml's build-system section:

Replace requires = ["poetry-core>=1.0.0"] with requires = ["poetry-core==1.0.0"].

@alexifm
Copy link

alexifm commented Feb 5, 2021

On pipx, do this to pin the version

pipx install --pip-args "poetry-core==1.0.0" "poetry" 

@vgautam-dialpad
Copy link

Basically poetry used to incorrectly import Dependency from poetry.core.packages.package instead of poetry.core.packages.dependency and it worked earlier because poetry.core.packages.package imported Dependency from .dependency.
Between poetry-core v1.0.0 and v1.0.1, someone removed that import, and this broke poetry. The latest version of the poetry source code has corrected this import, but there's no release for it yet: https://github.com/python-poetry/poetry/blob/master/poetry/packages/locker.py#L30 Doing that could potentially fix some problems

returnString added a commit to reservoirdb/reservoirdb-python that referenced this issue Feb 5, 2021
@jsoref
Copy link
Contributor

jsoref commented Feb 5, 2021

Semantic versioning afaiu says that you can't do this in a patch version. In fact, I don't even think this is valid in a minor. 1.0.0 is a promise.

I'm sorry that poetry 1.0.0 had a wart, but people are supposed to live with their warts and properly honor semantic versioning if they choose to use it.

Ideally that means releasing a 1.0.2 which patches poetry-core to behave just like 1.0.0. It isn't really enough to just fix poetry itself.

I hope everyone has a good weekend. (I need to fix one more spot where we hit this.)

werwty added a commit to cloudigrade/cloudigrade that referenced this issue Feb 5, 2021
* poetry-core 1.0.1 is currently broken

Let's pin it to 1.0.0 for now, and revert this commit once it is fixed.

See also: python-poetry/poetry#3650

* Update dockerfile too
@vgautam-dialpad
Copy link

yup, I'm with you on that. Sounds like this is going to be a bunch of work for them.
Idk if removing and un-releasing the poetry-core package is an option - also not ideal but really, none of this is.

@gitpushdashf
Copy link

I would checkout 1.0.0, tag 1.0.2, and push.

Then 1.0.3 can be a patched 1.0.1. It's ugly but might be the fastest fix (overall).

Maybe poetry new should be doing == instead of >= for the poetry-core dependency.

rarkins added a commit to renovatebot/renovate that referenced this issue Feb 5, 2021
djjudas21 added a commit to camerahub/camerahub that referenced this issue Feb 5, 2021
bneijt added a commit to bneijt/autotrash that referenced this issue Feb 5, 2021
bneijt added a commit to bneijt/autotrash that referenced this issue Feb 5, 2021
bneijt added a commit to bneijt/autotrash that referenced this issue Feb 5, 2021
@gitpushdashf
Copy link

Still no new poetry-core version in pypi, so this is not fixed yet.

@paul-english
Copy link

Yeah, shouldn't be closed till the release exists in pypi.

@sinoroc
Copy link

sinoroc commented Feb 5, 2021

@gitpushdashf
Copy link

Fantastic! Confirmed in Docker that pip3 install poetry; poetry --help works.

Thank you @sinoroc and all!

@sinoroc
Copy link

sinoroc commented Feb 6, 2021

Fantastic! Confirmed in Docker that pip3 install poetry; poetry --help works.

Thank you @sinoroc and all!

Not me. If I am not mistaken it's @finswimmer and @sdispater that you should thank.

@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 2024

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.