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

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

Closed
3 tasks done
vancouverwill opened this issue May 14, 2019 · 11 comments

Comments

@vancouverwill
Copy link

vancouverwill commented May 14, 2019

  • 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"]
@vancouverwill
Copy link
Author

I wondered if there was an issue with using a commit as a reference with GIT so switched to a TAG and no luck there either

communitymodels = {git = "git@gitlab.arrival.co:RED/communitymodels.git", tag = "0.2.0"}

still showing empty hash in poetry lock

communitymodels = []

@vancouverwill
Copy link
Author

#991 and #691 look quite similar but different error messages

@zreaneb
Copy link

zreaneb commented 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

@nackjicholson
Copy link

nackjicholson commented May 19, 2019

This is a blocking issue if you're using dependencies from github repositories. Can't upgrade past 0.12.13. Having to pin poetry install pip install poetry==0.12.13 in my docker builds to keep things from breaking.

On my laptop had to poetry self:update 0.12.13.

@Heliozoa
Copy link

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.

@stefansedich
Copy link

Thanks @Heliozoa your solution worked for me, weirdly I was not seeing this issue even with a git dependency without the ssh:// format, renamed my project/module and started to see it it locally but at the same time my CI build which is also running poetry 0.12.17 was not having any issue 🤷‍♂️

@stale
Copy link

stale bot commented Nov 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 13, 2019
@stale
Copy link

stale bot commented Nov 20, 2019

Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.

@stale stale bot closed this as completed Nov 20, 2019
@SUlbrichA
Copy link

I can confirm that the problem still persists with version 1.0.0 and the solution of @Heliozoa is still a valid workaround (thanks!). Maybe a hint in the documentation is the quickest approach to prevent users to run into this problem (as update worked but install failed, I was looking for different causes)

@melMass
Copy link

melMass commented Nov 11, 2020

This should be specified in the documentation! Thanks @Heliozoa

Copy link

github-actions bot commented Mar 2, 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 2, 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

7 participants