python-poetry / python-poetry/poetry

`poetry install` is resulting in Deadlock exceptions with sdists on readthedocs

Open
#10,827 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug status/external-issue status/waiting-on-response
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

Description

Hi all,

I am having trouble with intermittent but consistent deadlock errors while running poetry install on the readthedocs runners. I have a few packages that are built from sdists including pygobject, pycairo, and pygobject-stubs. This was originally resulting in BadZip errors (even though the sdists are in a tarball.

For troubleshooting I turned on verbose mode with poetry install -vv, which shows a deadlock stack trace around which looks like it is caused by virtualenv loading all activation plugins eagerly via entry points, and something about doing that inside Poetry's isolated_builder context is causing a reentrant import deadlock on virtualenv.activation.powershell. Since this error happens intermittently (but frequently), I expect there is a race condition between the threads.

I tried changing Python versions and setting poetry config installer.no-binary pycairo,pygobject which didn't change things. However, I haven't been able to reproduce this locally, so getting a smaller reproducible example has been difficult. Since this error started happening over the last few months, I could also try to isolate the error to a specific Poetry version.

An example build is here: https://app.readthedocs.org/projects/gaphor-es/builds/32132330/

My readthedocs config:

version: 2
formats:
- htmlzip
- epub
build:
  os: ubuntu-24.04
  tools:
    python: "3.14"
  apt_packages:
  - libgirepository-2.0-dev
  - libcairo2-dev
  - pkg-config
  - python3-dev
  - gir1.2-pango-1.0
  - graphviz
  jobs:
    pre_install:
    - python3 -m pip install --upgrade pip
    - python3 -m pip install --constraint=.github/github-requirements.txt poetry
    - poetry config virtualenvs.create false
    post_install:
    - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install -vv --with docs --no-interaction
sphinx:
  configuration: docs/conf.py
  fail_on_warning: true
Workarounds

Rerunning the workflow often fixes the issue.

Poetry Installation Method

pip

Operating System

Ubuntu 24.04

Poetry Version

Poetry (version 2.3.3)

Poetry Configuration
[rtd-command-info] start-time: 2026-04-06T12:18:52.178680Z, end-time: 2026-04-06T12:18:52.816827Z, duration: 0, exit-code: 0
poetry config --list
cache-dir = "/home/docs/.cache/pypoetry"
data-dir = "/home/docs/.local/share/pypoetry"
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = false
keyring.enabled = true
python.installation-dir = "{data-dir}/python"  # /home/docs/.local/share/pypoetry/python
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = false
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/docs/.cache/pypoetry/virtualenvs
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false
Python Sysconfig
sysconfig.log

python_sysconfig.txt

Example pyproject.toml
[project]
name = "gaphor"
version = "3.2.0"
description = "Gaphor is the simple modeling tool written in Python."
authors = [
    { name = "Arjan Molenaar", email = "gaphor@gmail.com" },
    { name = "Dan Yeaw", email = "dan@yeaw.me" },
]

readme = "README.md"

keywords = ["GTK", "diagram", "UML", "MBSE", "modeling"]

classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Environment :: X11 Applications :: GTK",
    "Environment :: MacOS X",
    "Environment :: Win32 (MS Windows)",
    "Intended Audience :: Developers",
    "Intended Audience :: End Users/Desktop",
    "Intended Audience :: Information Technology",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: MacOS :: MacOS X",
    "Operating System :: Microsoft :: Windows",
    "Operating System :: POSIX",
    "Operating System :: Unix",
    "Programming Language :: Python",
    "Topic :: Desktop Environment :: Gnome",
    "Topic :: Multimedia :: Graphics :: Editors :: Vector-Based",
    "Topic :: Software Development :: Documentation",
]

requires-python = ">=3.12,<3.15"

dependencies = [
    "pycairo>=1.22.0",
    "PyGObject>=3.52",
    "gaphas>=5.1",
    "generic>=1.0.0",
    "tinycss2>=1.0.2",
    "babel>=2.10.3",
    "jedi (>=0.18.1,<0.20.0)",
    "better-exceptions>=0.3.3",
    "pydot>=1.4.2",
    "pillow>=10.0.0",
    "defusedxml>=0.7.1",
    "pyobjc-framework-cocoa (>=9.0.1) ; sys_platform == 'darwin'",
    "dulwich>=0.25.0",
]

