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

Current version incompatible with poetry #118

Open
danielemichilli opened this issue May 4, 2022 · 1 comment
Open

Current version incompatible with poetry #118

danielemichilli opened this issue May 4, 2022 · 1 comment

Comments

@danielemichilli
Copy link

The content of pyproject.toml is incompatible with poetry and makes the installation fall back on using setup.py. This also fails as Cython is not installed in the environment by poetry before running the setup.

For example, running in another module poetry add /path/to/v0.4.2/bitshuffle causes the error

  PackageInfoError

  Unable to determine package info for path: /tmp/pypoetry-git-bitshuffleo19yfitc

  Fallback egg_info generation failed.

  Command ['/tmp/tmp0azgu769/.venv/bin/python', 'setup.py', 'egg_info'] errored with the following return code 1, and output:
  Traceback (most recent call last):
    File "setup.py", line 13, in <module>
      from Cython.Compiler.Main import default_options
  ModuleNotFoundError: No module named 'Cython'

  at /usr/local/lib/python3.7/site-packages/poetry/inspection/info.py:503 in _pep517_metadata
      499│                     venv.run("python", "setup.py", "egg_info")
      500│                     return cls.from_metadata(path)
      501│                 except EnvCommandError as fbe:
      502│                     raise PackageInfoError(
    → 503│                         path, "Fallback egg_info generation failed.", fbe
      504│                     )
      505│                 finally:
      506│                     os.chdir(cwd.as_posix())
      507│
r
@shinybrar
Copy link

shinybrar commented May 19, 2022

@danielemichilli @jrs65 -- looking into this issue and here are some observations.

  • The issue is not pyproject.toml -- it is set up with sufficient parameters.
  • The issue arises from the current layout of setup.py itself. You can replicate this issue by simply following the commands below:
cd bitshuffle
docker run -it -v $(pwd):/bitshuffle python:3.7-slim python /bitshuffle/setup.py --help
Traceback (most recent call last):
  File "/bitshuffle/setup.py", line 13, in <module>
    from Cython.Compiler.Main import default_options
ModuleNotFoundError: No module named 'Cython'

You need Cython installed in the environment to even evaluate the install and setup directives. This breaks any setup command other than install.

As a result, you cannot currently install bitshuffle locally, and even python setup.py install will fail.

Most third-party dependency resolution systems, pipx, poetry, flit etc. use egg_info to fetch metadata, build tags and dependency links for the project. Note, this is outside the purview and different from install_requires and setup_requires dependencies which are correctly defined in pyproject.toml.

I bandaid fix for this issue, is in #123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants