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

Poetry add stops working on Ubuntu with present global pip.config file #1572

Closed
3 tasks done
lynochka opened this issue Nov 12, 2019 · 3 comments
Closed
3 tasks done

Comments

@lynochka
Copy link

  • I am on the latest Poetry version: 0.12.17
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

Poetry add stops working when a global pip.config in $HOME/.config/pip/pip.conf is present with

[global]
index-url = https://pypi.python.org/simple
extra-index-url = https://<artifactory-username>:<artifactory-password>@cognite.jfrog.io/cognite/api/pypi/snakepit/simple 

When I delete the config, poetry add starts working again in the same project folder:

With pip.config existing:

$ poetry add regex -vvv
Using virtualenv: /home/alina/Documents/tennin/.venv
PyPI: 268 packages found for regex *
Using version ^2019.11 for regex

Updating dependencies
Resolving dependencies...
   1: fact: tennin is 0.1.0
   1: derived: tennin
   1: fact: tennin depends on requests (^2.22)
   1: fact: tennin depends on regex (^2019.11)
   1: selecting tennin (0.1.0)
   1: derived: regex (^2019.11)
   1: derived: requests (^2.22)
PyPI: 1 packages found for regex >=2019.11,<2020.0
   1: selecting regex (2019.11.1)
   1: fact: requests (2.22.0) depends on chardet (>=3.0.2,<3.1.0)
   1: fact: requests (2.22.0) depends on idna (>=2.5,<2.9)
   1: fact: requests (2.22.0) depends on urllib3 (>=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26)
   1: fact: requests (2.22.0) depends on certifi (>=2017.4.17)
   1: selecting requests (2.22.0)
   1: derived: certifi (>=2017.4.17)
   1: derived: urllib3 (>=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26)
   1: derived: idna (>=2.5,<2.9)
   1: derived: chardet (>=3.0.2,<3.1.0)
   1: selecting certifi (2019.9.11)
   1: selecting urllib3 (1.25.7)
   1: selecting idna (2.8)
   1: selecting chardet (3.0.4)
   1: Version solving took 0.131 seconds.
   1: Tried 1 solutions.


Package operations: 1 install, 0 updates, 0 removals

  - Installing regex (2019.11.1)
                                                                                                                                                                       
[EnvCommandError]                                                                                                                                       
Command ['/home/alina/Documents/tennin/.venv/bin/python', '-m', 'pip', 'install', '--no-deps', 'regex==2019.11.1'] errored with the following return code 2, and output:   
Collecting regex==2019.11.1                                                                                                                                          
Exception:                                                                                                                                                           
Traceback (most recent call last):                                                                                                                                   
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/basecommand.py", line 215, in main                                                        
    status = self.run(options, args)                                                                                                                                 
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/commands/install.py", line 353, in run                                                    
    wb.build(autobuilding=True)                                                                                                                                      
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/wheel.py", line 749, in build                                                             
    self.requirement_set.prepare_files(self.finder)                                                                                                                  
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/req/req_set.py", line 380, in prepare_files                                               
    ignore_dependencies=self.ignore_dependencies))                                                                                                                   
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/req/req_set.py", line 554, in _prepare_file                                               
    require_hashes                                                                                                                                                   
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/req/req_install.py", line 278, in populate_link                                           
    self.link = finder.find_requirement(self, upgrade)                                                                                                               
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/index.py", line 465, in find_requirement                                                  
    all_candidates = self.find_all_candidates(req.name)                                                                                                              
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/index.py", line 423, in find_all_candidates                                               
    for page in self._get_pages(url_locations, project_name):                                                                                                        
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/index.py", line 568, in _get_pages                                                        
    page = self._get_page(location)                                                                                                                                  
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/index.py", line 683, in _get_page                                                         
    return HTMLPage.get_page(link, session=self.session)                                                                                                             
  File "/home/alina/Documents/tennin/.venv/lib/python3.7/site-packages/pip/index.py", line 795, in get_page                                                          
    resp.raise_for_status()                                                                                                                                          
  File "/home/alina/Documents/tennin/.venv/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status               
    raise HTTPError(http_error_msg, response=self)                                                                                                                   
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://cognite.jfrog.io/cognite/api/pypi/snakepit/simple/regex/                                 
                                                                                                                                                                       
