poetry: Poetry update never finishes resolve and Poetry show --outdated hangs
-
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: Oracle Linux Server 7.5
-
Poetry version: 0.12.11
-
Link of a Gist with the contents of your pyproject.toml file: Part of it included.
pyproject.toml
[tool.poetry]
name = "tool"
version = "2.0.16"
description = "Tool"
authors = [
"Amal <???@...>"
]
readme = "README.rst"
include = [
]
classifiers = [
"Development Status :: 1 - Planning",
"Environment :: Console",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: Other/Proprietary License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
]
[tool.poetry.dependencies]
python = "^3.7"
bit-vector = "0.42a0"
click = "^7.0"
click_completion = "^0.5.0"
click_help_colors = "^0.5.0"
coloredlogs = "^10.0"
prompt-toolkit = "^2.0"
Pygments = "^2.3"
PyXB = "^1.2"
sly = "^0.3.0"
sty = "1.0.0b8"
tabulate = "^0.8.2"
termcolor = "^1.1"
[tool.poetry.dev-dependencies]
# Documentation
sphinx = "^1.8"
sphinx-rtd-theme = "^0.4.2"
sphinx-click = "^1.4"
# Test
pytest = "^4.0"
pytest-cov = "^2.6"
pytest-flake8 = "^1.0"
pytest-pylint = "^0.14.0"
[tool.poetry.scripts]
tool = "tool.cli:main"
[[tool.poetry.source]]
name = "thw"
url = "https://artifactory/api/pypi/pypi-mirror/simple"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Issue
When I try to see the list of outdated dependencies (poetry show --outdated), poetry hangs. And “poetry updated” gets stuck on “Resolving dependencies” and incrementing time (166.8s).
Running with --vvv:
$ poetry -vvv show --outdated
Using virtualenv: .../.venv
Pressing CTRL+C shows:
^C
[KeyboardInterrupt]
Exception trace:
.venv/lib/python3.7/site-packages/cleo/application.py in run() at line 94
status_code = self.do_run(input_, output_)
.venv/lib/python3.7/site-packages/poetry/console/application.py in do_run() at line 88
return super(Application, self).do_run(i, o)
.venv/lib/python3.7/site-packages/cleo/application.py in do_run() at line 197
status_code = command.run(input_, output_)
.venv/lib/python3.7/site-packages/poetry/console/commands/command.py in run() at line 77
return super(BaseCommand, self).run(i, o)
.venv/lib/python3.7/site-packages/cleo/commands/base_command.py in run() at line 146
status_code = self.execute(input_, output_)
.venv/lib/python3.7/site-packages/cleo/commands/command.py in execute() at line 107
return self.handle()
.venv/lib/python3.7/site-packages/poetry/console/commands/show.py in handle() at line 124
latest = self.find_latest_package(locked)
.venv/lib/python3.7/site-packages/poetry/console/commands/show.py in find_latest_package() at line 305
return selector.find_best_candidate(name, ">={}".format(package.pretty_version))
.venv/lib/python3.7/site-packages/poetry/version/version_selector.py in find_best_candidate() at line 29
package_name, constraint, allow_prereleases=allow_prereleases
.venv/lib/python3.7/site-packages/poetry/repositories/pool.py in find_packages() at line 65
name, constraint, extras=extras, allow_prereleases=allow_prereleases
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in find_packages() at line 105
info = self.get_package_info(name)
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in get_package_info() at line 238
name, lambda: self._get_package_info(name)
.venv/lib/python3.7/site-packages/cachy/repository.py in remember_forever() at line 174
val = value(callback)
.venv/lib/python3.7/site-packages/cachy/helpers.py in value() at line 6
return val()
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in <lambda>() at line 238
name, lambda: self._get_package_info(name)
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in _get_package_info() at line 242
data = self._get("pypi/{}/json".format(name))
.venv/lib/python3.7/site-packages/poetry/repositories/pypi_repository.py in _get() at line 391
json_response = self._session.get(self._url + endpoint)
.venv/lib/python3.7/site-packages/requests/sessions.py in get() at line 546
return self.request('GET', url, **kwargs)
.venv/lib/python3.7/site-packages/requests/sessions.py in request() at line 533
resp = self.send(prep, **send_kwargs)
.venv/lib/python3.7/site-packages/requests/sessions.py in send() at line 646
r = adapter.send(request, **kwargs)
.venv/lib/python3.7/site-packages/cachecontrol/adapter.py in send() at line 53
resp = super(CacheControlAdapter, self).send(request, **kw)
.venv/lib/python3.7/site-packages/requests/adapters.py in send() at line 533
return self.build_response(request, resp)
.venv/lib/python3.7/site-packages/cachecontrol/adapter.py in build_response() at line 80
request, response
.venv/lib/python3.7/site-packages/cachecontrol/controller.py in update_cached_response() at line 365
self.cache.set(cache_url, self.serializer.dumps(request, cached_response))
.venv/lib/python3.7/site-packages/cachecontrol/caches/file_cache.py in set() at line 126
with self.lock_class(name) as lock:
.venv/lib/python3.7/site-packages/lockfile/__init__.py in __enter__() at line 197
self.acquire()
.venv/lib/python3.7/site-packages/lockfile/linklockfile.py in acquire() at line 50
time.sleep(timeout is not None and timeout / 10 or 0.1)
Update with verbose shows:
$ poetry -vvv update
Using virtualenv: .venv
Updating dependencies
Resolving dependencies...
1: fact: tool is 2.0.16
1: derived: tool
1: fact: tool depends on bit-vector (0.42a0)
1: fact: tool depends on click (^7.0)
1: fact: tool depends on click_completion (^0.5.0)
1: fact: tool depends on click_help_colors (^0.5.0)
1: fact: tool depends on coloredlogs (^10.0)
1: fact: tool depends on prompt-toolkit (^2.0)
1: fact: tool depends on Pygments (^2.3)
1: fact: tool depends on PyXB (^1.2)
1: fact: tool depends on sly (^0.3.0)
1: fact: tool depends on sty (1.0.0b8)
1: fact: tool depends on tabulate (^0.8.2)
1: fact: tool depends on termcolor (^1.1)
1: fact: tool depends on sphinx (^1.8)
1: fact: tool depends on sphinx-rtd-theme (^0.4.2)
1: fact: tool depends on sphinx-click (^1.4)
1: fact: tool depends on pytest (^4.0)
1: fact: tool depends on pytest-cov (^2.6)
1: fact: tool depends on pytest-flake8 (^1.0)
1: fact: tool depends on pytest-pylint (^0.14.0)
1: selecting tool (2.0.16)
1: derived: pytest-pylint (^0.14.0)
1: derived: pytest-flake8 (^1.0)
1: derived: pytest-cov (^2.6)
1: derived: pytest (^4.0)
1: derived: sphinx-click (^1.4)
1: derived: sphinx-rtd-theme (^0.4.2)
1: derived: sphinx (^1.8)
1: derived: termcolor (^1.1)
1: derived: tabulate (^0.8.2)
1: derived: sty (1.0.0b8)
1: derived: sly (^0.3.0)
1: derived: PyXB (^1.2)
1: derived: Pygments (^2.3)
1: derived: prompt-toolkit (^2.0)
1: derived: coloredlogs (^10.0)
1: derived: click_help_colors (^0.5.0)
1: derived: click_completion (^0.5.0)
1: derived: click (^7.0)
1: derived: bit-vector (0.42a0)
PyPI: 1 packages found for pytest-pylint >=0.14.0,<0.15.0
1: fact: pytest-pylint (0.14.0) depends on pytest (>=2.7)
1: fact: pytest-pylint (0.14.0) depends on pylint (>=1.4.5)
1: fact: pytest-pylint (0.14.0) depends on six (*)
1: selecting pytest-pylint (0.14.0)
1: derived: six (*)
1: derived: pylint (>=1.4.5)
PyPI: 4 packages found for pytest-flake8 >=1.0,<2.0
1: fact: pytest-flake8 (1.0.3) depends on flake8 (>=3.5)
1: fact: pytest-flake8 (1.0.3) depends on pytest (>=3.5)
1: selecting pytest-flake8 (1.0.3)
1: derived: flake8 (>=3.5)
PyPI: 2 packages found for pytest-cov >=2.6,<3.0
1: fact: pytest-cov (2.6.1) depends on pytest (>=3.6)
1: fact: pytest-cov (2.6.1) depends on coverage (>=4.4)
1: selecting pytest-cov (2.6.1)
1: derived: coverage (>=4.4)
PyPI: 5 packages found for pytest >=4.0,<5.0
1: fact: pytest (4.1.1) depends on py (>=1.5.0)
1: fact: pytest (4.1.1) depends on six (>=1.10.0)
1: fact: pytest (4.1.1) depends on attrs (>=17.4.0)
1: fact: pytest (4.1.1) depends on more-itertools (>=4.0.0)
1: fact: pytest (4.1.1) depends on atomicwrites (>=1.0)
1: fact: pytest (4.1.1) depends on pluggy (>=0.7)
1: fact: pytest (4.1.1) depends on colorama (*)
1: selecting pytest (4.1.1)
1: derived: colorama (*)
1: derived: pluggy (>=0.7)
1: derived: atomicwrites (>=1.0)
1: derived: more-itertools (>=4.0.0)
1: derived: attrs (>=17.4.0)
1: derived: six (>=1.10.0)
1: derived: py (>=1.5.0)
PyPI: 2 packages found for sphinx-click >=1.4,<2.0
1: fact: sphinx-click (1.4.1) depends on pbr (>=2.0)
1: fact: sphinx-click (1.4.1) depends on sphinx (>=1.5,<2.0)
1: selecting sphinx-click (1.4.1)
1: derived: pbr (>=2.0)
PyPI: No release information found for sphinx-rtd-theme-0.1.0, skipping
PyPI: 1 packages found for sphinx-rtd-theme >=0.4.2,<0.5.0
1: fact: sphinx-rtd-theme (0.4.2) depends on sphinx (*)
1: selecting sphinx-rtd-theme (0.4.2)
PyPI: 4 packages found for sphinx >=1.8,<2.0
1: fact: sphinx (1.8.3) depends on six (>=1.5)
1: fact: sphinx (1.8.3) depends on Jinja2 (>=2.3)
1: fact: sphinx (1.8.3) depends on Pygments (>=2.0)
1: fact: sphinx (1.8.3) depends on docutils (>=0.11)
1: fact: sphinx (1.8.3) depends on snowballstemmer (>=1.1)
1: fact: sphinx (1.8.3) depends on babel (>=1.3,<2.0 || >2.0)
1: fact: sphinx (1.8.3) depends on alabaster (>=0.7,<0.8)
1: fact: sphinx (1.8.3) depends on imagesize (*)
1: fact: sphinx (1.8.3) depends on requests (>=2.0.0)
1: fact: sphinx (1.8.3) depends on packaging (*)
1: fact: sphinx (1.8.3) depends on sphinxcontrib-websupport (*)
1: fact: sphinx (1.8.3) depends on colorama (>=0.3.5)
1: selecting sphinx (1.8.3)
1: derived: colorama (>=0.3.5)
1: derived: sphinxcontrib-websupport (*)
1: derived: packaging (*)
1: derived: requests (>=2.0.0)
1: derived: imagesize (*)
1: derived: alabaster (>=0.7,<0.8)
1: derived: babel (>=1.3,<2.0 || >2.0)
1: derived: snowballstemmer (>=1.1)
1: derived: docutils (>=0.11)
1: derived: Jinja2 (>=2.3)
PyPI: 1 packages found for termcolor >=1.1,<2.0
1: selecting termcolor (1.1.0)
PyPI: 1 packages found for tabulate >=0.8.2,<0.9.0
1: selecting tabulate (0.8.2)
PyPI: 1 packages found for sty 1.0.0b8
1: selecting sty (1.0.0b8)
PyPI: 1 packages found for sly >=0.3.0,<0.4.0
1: selecting sly (0.3)
PyPI: 6 packages found for pyxb >=1.2,<2.0
1: selecting pyxb (1.2.6)
PyPI: 2 packages found for pygments >=2.3,<3.0
1: selecting pygments (2.3.1)
PyPI: 7 packages found for prompt-toolkit >=2.0,<3.0
1: fact: prompt-toolkit (2.0.7) depends on six (>=1.9.0)
1: fact: prompt-toolkit (2.0.7) depends on wcwidth (*)
1: selecting prompt-toolkit (2.0.7)
1: derived: wcwidth (*)
PyPI: 1 packages found for coloredlogs >=10.0,<11.0
1: fact: coloredlogs (10.0) depends on humanfriendly (>=4.7)
1: fact: coloredlogs (10.0) depends on colorama (*)
1: selecting coloredlogs (10.0)
1: derived: humanfriendly (>=4.7)
PyPI: 1 packages found for click-help-colors >=0.5.0,<0.6.0
1: fact: click-help-colors (0.5) depends on click (>=7.0)
1: selecting click-help-colors (0.5)
PyPI: 1 packages found for click-completion >=0.5.0,<0.6.0
1: fact: click-completion (0.5.0) depends on click (*)
1: fact: click-completion (0.5.0) depends on jinja2 (*)
1: fact: click-completion (0.5.0) depends on six (*)
1: fact: click-completion (0.5.0) depends on shellingham (*)
1: selecting click-completion (0.5.0)
1: derived: shellingham (*)
PyPI: 1 packages found for click >=7.0,<8.0
1: selecting click (7.0)
PyPI: 1 packages found for bit-vector 0.42a0
1: fact: bit-vector (0.42a0) depends on numpy (*)
1: selecting bit-vector (0.42a0)
1: derived: numpy (*)
PyPI: 3 packages found for six >=1.10.0
1: selecting six (1.12.0)
PyPI: No release information found for pylint-0.10.0, skipping
PyPI: No release information found for pylint-0.11.0, skipping
PyPI: No release information found for pylint-0.12.1, skipping
PyPI: No release information found for pylint-0.13.0, skipping
PyPI: No release information found for pylint-0.14.0, skipping
PyPI: No release information found for pylint-0.4.1, skipping
PyPI: No release information found for pylint-0.6.0, skipping
PyPI: No release information found for pylint-0.6.1, skipping
PyPI: No release information found for pylint-0.7.0, skipping
PyPI: No release information found for pylint-0.8.1, skipping
PyPI: 38 packages found for pylint >=1.4.5
1: fact: pylint (2.2.2) depends on astroid (>=2.0.0)
1: fact: pylint (2.2.2) depends on isort (>=4.2.5)
1: fact: pylint (2.2.2) depends on mccabe (*)
1: fact: pylint (2.2.2) depends on colorama (*)
1: selecting pylint (2.2.2)
1: derived: mccabe (*)
1: derived: isort (>=4.2.5)
1: derived: astroid (>=2.0.0)
PyPI: 2 packages found for flake8 >=3.5
1: fact: flake8 (3.6.0) depends on pyflakes (>=2.0.0,<2.1.0)
1: fact: flake8 (3.6.0) depends on pycodestyle (>=2.4.0,<2.5.0)
1: fact: flake8 (3.6.0) depends on mccabe (>=0.6.0,<0.7.0)
1: selecting flake8 (3.6.0)
1: derived: mccabe (>=0.6.0,<0.7.0)
1: derived: pycodestyle (>=2.4.0,<2.5.0)
1: derived: pyflakes (>=2.0.0,<2.1.0)
PyPI: No release information found for coverage-2.5, skipping
PyPI: No release information found for coverage-2.6, skipping
PyPI: No release information found for coverage-2.75, skipping
PyPI: No release information found for coverage-2.76, skipping
PyPI: No release information found for coverage-2.77, skipping
PyPI: No release information found for coverage-2.78, skipping
PyPI: No release information found for coverage-2.8, skipping
PyPI: No release information found for coverage-2.80, skipping
PyPI: No release information found for coverage-2.85, skipping
PyPI: 6 packages found for coverage >=4.4
1: selecting coverage (4.5.2)
PyPI: 7 packages found for colorama >=0.3.5
1: selecting colorama (0.4.1)
PyPI: 3 packages found for pluggy >=0.7
1: selecting pluggy (0.8.1)
PyPI: 5 packages found for atomicwrites >=1.0
1: selecting atomicwrites (1.2.1)
PyPI: 6 packages found for more-itertools >=4.0.0
1: fact: more-itertools (5.0.0) depends on six (>=1.0.0,<2.0.0)
1: selecting more-itertools (5.0.0)
PyPI: 3 packages found for attrs >=17.4.0
1: selecting attrs (18.2.0)
PyPI: No release information found for py-0.8.0-alpha2, skipping
PyPI: No release information found for py-0.9.0, skipping
PyPI: No release information found for py-1.4.32.dev1, skipping
PyPI: 6 packages found for py >=1.5.0
1: selecting py (1.7.0)
PyPI: 18 packages found for pbr >=2.0
1: selecting pbr (5.1.1)
PyPI: 3 packages found for sphinxcontrib-websupport *
1: selecting sphinxcontrib-websupport (1.1.0)
PyPI: 23 packages found for packaging *
1: fact: packaging (19.0) depends on pyparsing (>=2.0.2)
1: fact: packaging (19.0) depends on six (*)
1: selecting packaging (19.0)
1: derived: pyparsing (>=2.0.2)
PyPI: No release information found for requests-0.0.1, skipping
PyPI: No release information found for requests-0.12.01, skipping
PyPI: No release information found for requests-2.15.0, skipping
PyPI: 57 packages found for requests >=2.0.0
1: fact: requests (2.21.0) depends on chardet (>=3.0.2,<3.1.0)
1: fact: requests (2.21.0) depends on idna (>=2.5,<2.9)
1: fact: requests (2.21.0) depends on urllib3 (>=1.21.1,<1.25)
1: fact: requests (2.21.0) depends on certifi (>=2017.4.17)
1: selecting requests (2.21.0)
1: derived: certifi (>=2017.4.17)
1: derived: urllib3 (>=1.21.1,<1.25)
1: derived: idna (>=2.5,<2.9)
1: derived: chardet (>=3.0.2,<3.1.0)
PyPI: 6 packages found for imagesize *
1: selecting imagesize (1.1.0)
PyPI: No release information found for alabaster-0.0.1, skipping
PyPI: 12 packages found for alabaster >=0.7,<0.8
1: selecting alabaster (0.7.12)
PyPI: No release information found for babel-0.8, skipping
PyPI: No release information found for babel-0.8.1, skipping
PyPI: No release information found for babel-0.9, skipping
PyPI: No release information found for babel-0.9.1, skipping
PyPI: No release information found for babel-0.9.2, skipping
PyPI: No release information found for babel-0.9.3, skipping
PyPI: No release information found for babel-0.9.4, skipping
PyPI: No release information found for babel-0.9.5, skipping
PyPI: 14 packages found for babel >=1.3,<2.0 || >2.0
1: fact: babel (2.6.0) depends on pytz (>=0a)
1: selecting babel (2.6.0)
1: derived: pytz (>=0a)
PyPI: 3 packages found for snowballstemmer >=1.1
1: selecting snowballstemmer (1.2.1)
PyPI: 4 packages found for docutils >=0.11
1: selecting docutils (0.14)
PyPI: 25 packages found for jinja2 >=2.3
1: fact: jinja2 (2.10) depends on MarkupSafe (>=0.23)
1: selecting jinja2 (2.10)
1: derived: MarkupSafe (>=0.23)
PyPI: 9 packages found for wcwidth *
1: selecting wcwidth (0.1.7)
PyPI: 14 packages found for humanfriendly >=4.7
1: fact: humanfriendly (4.17) depends on pyreadline (*)
1: selecting humanfriendly (4.17)
1: derived: pyreadline (*)
PyPI: 11 packages found for shellingham *
1: selecting shellingham (1.2.8)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 22 (1 by maintainers)
I ran into a similar issue today with poetry version 1.1.4. I was able to “solve” it by doing:
poetry cache clear --all .
rm poetry.lock
poetry install -vvv
(for some reason, I ran it without the-vvv
flag before and it kept hanging, at least with-vvv
I see what’s happening) 🤷🏻I hit the same and I can confirm that running:
poetry cache:clear --all .
solves the problemJust FYI: I had a similar issue like the one above, with py-spy showing the following things:
Running
poetry cache clear --all .
after removing the lock file solved it for me (removing the lock file itself didn’t change a thing, but no idea if the cache clearing alone would have solved it.).I just had this today and it looks like mine was stuck looping on the following:
I had literally hundreds of the above lines printing out before I finally killed it, not sure why that is causing it to get stuck
I’ve had Poetry take over 800 seconds before giving up [it was bascially never finishing]. I tried poetry 1.0.0, 1.0.5, 1.1.0a1 and had the same results. I also cleared the cache on each poetry version I tried, with the same problem still happening.
Here is the log:
Poetry never finishing update.txt
I’ve attached a
poetry update -vvv log
@cgungor that showcases the issue. Reading the log, it looks like it keeps trying older and older versions of botocore due todocutils = "<0.16"
requirement in botocore. Earlier in the process it decided to use docutils 0.16 due tosphinx (2.4.4) depends on docutils (>=0.12)
. I don’t know why it did not figure out thatdocutils(>=0.10,<0.16)
is fine withdocutils (=0.15.2)
.So I tried adding this to my .toml file:
docutils = "<0.16"
. I reran the update and it finished in a about 4.5 seconds. Here is the output of that run:Pinned Dep, poetry finishing update.txt
So for now I’ll have to keep docutils pinned <0.16 my self, but it would have been really nice for poetry to figure it out on it’s own!
I think it may have something to do with Poetry’s use of
cachecontrol
(notice the mentions ofcachecontrol
andlockfile
towards end of logs).If you dig through Poetry’s source you’ll see there is a class
PyPiRepository
, with an__init__
parameterdisable_cache=False
by default. It seems like there is not currently a way to disable it through Poetry, and there doesn’t appear to be (relevant) global config overrides forcachecontrol
orlockfile
…What you can do in the meantime is to delete the Poetry cache dir and try running again. At first I thought I was still having the issue, but after a bit it moved on. So it really was a filelock deadlock at first for me, and for some reason always getting back into the state upon trying again… but 🤷♂️ I guess it is something intermittent.
How to find your cache - well, check the Poetry configuration docs to see about the OS-specific defaults. And you can delete it by hand that way.
There is also
poetry cache:clear
(version >1 it becomespoetry cache clear
syntax). Its CLI docs are not very clear yet but I believe the usage ispoetry cache clear $POETRY_VERSION --all
@m-vdb
I confirm that this works on Poetry version 1.1.13