python-poetry / python-poetry/poetry

Poetry should use the filename from content-disposition when downloading URL dependencies

Open
#4,472 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/installer kind/bug status/confirmed version/1.2.1
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

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

Issue

I'm trying to install a GitHub package by adding it manually in the pyproject.toml (please see the gist link above) file. I have only one entry in the package list.

When I run poetry install with the above pyproject.toml file., I get the following error:

error.log

Creating virtualenv package1-gxOcaWMk-py3.8 in /home/sidvash/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (10.8s)

Writing lock file

Package operations: 40 installs, 0 updates, 0 removals

  • Installing certifi (2021.5.30)
  • Installing chardet (3.0.4)
  • Installing idna (2.8)
  • Installing six (1.16.0)
  • Installing urllib3 (1.25.11)
  • Installing boto (2.49.0)
  • Installing bottle (0.12.19)
  • Installing click (8.0.1)
  • Installing humanfriendly (9.2)
  • Installing joblib (1.0.1)
  • Installing networkx (2.6.2)
  • Installing pycountry (20.7.3)
  • Installing redis (3.5.3)
  • Installing regex (2021.8.28)
  • Installing requests (2.22.0)
  • Installing thrift (0.11.0)
  • Installing tqdm (4.62.2)
  • Installing concrete (4.15.1)
  • Installing future (0.18.2)
  • Installing isodate (0.6.0)
  • Installing jpype1 (1.3.0)
  • Installing nltk (3.6.2)
  • Installing pyparsing (2.2.0)
  • Installing pystanforddependencies (0.3.1)
  • Installing tabulate (0.8.9)
  • Installing termcolor (1.1.0)
  • Installing attrs (21.2.0)
  • Installing memoized-property (1.0.3): Installing...
  • Installing more-itertools (8.9.0)
  • Installing numpy (1.21.1): Installing...
  • Installing overrides (3.1.0): Installing...
  • Installing packaging (21.0)
  • Installing pluggy (0.13.1)
  • Installing predpatt (1.0.1 http://github.com/hltcoe/PredPatt/tarball/master): Failed

  EnvCommandError

  Command ['/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/bin/pip', 'install', '--no-deps', '/home/sidvash/.cache/pypoetry/artifacts/29/0e/3e/8b843f752fd6db9a25d53506cd2d0e9c10f601b1f1d2a69a59ee604448/master'] errored with the following return code 2, and output: 
  ERROR: Exception:
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/packaging/requirements.py", line 102, in __init__
      req = REQUIREMENT.parseString(requirement_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 1955, in parseString
      raise exc
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 3250, in parseImpl
      raise ParseException(instring, loc, self.errmsg, self)
  pip._vendor.pyparsing.ParseException: Expected W:(abcd...), found '/'  (at char 0), (line:1, col:1)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 330, in _parse_req_string
  • Installing more-itertools (8.9.0)
  • Installing numpy (1.21.1): Installing...
  • Installing overrides (3.1.0): Installing...
  • Installing packaging (21.0)
  • Installing pluggy (0.13.1)
  • Installing predpatt (1.0.1 http://github.com/hltcoe/PredPatt/tarball/master): Failed

  EnvCommandError

  Command ['/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/bin/pip', 'install', '--no-deps', '/home/sidvash/.cache/pypoetry/artifacts/29/0e/3e/8b843f752fd6db9a25d53506cd2d0e9c10f601b1f1d2a69a59ee604448/master'] errored with the following return code 2, and output: 
  ERROR: Exception:
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/packaging/requirements.py", line 102, in __init__
      req = REQUIREMENT.parseString(requirement_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 1955, in parseString
      raise exc
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 3250, in parseImpl
      raise ParseException(instring, loc, self.errmsg, self)
  pip._vendor.pyparsing.ParseException: Expected W:(abcd...), found '/'  (at char 0), (line:1, col:1)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 330, in _parse_req_string
  • Installing memoized-property (1.0.3)
  • Installing more-itertools (8.9.0)
  • Installing numpy (1.21.1): Installing...
  • Installing overrides (3.1.0): Installing...
  • Installing packaging (21.0)
  • Installing pluggy (0.13.1)
  • Installing predpatt (1.0.1 http://github.com/hltcoe/PredPatt/tarball/master): Failed

  EnvCommandError

  Command ['/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/bin/pip', 'install', '--no-deps', '/home/sidvash/.cache/pypoetry/artifacts/29/0e/3e/8b843f752fd6db9a25d53506cd2d0e9c10f601b1f1d2a69a59ee604448/master'] errored with the following return code 2, and output: 
  ERROR: Exception:
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/packaging/requirements.py", line 102, in __init__
      req = REQUIREMENT.parseString(requirement_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 1955, in parseString
      raise exc
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 3250, in parseImpl
      raise ParseException(instring, loc, self.errmsg, self)
  pip._vendor.pyparsing.ParseException: Expected W:(abcd...), found '/'  (at char 0), (line:1, col:1)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 330, in _parse_req_string
  • Installing packaging (21.0)
  • Installing pluggy (0.13.1)
  • Installing predpatt (1.0.1 http://github.com/hltcoe/PredPatt/tarball/master): Failed

  EnvCommandError

  Command ['/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/bin/pip', 'install', '--no-deps', '/home/sidvash/.cache/pypoetry/artifacts/29/0e/3e/8b843f752fd6db9a25d53506cd2d0e9c10f601b1f1d2a69a59ee604448/master'] errored with the following return code 2, and output: 
  ERROR: Exception:
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/packaging/requirements.py", line 102, in __init__
      req = REQUIREMENT.parseString(requirement_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 1955, in parseString
      raise exc
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 3250, in parseImpl
      raise ParseException(instring, loc, self.errmsg, self)
  pip._vendor.pyparsing.ParseException: Expected W:(abcd...), found '/'  (at char 0), (line:1, col:1)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 330, in _parse_req_string
  • Installing overrides (3.1.0)
  • Installing packaging (21.0)
  • Installing pluggy (0.13.1)
  • Installing predpatt (1.0.1 http://github.com/hltcoe/PredPatt/tarball/master): Failed

  EnvCommandError

  Command ['/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/bin/pip', 'install', '--no-deps', '/home/sidvash/.cache/pypoetry/artifacts/29/0e/3e/8b843f752fd6db9a25d53506cd2d0e9c10f601b1f1d2a69a59ee604448/master'] errored with the following return code 2, and output: 
  ERROR: Exception:
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/packaging/requirements.py", line 102, in __init__
      req = REQUIREMENT.parseString(requirement_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 1955, in parseString
      raise exc
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 3250, in parseImpl
      raise ParseException(instring, loc, self.errmsg, self)
  pip._vendor.pyparsing.ParseException: Expected W:(abcd...), found '/'  (at char 0), (line:1, col:1)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 330, in _parse_req_string
  • Installing overrides (3.1.0)
  • Installing packaging (21.0)
  • Installing pluggy (0.13.1)
  • Installing predpatt (1.0.1 http://github.com/hltcoe/PredPatt/tarball/master): Failed

  EnvCommandError

  Command ['/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/bin/pip', 'install', '--no-deps', '/home/sidvash/.cache/pypoetry/artifacts/29/0e/3e/8b843f752fd6db9a25d53506cd2d0e9c10f601b1f1d2a69a59ee604448/master'] errored with the following return code 2, and output: 
  ERROR: Exception:
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/packaging/requirements.py", line 102, in __init__
      req = REQUIREMENT.parseString(requirement_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 1955, in parseString
      raise exc
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 3250, in parseImpl
      raise ParseException(instring, loc, self.errmsg, self)
  pip._vendor.pyparsing.ParseException: Expected W:(abcd...), found '/'  (at char 0), (line:1, col:1)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 330, in _parse_req_string
  • Installing numpy (1.21.1)
  • Installing overrides (3.1.0)
  • Installing packaging (21.0)
  • Installing pluggy (0.13.1)
  • Installing predpatt (1.0.1 http://github.com/hltcoe/PredPatt/tarball/master): Failed

  EnvCommandError

  Command ['/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/bin/pip', 'install', '--no-deps', '/home/sidvash/.cache/pypoetry/artifacts/29/0e/3e/8b843f752fd6db9a25d53506cd2d0e9c10f601b1f1d2a69a59ee604448/master'] errored with the following return code 2, and output: 
  ERROR: Exception:
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/packaging/requirements.py", line 102, in __init__
      req = REQUIREMENT.parseString(requirement_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 1955, in parseString
      raise exc
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/pyparsing.py", line 3250, in parseImpl
      raise ParseException(instring, loc, self.errmsg, self)
  pip._vendor.pyparsing.ParseException: Expected W:(abcd...), found '/'  (at char 0), (line:1, col:1)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 330, in _parse_req_string
      req = Requirement(req_as_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_vendor/packaging/requirements.py", line 104, in __init__
      raise InvalidRequirement(
  pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'/home/si'": Expected W:(abcd...)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
      status = self.run(options, args)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
      return func(self, options, args)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 286, in run
      reqs = self.get_requirements(args, options, finder, session)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 364, in get_requirements
      req_to_add = install_req_from_line(
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 382, in install_req_from_line
      parts = parse_req_from_line(name, line_source)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 359, in parse_req_from_line
      req: Optional[Requirement] = _parse_req_string(req_as_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 334, in _parse_req_string
      add_msg += deduce_helpful_msg(req_as_string)
    File "/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/lib/python3.8/site-packages/pip/_internal/req/constructors.py", line 144, in deduce_helpful_msg
      next(parse_requirements(fp.read()))
    File "/home/sidvash/anaconda3/lib/python3.8/codecs.py", line 322, in decode
      (result, consumed) = self._buffer_decode(data, self.errors, final)
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
  WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
  You should consider upgrading via the '/home/sidvash/.cache/pypoetry/virtualenvs/package1-gxOcaWMk-py3.8/bin/python -m pip install --upgrade pip' command.
  

  at ~/.poetry/lib/poetry/utils/env.py:1101 in _run
      1097│                 output = subprocess.check_output(
      1098│                     cmd, stderr=subprocess.STDOUT, **kwargs
      1099│                 )
      1100│         except CalledProcessError as e:
    → 1101│             raise EnvCommandError(e, input=input_)
      1102│ 
      1103│         return decode(output)
      1104│ 
      1105│     def execute(self, bin, *args, **kwargs):

  • Installing py (1.10.0)
  • Installing rdflib (4.2.2)
  • Installing typing (3.6.2)
  • Installing wcwidth (0.2.5)

When I install this package through pipenv, using the following Pipenv file:

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
decomp = {git = "https://github.com/decompositional-semantics-initiative/decomp.git"}

[dev-packages]

[requires]
python_version = "3.8"

pipenv install runs perfectly fine with this package.

Please help!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Poetry's URL-dependency download handling and reproduce the reported GitHub package installation with the linked pyproject.toml. Trace how the response's content-disposition filename is handled; done means the downloaded URL dependency uses that filename and installs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.