[project.scripts]
gaphor = "gaphor.main:main"

[project.urls]
homepage = "https://gaphor.org/"
repository = "https://github.com/gaphor/gaphor"
documentation = "https://docs.gaphor.org/"

[project.entry-points."gaphor.appservices"]
"event_manager" = "gaphor.core.eventmanager:EventManager"
"module_loader" = "gaphor.services.moduleloader:ModuleLoader"
"app_file_manager" = "gaphor.ui.appfilemanager:AppFileManager"
"styling" = "gaphor.ui.styling:Styling"
"greeter" = "gaphor.ui.greeter:Greeter"
"help" = "gaphor.ui.help:HelpService"
"self_test" = "gaphor.ui.selftest:SelfTest"

[project.entry-points."gaphor.modules"]
"general_ui_components" = "gaphor.diagram.general.uicomponents"
"style_editor" = "gaphor.diagram.styleeditor"
"uml_ui_components" = "gaphor.UML.uicomponents"
"sysml_property_pages" = "gaphor.SysML.uicomponents"
"c4model_property_pages" = "gaphor.C4Model.propertypages"

[project.entry-points."gaphor.services"]
"component_registry" = "gaphor.services.componentregistry:ComponentRegistry"
"event_manager" = "gaphor.core.eventmanager:EventManager"
"properties" = "gaphor.services.properties:Properties"
"undo_manager" = "gaphor.services.undomanager:UndoManager"
"element_factory" = "gaphor.core.modeling:ElementFactory"
"element_dispatcher" = "gaphor.core.modeling.elementdispatcher:ElementDispatcher"
"modeling_language" = "gaphor.services.modelinglanguage:ModelingLanguageService"
"file_manager" = "gaphor.ui.filemanager:FileManager"
"recent_files" = "gaphor.ui.recentfiles:RecentFiles"
"main_window" = "gaphor.ui.mainwindow:MainWindow"
"export_menu" = "gaphor.ui.menufragment:MenuFragment"
"tools_menu" = "gaphor.ui.menufragment:MenuFragment"
"undo_actions" = "gaphor.ui.undoactions:UndoActions"
"sanitizer" = "gaphor.UML.sanitizerservice:SanitizerService"
"recovery" = "gaphor.storage.recovery:Recovery"
"model_browser" = "gaphor.ui.modelbrowser:ModelBrowser"
"toolbox" = "gaphor.ui.toolbox:Toolbox"
"diagrams" = "gaphor.ui.diagrams:Diagrams"
"diagram_align" = "gaphor.ui.diagramalign:DiagramAlign"
"element_editor" = "gaphor.ui.elementeditor:ElementEditor"
"model_changed" = "gaphor.ui.modelchanged:ModelChanged"
"console_window" = "gaphor.plugins.console.consolewindow:ConsoleWindow"
"diagram_export" = "gaphor.plugins.diagramexport.export:DiagramExport"
"auto_layout" = "gaphor.plugins.autolayout:AutoLayoutService"
"html_report" = "gaphor.plugins.htmlreport.report:HtmlReportExport"

[project.entry-points."gaphor.modelinglanguages"]
"Core" = "gaphor.core.modeling.modelinglanguage:CoreModelingLanguage"
"UML" = "gaphor.UML.modelinglanguage:UMLModelingLanguage"
"SysML" = "gaphor.SysML.modelinglanguage:SysMLModelingLanguage"
"C4Model" = "gaphor.C4Model.modelinglanguage:C4ModelLanguage"
"RAAML" = "gaphor.RAAML.modelinglanguage:RAAMLModelingLanguage"
"general" = "gaphor.diagram.general.modelinglanguage:GeneralModelingLanguage"

[project.entry-points."gaphor.argparsers"]
gui = "gaphor.main:gui_parser"
self-test = "gaphor.main:self_test_parser"
exec = "gaphor.main:exec_parser"
export = "gaphor.plugins.diagramexport.exportcli:export_parser"
html-report = "gaphor.plugins.htmlreport.reportcli:html_report_parser"
install-schemas = "gaphor.ui.installschemas:install_schemas_parser"

[project.entry-points."babel.extractors"]
"gaphor" = "gaphor.babel:extract_gaphor"

[tool.poetry]
requires-poetry = ">=2.0"
include = [
    { path = "gaphor/locale/*/LC_MESSAGES/*" },
    { path = "data/org.gaphor.Gaphor*", format = "sdist" },
]
exclude = ["**/tests", "gaphor/conftest.py" ]

# When building these from source, use setuptools<82 (pkg_resources removed in 82)
[tool.poetry.build-constraints]
pyobjc-framework-cocoa = { setuptools = "<82" }
pyobjc-core = { setuptools = "<82" }

[tool.poetry.group.dev.dependencies]
pytest = ">=7.1,<9.1"
pytest-archon = "^0.0"
pytest-cov = ">=4,<8"
pytest-randomly = "^4.0.1"
xdoctest = "^1.3.0"
hypothesis = "^6.151.2"
ipython = "^9.9.0"
sphinx = ">=6,<10"
babelgladeextractor = "^0.7"
pytest-asyncio = "^1.2.0"
markdown-it-py = ">=3.0,<5.0"
pygobject-stubs = "^2.16.0"

[tool.poetry.group.lint.dependencies]
pre-commit = ">=2.20,<5.0"

[tool.poetry.group.automation.dependencies]
poethepoet = "^0.43.0"

[tool.poetry.group.docs]
optional=true

[tool.poetry.group.docs.dependencies]
sphinx = ">=6,<10"
sphinx-copybutton = "^0.5.0"
sphinx-intl = "^2.3.2"
myst-nb = "^1.4.0"
furo = ">=2022,<2026"

[tool.poetry.group.packaging]
optional=true

[tool.poetry.group.packaging.dependencies]
pyinstaller = ">=6.13.0"
pyinstaller-versionfile = "^3.0.1"
semver = ">=2.13,<4.0"
dmgbuild = {version = "^1.6.7", markers = "sys_platform == 'darwin'" }

[tool.poe.tasks]
coremodel.script = """gaphor.codegen.coder:main(
    modelfile='models/Core.gaphor',
    overridesfile='models/Core.override',
    outfile='gaphor/core/modeling/coremodel.py'
    )"""
uml.script = """gaphor.codegen.coder:main(
    modelfile='models/UML.gaphor',
    overridesfile='models/UML.override',
    outfile='gaphor/UML/uml.py',
    supermodelfiles=[('Core', 'models/Core.gaphor')]
    )"""
sysml.script = """gaphor.codegen.coder:main(
    modelfile='models/SysML.gaphor',
    overridesfile='models/SysML.override',
    outfile='gaphor/SysML/sysml.py',
    supermodelfiles=[
        ('UML', 'models/UML.gaphor'),
        ('Core', 'models/Core.gaphor')]
    )"""
raaml.script = """gaphor.codegen.coder:main(
    modelfile='models/RAAML.gaphor',
    outfile='gaphor/RAAML/raaml.py',
    supermodelfiles=[
        ('SysML', 'models/SysML.gaphor'),
        ('UML', 'models/UML.gaphor'),
        ('Core', 'models/Core.gaphor')]
    )"""
c4model.script = """gaphor.codegen.coder:main(
    modelfile='models/C4Model.gaphor',
    outfile='gaphor/C4Model/c4model.py',
    supermodelfiles=[
        ('UML', 'models/UML.gaphor'),
        ('Core', 'models/Core.gaphor')]
    )"""
lint = "pre-commit run --all-files"
docs = { "cwd" = "docs", "shell" = "sphinx-build -W -b html . _build/html" }
docs-gettext-pot = { "cwd" = "docs", "shell" = "sphinx-build -b gettext . locale" }
clean = { "shell" = "rm -rf dist build docs/_build" }
appdata = { "script" = "scripts.update_appdata" }
package = { shell = "pyinstaller -y _packaging/gaphor.spec" }
win-installer = { "script" = "scripts.build_win_installer:main" }
gettext-pot = { "shell" = "pybabel extract -o po/gaphor.pot -F po/babel.ini -k i18nize gaphor" }
gettext-po = { "script" = "scripts.build_babel:update_po_files" }
gettext-mo-all = { "script" = "scripts.build_babel:compile_mo_all" }
gettext-mo-release = { "script" = "scripts.build_babel:compile_mo_release" }
gettext-docs-pot = { "cwd" = "docs", "shell" = "sphinx-build -b gettext . locale" }
gettext-docs-po = { "cwd" = "docs", "shell" = "sphinx-intl update -p locale" }
translations = [ "gettext-pot", "gettext-po", "gettext-mo-all", "gettext-docs-pot", "gettext-docs-po" ]
icons = { "shell" = "make -C gaphor/ui/icons" }

