question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dependency issue when poetry used in private dependency, 'install_requires' must be a string or list of strings

See original GitHub issue
  • 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:Debian GNU/Linux 9
  • Poetry version:0.12.15
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

Poetry error when private dependency (gist here https://gist.github.com/vancouverwill/490daeb4c7acec58af00396ae0f13702) . I have spent the last few hours reading poetry and pip issues but can’t find the same bug.

Steps Attempted to solve it

  • set pip to 18.0
  • set pip to 9
  • comment out [build-system] section of pyproject.toml
  • delete my poetry.lock locally and rebuild
  • comparison of poetry.lock in both projects and look for clashes
$ pip install --upgrade pip==18.0.0
Collecting pip==18.0.0
  Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
Installing collected packages: pip
  Found existing installation: pip 19.1.1
    Uninstalling pip-19.1.1:
      Successfully uninstalled pip-19.1.1
Successfully installed pip-18.0
$ pip install setuptools
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages (41.0.1)
You are using pip version 18.0, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ pip install -q   poetry
You are using pip version 18.0, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ poetry --version
Poetry 0.12.15
$ pip --version
pip 18.0 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
$ poetry run pip install --upgrade 'pip==9.0.3'
Creating virtualenv evaluators-py3.6 in /root/.cache/pypoetry/virtualenvs
Collecting pip==9.0.3
  Downloading https://files.pythonhosted.org/packages/ac/95/a05b56bb975efa78d3557efa36acaf9cf5d2fd0ee0062060493687432e03/pip-9.0.3-py2.py3-none-any.whl (1.4MB)
Installing collected packages: pip
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
Successfully installed pip-9.0.3
$ poetry run pip --version
pip 9.0.3 from /root/.cache/pypoetry/virtualenvs/evaluators-py3.6/lib/python3.6/site-packages (python 3.6)
$ poetry check
All set!
$ poetry install -vvv
Virtualenv evaluators-py3.6 already exists.
Using virtualenv: /root/.cache/pypoetry/virtualenvs/evaluators-py3.6
Installing dependencies from lock file


Package operations: 33 installs, 0 updates, 0 removals, 1 skipped

  - Installing markupsafe (1.1.1)
  - Installing numpy (1.16.3)
  - Installing six (1.12.0)
  - Installing atomicwrites (1.3.0)
  - Installing attrs (19.1.0)
  - Installing certifi (2019.3.9)
  - Installing chardet (3.0.4)
  - Installing click (7.0)
  - Skipping colorama (0.4.1) Not needed for the current environment
  - Installing idna (2.8)
  - Installing itsdangerous (1.1.0)
  - Installing jinja2 (2.10.1)
  - Installing more-itertools (7.0.0)
  - Installing pluggy (0.11.0)
  - Installing py (1.8.0)
  - Installing pyrsistent (0.15.2)
  - Installing scipy (1.2.1)
  - Installing urllib3 (1.24.3)
  - Installing wcwidth (0.1.7)
  - Installing werkzeug (0.15.2)
  - Installing chaospy (3.0.4)
  - Installing coverage (4.5.3)
  - Installing entrypoints (0.3)
  - Installing flask (1.0.2)
  - Installing jsonschema (3.0.1)
  - Installing mccabe (0.6.1)
  - Installing pint (0.9)
  - Installing pycodestyle (2.5.0)
  - Installing pyflakes (2.1.1)
  - Installing pytest (4.5.0)
  - Installing requests (2.21.0)
  - Installing communitymodels (0.2.0 7196dd1)
  - Installing flake8 (3.7.7)
  - Installing pytest-cov (2.7.1)
  - Installing evaluators (0.1.0)
                                                                                
[EnvCommandError]                                                
Command ['/root/.cache/pypoetry/virtualenvs/evaluators-py3.6/bin/python', '-  
m', 'pip', 'install', '-e', '/builds/xxx/services/evaluation-service'] error  
ed with the following output:                                                 
Obtaining file:///builds/xxx/services/evaluation-service                      
    Complete output from command python setup.py egg_info:                    
    error in evaluators setup command: 'install_requires' must be a string o  
r list of strings containing valid project/version requirement specifiers; I  
nvalid URL given                                                              
                                                                              
    ----------------------------------------                                  
Command "python setup.py egg_info" failed with error code 1 in /builds/xxx/s  
ervices/evaluation-service/                                                   
You are using pip version 9.0.3, however version 19.1.1 is available.         
You should consider upgrading via the 'pip install --upgrade pip' command.    
                                                                                
Exception trace:
 /usr/local/lib/python3.6/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /usr/local/lib/python3.6/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /usr/local/lib/python3.6/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /usr/local/lib/python3.6/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /usr/local/lib/python3.6/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /usr/local/lib/python3.6/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /usr/local/lib/python3.6/site-packages/poetry/console/commands/install.py in handle() at line 77
   builder.build()
 /usr/local/lib/python3.6/site-packages/poetry/masonry/builders/editable.py in build() at line 17
   return self._setup_build()
 /usr/local/lib/python3.6/site-packages/poetry/masonry/builders/editable.py in _setup_build() at line 34
   self._env.run("python", "-m", "pip", "install", "-e", str(self._path))
 /usr/local/lib/python3.6/site-packages/poetry/utils/env.py in run() at line 536
   return super(VirtualEnv, self).run(bin, *args, **kwargs)
 /usr/local/lib/python3.6/site-packages/poetry/utils/env.py in run() at line 385
   raise EnvCommandError(e)

install [--no-dev] [--dry-run] [-E|--extras EXTRAS] [--develop DEVELOP]

ERROR: Job failed: exit code 1

Feels like it could be similar to #997, #1049 or #826 but the error messages presented there are quite different with no refernce to the error message I am seeing Invalid url given

UPDATE:

I have confirmed that if I remove the dependency from git section of project file and project lock that the error does not come up and also tried in CI cloning the git package to verify not permissions issue

Relevant section of pyproject.toml

communitymodels = {git = "git@privaterepo.co:private-repo-name.git", rev = "7196dd14be6a041b6ef3bc1fcad09a84456eaefd"}

Relevant section of poetry.lock (note empty community models)

colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"]
communitymodels = []
coverage = ["0c5fe441b9cfdab64719f24e9684502a59432df7570521563d7b1aff27ac755f", "2b412abc4c7d6e019ce7c27cbc229783035eef6d5401695dccba80f481be4eb3", ..."fc5f4d209733750afd2714e9109816a29500718b32dd9a5db01c0cb3a019b96a"]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:10

github_iconTop GitHub Comments

5reactions
Heliozoacommented, Jun 26, 2019

I was able to solve this issue for myself with help from #835 . Instead of private-dependency = {git = "git@private-repo:someorg/private-repo-name.git, I used private-dependency = {git = "ssh://git@privaterepo/someorg/private-repo-name.git"}. Note the / in place of : in between the repo and org.

4reactions
zreanebcommented, May 15, 2019

I have the exact same issue. I managed to open the setup.py that’s created by the poetry install command. This part looks like the culprit:

package_data = \
{'': ['*']}

install_requires = \
['jsons>=0.8.9,<0.9.0',
 'repo @ '  # <- This line is missing a comma
 'git+git@github.com:user/repo.git@master']

setup_kwargs = {
    'name': 'test-package',

Seems like there is a bug in whatever script is generating this file

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing package halo gives error: 'install_requires' must be a ...
warn(msg) error in halo setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement ...
Read more >
How to Package Python dependencies with PIP setuptools
install_requires is a section within the setup.py file in which you need to input a list of the minimum dependencies needed for a...
Read more >
PEP 621: how to specify dependencies? - Packaging
How to specify dependencies? People seem to fall into two camps on how to specify dependencies: using :pep: 508 strings or TOML tables...
Read more >
History | Poetry - Python dependency management and ...
1.3.0 - 2022-12-09 Added Mark the lock file with an @generated comment as used by common tooling (#2773). poetry check validates trove classifiers...
Read more >
PyPI packages in the Package Registry - GitLab Docs
Then install the packages whenever you need to use them as a dependency. ... GitLab uses the following regex to validate the version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found