Poetry: Unable to install pyre2 from git

Created on 25 Oct 2020  ยท  2Comments  ยท  Source: python-poetry/poetry

  • [X] I am on the latest Poetry version.
  • [X] I have searched the issues of this repo and believe that this is not a duplicate.
  • [X] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macOS Cataline 10.15.7 (19H2)
  • Poetry version: 1.1.3
  • the contents of your pyproject.toml file:
[tool.poetry]
name = "poetry_bug"
version = "0.1.0"
description = ""
authors = ["[email protected]"]

[tool.poetry.dependencies]
python = "^3.8"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0", "Cython>=0.29.6"]
build-backend = "poetry.core.masonry.api"

Issue


I want to migrate from Pipenv to poetry but I can't seem to install https://github.com/andreasvc/pyre2. The first issue I encountered was https://github.com/python-poetry/poetry/issues/2789, I tried @abn's PR and it seems to get past the Cython issue but now it fails on:

  PackageInfoError

  Unable to determine package info for path: /var/folders/t5/qqzkc6pd733gyg8dl61_9wcw0000gn/T/pypoetry-git-pyre21tjcywk3

  at ~/.local/pipx/venvs/poetry@2794/lib/python3.9/site-packages/poetry/inspection/info.py:477 in _pep517_metadata
      473โ”‚                 try:
      474โ”‚                     venv.run("python", "setup.py", "egg_info")
      475โ”‚                     return cls.from_metadata(path)
      476โ”‚                 except EnvCommandError:
    โ†’ 477โ”‚                     raise PackageInfoError(path)
      478โ”‚                 finally:
      479โ”‚                     os.chdir(cwd.as_posix())
      480โ”‚
      481โ”‚         if info:

I'm happy to contribute code to fix this issue with a bit of guidance

Question candidatfaq

All 2 comments

@yoav-orca the issue is that pyre2 does not add Cython to its build-backend.requires. This is not something poetry can resolve. The build for the dependnecy happens in its own isolated environment with whatever it declares as its build requirements.

The fix is for the project to add a pyproject.toml file with the relevant build-system section to the pyre2 project. Here is a minimal pyproject.toml based on what I could figure out from that project.

[build-system]
requires = ["setuptools", "wheel", "Cython>=0.20"]
build-backend = "setuptools.build_meta:__legacy__"

@abn thanks, it worked. I'll try to push this fix to pyre2

Was this page helpful?
0 / 5 - 0 ratings