[tool.pytest.ini_options]
testpaths = [
    "gaphor",
    "tests",
    "docs",
]
python_files = "test_*.py"
addopts = [
    "--xdoctest",
    "--import-mode=importlib",
]
junit_family = "xunit1"

[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
check_untyped_defs = true
strict_optional = true
disallow_any_explicit = true
show_error_codes = true
warn_unused_ignores = true
namespace_packages = true

[[tool.mypy.overrides]]
module = [
    "gaphor.core.modeling.coremodel",
    "gaphor.UML.uml",
    "gaphor.SysML.sysml",
]
warn_unused_ignores = false
ignore_errors = true

[[tool.mypy.overrides]]
module = "*.tests.*"
ignore_errors = true

[tool.ruff]
line-length = 88
target-version = "py312"

[tool.ruff.lint]
exclude = [
    ".venv",
    "dist",
    "gaphor/core/modeling/coremodel.py",
    "gaphor/C4Model/c4model.py",
    "gaphor/RAAML/raaml.py",
    "gaphor/SysML/sysml.py",
    "gaphor/UML/uml.py",
]
ignore = ["E501"]
select = [
    "B",
    "B9",
    "C",
    "E",
    "F",
    "PLW1",
    "SLF",
    "T20",
    "UP",
    "W",
]
extend-select = ["I"]

[tool.ruff.lint.mccabe]
max-complexity = 18

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
Poetry Runtime Logs
poetry-runtime.log
rtd-command-info] start-time: 2026-04-06T11:22:54.881072Z, end-time: 2026-04-06T11:23:21.660948Z, duration: 26, exit-code: 1
VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install -vv --with docs --no-interaction
Using virtualenv: /home/docs/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240
Checking keyring availability: Unavailable
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 84 installs, 0 updates, 0 removals, 29 skipped

