Skip to content

POETRY_HTTP_BASIC_ environment variables are ignored for private repositories #2988

@willemt

Description

@willemt
  • I am on the latest Poetry version.

  • 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).

  • OS version and name: travis-ci-sardonyx-xenial (happening in CI)

  • Poetry version: 1.1.0rc1

  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

Poetry 1.1.0rc1 is ignoring POETRY_HTTP_BASIC_XXX_PASSWORD and POETRY_HTTP_BASIC_XXX_USERNAME

I'm getting HTTP 401 when running poetry install.

Works fine on 1.0.10.

  HTTPError

  401 Client Error: Unauthorized for url: https://xxxxxxx.execute-api.ap-northeast-1.amazonaws.com/dev/packages/xxx-0.1.61-py3-none-any.whl

  at ~/virtualenv/python3.7.1/lib/python3.7/site-packages/requests/models.py:941 in raise_for_status
      937│         elif 500 <= self.status_code < 600:
      938│             http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
      939│
      940│         if http_error_msg:
    → 941│             raise HTTPError(http_error_msg, response=self)
      942│
      943│     def close(self):
      944│
      945│         called the underlying ``raw`` object must not be accessed again.

Stack trace (apologies for the artefacts in the left column):


  8  ~/virtualenv/python3.7.1/lib/python3.7/site-packages/poetry/installation/executor.py:179 in _execute_operation
      177│ 
      178│             try:
    → 179│                 result = self._do_execute_operation(operation)
      180│             except EnvCommandError as e:
      181│                 if e.e.returncode == -2:

  7  ~/virtualenv/python3.7.1/lib/python3.7/site-packages/poetry/installation/executor.py:253 in _do_execute_operation
      251│             return 0
      252│ 
    → 253│         result = getattr(self, "_execute_{}".format(method))(operation)
      254│ 
      255│         if result != 0:

  6  ~/virtualenv/python3.7.1/lib/python3.7/site-packages/poetry/installation/executor.py:388 in _execute_install
      386│ 
      387│     def _execute_install(self, operation):  # type: (Install) -> None
    → 388│         return self._install(operation)
      389│ 
      390│     def _execute_update(self, operation):  # type: (Update) -> None

  5  ~/virtualenv/python3.7.1/lib/python3.7/site-packages/poetry/installation/executor.py:414 in _install
      412│             archive = self._download_link(operation, Link(package.source_url))
      413│         else:
    → 414│             archive = self._download(operation)
      415│ 
      416│         operation_message = self.get_operation_message(operation)

  4  ~/virtualenv/python3.7.1/lib/python3.7/site-packages/poetry/installation/executor.py:568 in _download
      566│         link = self._chooser.choose_for(operation.package)
      567│ 
    → 568│         return self._download_link(operation, link)
      569│ 
      570│     def _download_link(self, operation, link):

  3  ~/virtualenv/python3.7.1/lib/python3.7/site-packages/poetry/installation/executor.py:577 in _download_link
      575│             # No cached distributions was found, so we download and prepare it
      576│             try:
    → 577│                 archive = self._download_archive(operation, link)
      578│             except BaseException:
      579│                 cache_directory = self._chef.get_cache_directory_for_link(link)

  2  ~/virtualenv/python3.7.1/lib/python3.7/site-packages/poetry/installation/executor.py:604 in _download_archive
      602│     def _download_archive(self, operation, link):  # type: (Operation, Link) -> Path
      603│         response = self._authenticator.request(
    → 604│             "get", link.url, stream=True, io=self._sections.get(id(operation), self._io)
      605│         )
      606│         wheel_size = response.headers.get("content-length")

  1  ~/virtualenv/python3.7.1/lib/python3.7/site-packages/poetry/installation/authenticator.py:80 in request
       78│             else:
       79│                 if resp.status_code not in [502, 503, 504] or is_last_attempt:
    →  80│                     resp.raise_for_status()
       81│                     return resp
       82│ 

  HTTPError

  401 Client Error: Unauthorized for url: https://xxx.execute-api.ap-northeast-1.amazonaws.com/dev/packages/xxx-0.1.61-py3-none-any.whl

  at ~/virtualenv/python3.7.1/lib/python3.7/site-packages/requests/models.py:941 in raise_for_status
      937│         elif 500 <= self.status_code < 600:
      938│             http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
      939│ 
      940│         if http_error_msg:
    → 941│             raise HTTPError(http_error_msg, response=self)
      942│ 
      943│     def close(self):
      944│         
      945│         called the underlying ``raw`` object must not be accessed again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions