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

Can't install Poetry project in editable mode #151

Closed
raxod502 opened this issue May 2, 2019 · 4 comments
Closed

Can't install Poetry project in editable mode #151

raxod502 opened this issue May 2, 2019 · 4 comments

Comments

@raxod502
Copy link

raxod502 commented May 2, 2019

I would expect this to work, but it doesn't:

% pipx install -e --spec git+https://github.com/sdispater/poetry.git poetry
ERROR: Error installing 'poetry from git+https://github.com/sdispater/poetry.git#egg=poetry': editable mode is not supported for pyproject.toml-style projects. This project is being processed as pyproject.toml-style because it has a pyproject.toml file and no setup.py. See PEP 517 for the relevant specification.
'/Users/raxod502/.local/pipx/venvs/poetry/bin/python -m pip install --editable git+https://github.com/sdispater/poetry.git#egg=poetry -q' failed

Use case: I want to develop a Python package using Poetry which provides a binary, and I want to install it in my local environment using pipx for development.

Workaround is to add the following to my shell configuration:

if [[ -d /path/to/project ]] &&
       (( $+commands[poetry] )); then
    function my-binary {
        (
            cd /path/to/project || return
            poetry run my-binary "$@" || return
        )
    }
fi
@cs01
Copy link
Member

cs01 commented May 2, 2019

Thanks for reporting. Unfortunately this is out of pipx's control. This was a rather large oversight of PEP 517. pypa/pip#6434

I haven't tried this yet, but there might be a workaround with the --no-use-pep517 flag (pypa/pip#6434 (comment)).

Something like

pipx install --pip-args "--no-use-pep517" ...

@cs01
Copy link
Member

cs01 commented May 2, 2019

Whatever the case, this should probably be documented somewhere in pipx so thanks for bringing it up. I haven't had the time to fully understand the implications, so I am not ready to write docs on this. If you end up spending some time reading up and experimenting, doc PRs are welcome.

@funkyfuture
Copy link
Contributor

to me it seems to be still not working:

$ pip list --user
Package    Version 
---------- --------
Click      7.0     
pip        19.1.1  
pipsi      0.9     
pipx       0.13.1.1
userpath   1.1.0   
virtualenv 16.4.3  
wheel      0.33.1  

…/poetry $ pipx install --editable --spec . --pip-args="--no-use-pep517"  poetry
creating virtual environment...
Usage:   
  /home/user/.local/pipx/venvs/poetry/bin/python -m pip install [options] <requirement specifier> [package-index-options] ...
  /home/user/.local/pipx/venvs/poetry/bin/python -m pip install [options] -r <requirements file> [package-index-options] ...
  /home/user/.local/pipx/venvs/poetry/bin/python -m pip install [options] [-e] <vcs project url> ...
  /home/user/.local/pipx/venvs/poetry/bin/python -m pip install [options] [-e] <local project path> ...
  /home/user/.local/pipx/venvs/poetry/bin/python -m pip install [options] <archive url/path> ...

no such option: --no-use-pep517
'/home/user/.local/pipx/venvs/poetry/bin/python -m pip install --no-use-pep517 --upgrade pip -q' failed

@matan129
Copy link

Since support of PEP 660 was merged in pip (since version 21.3), this issue is no longer relevant - it just works given that pipx uses an appropriate pip vesion.

This issue can be closed as resolved

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

5 participants