- Installing accessible-pygments (0.0.5)
- Installing alabaster (1.0.0): Skipped for the following reason: Already installed
- Installing attrs (26.1.0)
- Installing asttokens (3.0.1)
- Installing babel (2.18.0): Skipped for the following reason: Already installed
- Installing babelgladeextractor (0.7.2)
- Installing better-exceptions (0.3.3)
- Installing beautifulsoup4 (4.14.3)
- Installing certifi (2026.2.25): Skipped for the following reason: Already installed
- Installing cfgv (3.5.0)
- Installing charset-normalizer (3.4.7): Skipped for the following reason: Already installed
- Installing click (8.3.2)
- Installing comm (0.2.3)
- Installing coverage (7.13.5)
- Installing debugpy (1.8.20)
- Installing decorator (5.2.1)
- Installing defusedxml (0.7.1)
- Installing distlib (0.4.0): Skipped for the following reason: Already installed
- Installing docutils (0.22.4): Skipped for the following reason: Already installed
- Installing dulwich (1.1.0): Skipped for the following reason: Already installed
- Installing executing (2.2.1)
- Installing fastjsonschema (2.21.2): Skipped for the following reason: Already installed
- Installing filelock (3.25.2): Skipped for the following reason: Already installed
- Installing furo (2025.12.19)
- Installing gaphas (5.1.2)
- Installing generic (1.1.7)
- Installing greenlet (3.3.2)
- Installing hypothesis (6.151.11)
- Installing identify (2.6.18)
- Installing idna (3.11): Skipped for the following reason: Already installed
- Installing imagesize (2.0.0): Skipped for the following reason: Already installed
- Installing importlib-metadata (9.0.0)
- Installing iniconfig (2.3.0)
- Installing ipykernel (7.2.0)
- Installing ipython (9.12.0)
- Installing ipython-pygments-lexers (1.1.1)
- Installing jedi (0.19.2)
- Installing jinja2 (3.1.6): Skipped for the following reason: Already installed
- Installing jsonschema (4.26.0)
- Installing jsonschema-specifications (2025.9.1)
- Installing jupyter-cache (1.0.1)
- Installing jupyter-client (8.8.0)
- Installing jupyter-core (5.9.1)
- Installing markdown-it-py (4.0.0)
- Installing markupsafe (3.0.3): Skipped for the following reason: Already installed
- Installing matplotlib-inline (0.2.1)
- Installing mdit-py-plugins (0.5.0)
- Installing mdurl (0.1.2)
- Installing myst-nb (1.4.0)
- Installing myst-parser (5.0.0)
- Installing nbclient (0.10.4)
- Installing nbformat (5.10.4)
- Installing nest-asyncio (1.6.0)
- Installing nodeenv (1.10.0)
- Installing packaging (26.0): Skipped for the following reason: Already installed
- Installing pastel (0.2.1)
- Installing parso (0.8.6)
- Installing pexpect (4.9.0)
- Installing pillow (12.2.0)
- Installing platformdirs (4.9.4): Skipped for the following reason: Already installed
- Installing pluggy (1.6.0)
- Installing poethepoet (0.43.0)
- Installing pre-commit (4.5.1)
- Installing prompt-toolkit (3.0.52)
- Installing psutil (7.2.2)
- Installing ptyprocess (0.7.0)
- Installing pure-eval (0.2.3)
- Installing pycairo (1.29.0)
- Installing pydot (4.0.1)
- Installing pygments (2.20.0): Skipped for the following reason: Already installed
- Installing pygobject (3.56.2)
- Installing pygobject-stubs (2.17.0)
- Installing pyparsing (3.3.2)
[virtualenv:virtualenv.app_data] migrating app data from /home/docs/.local/share/virtualenv to /home/docs/.cache/virtualenv
- Installing pytest (9.0.2)
[python_discovery:python_discovery._discovery] find interpreter for spec PythonSpec(path=/home/docs/.asdf/installs/python/3.14.0/bin/python3.14)
[python_discovery:python_discovery._discovery] find interpreter for spec PythonSpec(path=/home/docs/.asdf/installs/python/3.14.0/bin/python3.14)
- Installing pytest-archon (0.0.7)
- Installing pytest-asyncio (1.3.0)
[python_discovery:python_discovery._discovery] find interpreter for spec PythonSpec(path=/home/docs/.asdf/installs/python/3.14.0/bin/python3.14)
[python_discovery:python_discovery._discovery] proposed PythonInfo(spec=CPython3.14.0.final.0-64-x86_64, exe=/home/docs/.asdf/installs/python/3.14.0/bin/python3.14, platform=linux, version='3.14.0 (main, Mar 19 2026, 17:06:41) [GCC 13.2.0]', encoding_fs_io=utf-8-utf-8)
[python_discovery:python_discovery._discovery] proposed PythonInfo(spec=CPython3.14.0.final.0-64-x86_64, exe=/home/docs/.asdf/installs/python/3.14.0/bin/python3.14, platform=linux, version='3.14.0 (main, Mar 19 2026, 17:06:41) [GCC 13.2.0]', encoding_fs_io=utf-8-utf-8)
[python_discovery:python_discovery._discovery] proposed PythonInfo(spec=CPython3.14.0.final.0-64-x86_64, exe=/home/docs/.asdf/installs/python/3.14.0/bin/python3.14, platform=linux, version='3.14.0 (main, Mar 19 2026, 17:06:41) [GCC 13.2.0]', encoding_fs_io=utf-8-utf-8)
- Installing pytest-cov (7.1.0)
- Installing pytest-randomly (4.0.1)
[virtualenv:virtualenv.seed.embed.base_embed] The --no-wheel and --wheel options are deprecated. They have no effect for Python > 3.8 as wheel is no longer bundled in virtualenv.
[virtualenv:virtualenv.seed.embed.base_embed] The --no-wheel and --wheel options are deprecated. They have no effect for Python > 3.8 as wheel is no longer bundled in virtualenv.
[virtualenv:virtualenv.run.session] create virtual environment via CPython3Posix(dest=/tmp/tmplopyrcxm/.venv, clear=False, no_vcs_ignore=False, global=False)
[virtualenv:virtualenv.run.session] create virtual environment via CPython3Posix(dest=/tmp/tmpuut7nc30/.venv, clear=False, no_vcs_ignore=False, global=False)
[virtualenv:virtualenv.run.session] add activators for Bash, CShell, Fish, Nushell, PowerShell, Python
[virtualenv:virtualenv.run.session] add activators for Bash, CShell, Fish, Nushell, PowerShell, Python