Exception trace:
 /home/alina/.local/lib/python3.7/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /home/alina/.local/lib/python3.7/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /home/alina/.local/lib/python3.7/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /home/alina/.local/lib/python3.7/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /home/alina/.local/lib/python3.7/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /home/alina/.local/lib/python3.7/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /home/alina/.local/lib/python3.7/site-packages/poetry/console/commands/add.py in handle() at line 139
   status = installer.run()
 /home/alina/.local/lib/python3.7/site-packages/poetry/installation/installer.py in run() at line 73
   self._do_install(local_repo)
 /home/alina/.local/lib/python3.7/site-packages/poetry/installation/installer.py in _do_install() at line 290
   self._execute(op)
 /home/alina/.local/lib/python3.7/site-packages/poetry/installation/installer.py in _execute() at line 306
   getattr(self, "_execute_{}".format(method))(operation)
 /home/alina/.local/lib/python3.7/site-packages/poetry/installation/installer.py in _execute_install() at line 331
   self._installer.install(operation.package)
 /home/alina/.local/lib/python3.7/site-packages/poetry/installation/pip_installer.py in install() at line 91
   self.run(*args)
 /home/alina/.local/lib/python3.7/site-packages/poetry/installation/pip_installer.py in run() at line 112
   return self._env.run("python", "-m", "pip", *args, **kwargs)
 /home/alina/.local/lib/python3.7/site-packages/poetry/utils/env.py in run() at line 539
   return super(VirtualEnv, self).run(bin, *args, **kwargs)
 /home/alina/.local/lib/python3.7/site-packages/poetry/utils/env.py in run() at line 388
   raise EnvCommandError(e, input=input_)

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...
 

Without pip.config existing:

$ rm $HOME/.config/pip/pip.conf
$ poetry add regex -vvv
Using virtualenv: /home/alina/Documents/tennin/.venv
PyPI: 268 packages found for regex *
Using version ^2019.11 for regex

Updating dependencies
Resolving dependencies...
   1: fact: tennin is 0.1.0
   1: derived: tennin
   1: fact: tennin depends on requests (^2.22)
   1: fact: tennin depends on regex (^2019.11)
   1: selecting tennin (0.1.0)
   1: derived: regex (^2019.11)
   1: derived: requests (^2.22)
PyPI: 1 packages found for regex >=2019.11,<2020.0
   1: selecting regex (2019.11.1)
   1: fact: requests (2.22.0) depends on chardet (>=3.0.2,<3.1.0)
   1: fact: requests (2.22.0) depends on idna (>=2.5,<2.9)
   1: fact: requests (2.22.0) depends on urllib3 (>=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26)
   1: fact: requests (2.22.0) depends on certifi (>=2017.4.17)
   1: selecting requests (2.22.0)
   1: derived: certifi (>=2017.4.17)
   1: derived: urllib3 (>=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26)
   1: derived: idna (>=2.5,<2.9)
   1: derived: chardet (>=3.0.2,<3.1.0)
   1: selecting certifi (2019.9.11)
   1: selecting urllib3 (1.25.7)
   1: selecting idna (2.8)
   1: selecting chardet (3.0.4)
   1: Version solving took 0.133 seconds.
   1: Tried 1 solutions.


Package operations: 1 install, 0 updates, 0 removals

  - Installing regex (2019.11.1)

Hope this is sufficient information.

@lynochka lynochka added the kind/bug Something isn't working as expected label Nov 12, 2019
@jazzblue
Copy link

jazzblue commented Aug 21, 2020

I am having exactly same issue. The URL contains credentials which if stored in pip.conf become a part of you local environment and are not exposed. With poetry we will have to expose url with credentials in our pyproject.tml, which is not acceptable. We need poetry to regard pip.conf.

See "Using Credentials" in https://www.jfrog.com/confluence/display/JFROG/PyPI+Repositories

Has anyone had a chance to look into it?
Thanks.

@finswimmer finswimmer added the status/triage This issue needs to be triaged label Aug 24, 2020
@neersighted neersighted removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 9, 2022
@neersighted
Copy link
Member

Closing as out of scope as Poetry has its own system of sources incompatible with pip's -- we are also starting to run pip in --isolated mode to prevent use of these global config files.

@jazzblue, your ask is different and tracked in #5958.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2022
Copy link

github-actions bot commented Mar 1, 2024

This issue 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

No branches or pull requests

4 participants