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

Problem when install from git branch + poetry #59

Closed
pmav99 opened this issue Dec 23, 2018 · 4 comments
Closed

Problem when install from git branch + poetry #59

pmav99 opened this issue Dec 23, 2018 · 4 comments

Comments

@pmav99
Copy link

pmav99 commented Dec 23, 2018

When I try to install from a git branch of a project which uses poetry (i.e. no setuptools), pipx chokes because there is no setup.py. E.g. This is the traceback for installing the develop branch of poetry itself

pipx install --spec 'git+https://github.com/sdispater/poetry.git@develop' poetry --verbose
pipx (run_pipx_command:626): virtualenv location is /home/feanor/.local/pipx/venvs/poetry
pipx (_run:230): running /usr/bin/python -m venv /home/feanor/.local/pipx/venvs/poetry
pipx (_run:230): running /home/feanor/.local/pipx/venvs/poetry/bin/python -m pip install --upgrade pip
Looking in links: /home/feanor/.wheelhouse
Collecting pip
  Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 10.0.1
    Uninstalling pip-10.0.1:
      Successfully uninstalled pip-10.0.1
Successfully installed pip-18.1
pipx (_run:230): running /home/feanor/.local/pipx/venvs/poetry/bin/python -m pip install git+https://github.com/sdispater/poetry.git@develop#egg=poetry
Looking in links: /home/feanor/.wheelhouse
Collecting poetry from git+https://github.com/sdispater/poetry.git@develop#egg=poetry
  Cloning https://github.com/sdispater/poetry.git (to revision develop) to ./feanor/pip-install-xsy609ai/poetry
Branch 'develop' set up to track remote branch 'develop' from 'origin'.
Switched to a new branch 'develop'
  Installing build dependencies ... done
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/python3.7/tokenize.py", line 447, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/feanor/pip-install-xsy609ai/poetry/setup.py'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/feanor/pip-install-xsy609ai/poetry/
pipx (rmdir:240): removing directory /home/feanor/.local/pipx/venvs/poetry
'/home/feanor/.local/pipx/venvs/poetry/bin/python -m pip install git+https://github.com/sdispater/poetry.git@develop#egg=poetry' failed

I am not sure if this is something under the scope of pipx, but at the very least handling the exception and giving a message should be better from a UX point of view.

@cs01
Copy link
Member

cs01 commented Dec 24, 2018

Pip itself will be adding support for this in its next release, coming in version 19 in January of 2019. See python-poetry/poetry#321.

When the pip update is released, installation of poetry-based projects should work fine with pipx.

@pmav99 pmav99 closed this as completed Dec 24, 2018
@pmav99
Copy link
Author

pmav99 commented Jan 23, 2019

The new pip version is out but this is still failing. Do we need to use some kind of flag?

pipx install --spec 'git+https://github.com/sdispater/poetry.git@develop' poetry --verbose
pipx (run_pipx_command:626): virtualenv location is /home/feanor/.local/pipx/venvs/poetry
pipx (_run:230): running /usr/bin/python -m venv /home/feanor/.local/pipx/venvs/poetry
pipx (_run:230): running /home/feanor/.local/pipx/venvs/poetry/bin/python -m pip install --upgrade pip
Looking in links: /home/feanor/.wheelhouse
Collecting pip
  Using cached https://files.pythonhosted.org/packages/60/64/73b729587b6b0d13e690a7c3acd2231ee561e8dd28a58ae1b0409a5a2b20/pip-19.0-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
Successfully installed pip-19.0
pipx (_run:230): running /home/feanor/.local/pipx/venvs/poetry/bin/python -m pip install git+https://github.com/sdispater/poetry.git@develop#egg=poetry
Looking in links: /home/feanor/.wheelhouse
Collecting poetry from git+https://github.com/sdispater/poetry.git@develop#egg=poetry
  Cloning https://github.com/sdispater/poetry.git (to revision develop) to /tmp/feanor/pip-install-o_pphyt8/poetry
Branch 'develop' set up to track remote branch 'develop' from 'origin'.
Switched to a new branch 'develop'
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  Complete output from command /home/feanor/.local/pipx/venvs/poetry/bin/python /home/feanor/.local/pipx/venvs/poetry/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/feanor/tmpgakge7as:
  Traceback (most recent call last):
    File "/home/feanor/.local/pipx/venvs/poetry/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
      main()
    File "/home/feanor/.local/pipx/venvs/poetry/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/feanor/.local/pipx/venvs/poetry/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 54, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/tmp/feanor/pip-build-env-e0ijsf1n/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 115, in get_requires_for_build_wheel
      return _get_build_requires(config_settings, requirements=['wheel'])
    File "/tmp/feanor/pip-build-env-e0ijsf1n/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 101, in _get_build_requires
      _run_setup()
    File "/tmp/feanor/pip-build-env-e0ijsf1n/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 82, in _run_setup
      f = getattr(tokenize, 'open', open)(__file__)
    File "/usr/lib/python3.7/tokenize.py", line 447, in open
      buffer = _builtin_open(filename, 'rb')
  FileNotFoundError: [Errno 2] No such file or directory: 'setup.py'
  
  ----------------------------------------
Command "/home/feanor/.local/pipx/venvs/poetry/bin/python /home/feanor/.local/pipx/venvs/poetry/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/feanor/tmpgakge7as" failed with error code 1 in /tmp/feanor/pip-install-o_pphyt8/poetry
pipx (rmdir:240): removing directory /home/feanor/.local/pipx/venvs/poetry
'/home/feanor/.local/pipx/venvs/poetry/bin/python -m pip install git+https://github.com/sdispater/poetry.git@develop#egg=poetry' failed

@pmav99 pmav99 reopened this Jan 23, 2019
@xsteadfastx
Copy link

it works for me. i use for example this:

pipx install --verbose --spec git+https://github.com/xsteadfastx/flickr2pelican.git flickr2pelican

@cs01
Copy link
Member

cs01 commented Feb 23, 2019

Ironically, poetry's pyproject.toml does not have the required entry in it to make it compatible with pip.

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

flickr2pelican does, and therefore it works with pipx. You should file an issue/pull request with the poetry project to resolve this.

Compare the pyproject.toml files:
https://github.com/sdispater/poetry/blob/df59c3d40703c8467d73f57ac72cf35bd3747dad/pyproject.toml

https://github.com/xsteadfastx/flickr2pelican/blob/a412e3d959929c8aa4b2175d0dae0b159011e14c/pyproject.toml#L30

@cs01 cs01 closed this as completed Feb 23, 2019
gh271 pushed a commit to gh271/pipx that referenced this issue Jan 2, 2025
gh271 pushed a commit to gh271/pipx that referenced this issue Jan 2, 2025
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

3 participants