Stack trace:

36  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/installation/executor.py:297 in _execute_operation
      result = self._do_execute_operation(operation)

35  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/installation/executor.py:431 in _do_execute_operation
      result: int = getattr(self, f"_execute_{method}")(operation)

34  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/installation/executor.py:555 in _execute_install
      status_code = self._install(operation)

33  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/installation/executor.py:591 in _install
      archive = self._download(operation)

32  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/installation/executor.py:735 in _download
      return self._download_link(operation, link)

31  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/installation/executor.py:771 in _download_link
      archive = self._chef.prepare(

30  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/installation/chef.py:58 in prepare
      return self._prepare_sdist(

29  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/installation/chef.py:122 in _prepare_sdist
      return self._prepare(

28  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/installation/chef.py:75 in _prepare
      with isolated_builder(

27  ~/.asdf/installs/python/3.14.0/lib/python3.14/contextlib.py:141 in __enter__
      return next(self.gen)

26  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/utils/isolated_build.py:206 in isolated_builder
      with ephemeral_environment(

25  ~/.asdf/installs/python/3.14.0/lib/python3.14/contextlib.py:141 in __enter__
      return next(self.gen)

24  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/utils/env/__init__.py:43 in ephemeral_environment
      EnvManager.build_venv(

23  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/poetry/utils/env/env_manager.py:561 in build_venv
      cli_result = virtualenv.cli_run(args, setup_logging=False)

22  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/virtualenv/run/__init__.py:44 in cli_run
      of_session = session_via_cli(args, options, setup_logging, env)

21  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/virtualenv/run/__init__.py:68 in session_via_cli
      parser, elements = build_parser(args, options, setup_logging, env)

20  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/virtualenv/run/__init__.py:112 in build_parser
      ActivationSelector(interpreter, parser),

19  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/virtualenv/run/plugin/activators.py:23 in __init__
      for k, v in self.options("virtualenv.activate").items()

18  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/virtualenv/run/plugin/base.py:49 in options
      cls._OPTIONS = cls.entry_points_for(key)

17  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/virtualenv/run/plugin/base.py:25 in entry_points_for
      return OrderedDict((e.name, e.load()) for e in cls.entry_points().select(group=key))  # ty: ignore[unresolved-attribute]

16  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/virtualenv/run/plugin/base.py:25 in <genexpr>
      return OrderedDict((e.name, e.load()) for e in cls.entry_points().select(group=key))  # ty: ignore[unresolved-attribute]

15  ~/.asdf/installs/python/3.14.0/lib/python3.14/importlib/metadata/__init__.py:179 in load
      module = import_module(match.group('module'))

14  ~/.asdf/installs/python/3.14.0/lib/python3.14/importlib/__init__.py:88 in import_module
      return _bootstrap._gcd_import(name[level:], package, level)

13  <frozen importlib._bootstrap>:1398 in _gcd_import
      

12  <frozen importlib._bootstrap>:1371 in _find_and_load
      

11  <frozen importlib._bootstrap>:1314 in _find_and_load_unlocked
      

10  <frozen importlib._bootstrap>:491 in _call_with_frames_removed
      

 9  <frozen importlib._bootstrap>:1398 in _gcd_import
      

 8  <frozen importlib._bootstrap>:1371 in _find_and_load
      

 7  <frozen importlib._bootstrap>:1342 in _find_and_load_unlocked
      

 6  <frozen importlib._bootstrap>:938 in _load_unlocked
      

 5  <frozen importlib._bootstrap_external>:762 in exec_module
      

 4  <frozen importlib._bootstrap>:491 in _call_with_frames_removed
      

 3  ~/checkouts/readthedocs.org/user_builds/gaphor-es/envs/4240/lib/python3.14/site-packages/virtualenv/activation/__init__.py:8 in <module>
      from .powershell import PowerShellActivator

 2  <frozen importlib._bootstrap>:1368 in _find_and_load
      

 1  <frozen importlib._bootstrap>:421 in __enter__
      

_DeadlockError

deadlock detected by _ModuleLock('virtualenv.activation.powershell') at 129806433602256

at <frozen importlib._bootstrap>:346 in acquire

Cannot install pygobject-stubs.

- Installing python-dateutil (2.9.0.post0)
- Installing python-discovery (1.2.1): Skipped for the following reason: Already installed
- Installing pyzmq (27.1.0)
- Installing pyyaml (6.0.3)
- Installing referencing (0.37.0)
- Installing requests (2.33.1): Skipped for the following reason: Already installed
- Installing roman-numerals (4.1.0): Skipped for the following reason: Already installed
- Installing rpds-py (0.30.0)
- Installing six (1.17.0)
- Installing snowballstemmer (3.0.1): Skipped for the following reason: Already installed
- Installing soupsieve (2.8.3)
- Installing sortedcontainers (2.4.0)
- Installing sphinx (9.1.0): Skipped for the following reason: Already installed
- Installing sphinx-basic-ng (1.0.0b2)
- Installing sphinx-copybutton (0.5.2)
- Installing sphinx-intl (2.3.2)
- Installing sphinxcontrib-applehelp (2.0.0): Skipped for the following reason: Already installed
- Installing sphinxcontrib-devhelp (2.0.0): Skipped for the following reason: Already installed
- Installing sphinxcontrib-htmlhelp (2.1.0): Skipped for the following reason: Already installed
- Installing sphinxcontrib-jsmath (1.0.1): Skipped for the following reason: Already installed
- Installing sphinxcontrib-qthelp (2.0.0): Skipped for the following reason: Already installed
- Installing sphinxcontrib-serializinghtml (2.0.0): Skipped for the following reason: Already installed
- Installing sqlalchemy (2.0.49)
- Installing stack-data (0.6.3)
- Installing tabulate (0.10.0)
- Installing tinycss2 (1.5.1)
- Installing tornado (6.5.5)
- Installing traitlets (5.14.3)
- Installing typing-extensions (4.15.0)
- Installing urllib3 (2.6.3): Skipped for the following reason: Already installed
- Installing virtualenv (21.2.0): Skipped for the following reason: Already installed
- Installing wcwidth (0.6.0)
- Installing webencodings (0.5.1)
- Installing xdoctest (1.3.2)
- Installing zipp (3.23.0)
[build:build] Getting build dependencies for wheel...
[python_discovery:python_discovery._discovery] find interpreter for spec PythonSpec(path=/home/docs/.asdf/installs/python/3.14.0/bin/python3.14)
[python_discovery:python_discovery._discovery] proposed PythonInfo(spec=CPython3.14.0.final.0-64-x86_64, exe=/home/docs/.asdf/installs/python/3.14.0/bin/python3.14, platform=linux, version='3.14.0 (main, Mar 19 2026, 17:06:41) [GCC 13.2.0]', encoding_fs_io=utf-8-utf-8)
[virtualenv:virtualenv.seed.embed.base_embed] The --no-wheel and --wheel options are deprecated. They have no effect for Python > 3.8 as wheel is no longer bundled in virtualenv.
[virtualenv:virtualenv.run.session] create virtual environment via CPython3Posix(dest=/tmp/tmpan4z1wne/.venv, clear=False, no_vcs_ignore=False, global=False)
[virtualenv:virtualenv.run.session] add activators for Bash, CShell, Fish, Nushell, PowerShell, Python
[build:build] Getting build dependencies for wheel...
[build:build] Building wheel...
[build:build] Building wheel...
[build:build] Getting build dependencies for wheel...
[build:build] Building wheel...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the verbose poetry install -vv path and the isolated_builder context, then inspect how virtualenv.activation.powershell is loaded through activation plugins. Reproduce the intermittent failure with the listed sdist dependencies and Read the Docs configuration; done means repeated installs no longer produce deadlock or BadZip errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.