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

added pip requirment for config virtualenv.create=False #2818

Merged
merged 5 commits into from
Sep 30, 2020
Merged

added pip requirment for config virtualenv.create=False #2818

merged 5 commits into from
Sep 30, 2020

Conversation

KGB33
Copy link
Contributor

@KGB33 KGB33 commented Aug 16, 2020

Resolves: #1165

  • Added tests for changed code. -- NA - no code changed
  • Updated documentation for changed code. -- NA - no code changed

@abn
Copy link
Member

abn commented Aug 16, 2020

This should no longer be required since #2666 right? The embedded pip from virtualenv is used.

@KGB33
Copy link
Contributor Author

KGB33 commented Aug 16, 2020

For installing project dependencies that makes sense but how does poetry install it's _vendor packages?

The _vendor folder in the (latest) release on Github is empty, and I didn't see the installer download anything else.

@abn
Copy link
Member

abn commented Aug 16, 2020

From poetry-1.1.0b2-linux.tar.gz the poetry/_vendor direcotry is already populated with the vendored dependencies.

$ ls poetry/_vendor
py2.7  py3.5  py3.6  py3.7  py3.8  py3.9

At the moment, the get-poetry.py script does not rely on pip or any external dependnecies other than a valid python version. Note that the vendor directory is only valid for when installed using the custom installer (get-poetry.py). For installation using pip or pipx dependencies are managed by the package management frontend.

Verified this by installing in a minimal environment without pip.

$ docker run --rm -it fedora:latest bash -c '\
>     type pip || :; \
>     curl -sLO https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py;\
>     python3 get-poetry.py --preview --yes; \
>     source $HOME/.poetry/env; \
>     poetry --version'
bash: line 1: type: pip: not found
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

$HOME/.poetry/bin

This path will then be added to your `PATH` environment variable by
modifying the profile files located at:

$HOME/.profile
$HOME/.bash_profile

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing version: 1.1.0b2
  - Downloading poetry-1.1.0b2-linux.tar.gz (57.18MB)

Poetry (1.1.0b2) is installed now. Great!

To get started you need Poetry's bin directory ($HOME/.poetry/bin) in your `PATH`
environment variable. Next time you log in this will be done
automatically.

To configure your current shell run `source $HOME/.poetry/env`

Poetry version 1.1.0b2

@KGB33
Copy link
Contributor Author

KGB33 commented Aug 16, 2020

Gotcha. I checked the source code zip and just incorrectly assumed the _vender folder was un-populated for all of them.

@KGB33 KGB33 closed this Aug 16, 2020
@abn
Copy link
Member

abn commented Aug 16, 2020

@KGB33 this still has value; but maybe make it clear that this is only required for cases where the project is using the system environment (poetry config virtualenvs.create false). And maybe this is better off in the "Configuration" section of the docs.

@KGB33 KGB33 deleted the issue_1165_pip_as_sys_requirment branch August 19, 2020 19:37
@KGB33 KGB33 restored the issue_1165_pip_as_sys_requirment branch August 19, 2020 19:50
@KGB33 KGB33 reopened this Aug 19, 2020
@KGB33
Copy link
Contributor Author

KGB33 commented Aug 19, 2020

@abn Sorry for the delay, I've added a simple note to the configuration docs. I was thinking adding an error message might be helpful as well, however, I haven't gotten a docker image to work for me quite yet.

@KGB33
Copy link
Contributor Author

KGB33 commented Aug 20, 2020

Got the docker image to work for me and the error message is very clear.

Skipping virtualenv creation, as specified in config file.
Installing dependencies from lock file

Package operations: 71 installs, 0 updates, 0 removals

  • Installing pycparser (2.20)

  EnvCommandError

  Command ['/usr/local/bin/python3', '-m', 'pip', 'install', '--no-deps', '/root/.cache/pypoetry/artifacts/37/8e/5a/0ea4f84bc7f11e0e3468110efa2c7783241ea7eaa63a92a751de06f78f/pycparser-2.20-py2.py3-none-any.whl'] errored with the following return code 1, and output:
  /usr/local/bin/python3: No module named pip


  at /poetry_install/libutils/env.py:915 in _run
       911│                 output = subprocess.check_output(
       912│                     cmd, stderr=subprocess.STDOUT, **kwargs
       913│                 )
       914│         except CalledProcessError as e:
    →  915│             raise EnvCommandError(e, input=input_)
       916│
       917│         return decode(output)
       918│
       919│     def execute(self, bin, *args, **kwargs):

@KGB33 KGB33 changed the title added pip system requirment added pip requirment for config virtualenv.create=False Aug 21, 2020
docs/docs/configuration.md Outdated Show resolved Hide resolved
Co-authored-by: Arun Babu Neelicattu <[email protected]>
@KGB33
Copy link
Contributor Author

KGB33 commented Sep 6, 2020

What about adding why. Something like:

!!!note:
        When setting this configuration to `false`, the Python environment used must have `pip` 
        installed and available because Poetry cannot use the vendored `virtualenv`. 

@abn abn merged commit 007405d into python-poetry:master Sep 30, 2020
Copy link

github-actions bot commented Mar 1, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pip should be listed as a system requirement
2 participants