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

tool.poetry.dependencies -> from github fails with runtimeError #673

Closed
3 tasks done
MisterBianco opened this issue Nov 26, 2018 · 5 comments
Closed
3 tasks done

Comments

@MisterBianco
Copy link

MisterBianco commented Nov 26, 2018

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

  • Kali linux: Linux kali 4.18.0-kali2-amd64 Add support for private indices #1 SMP Debian 4.18.10-2kali1 (2018-10-09) x86_64 GNU/Linux

  • Poetry version: 12.10

[tool.poetry.dependencies]
python = "^3.7"
toml = "^0.9"
scapy = {git="https://github.com/secdev/scapy.git", branch = "master" }

Issue

After a really long hang at:

Virtualenv boop-py3.7 already exists.
Using virtualenv: /root/.cache/pypoetry/virtualenvs/boop-py3.7
Updating dependencies
Resolving dependencies...
   1: fact: boop is 3.0.2
   1: derived: boop
   1: fact: boop depends on toml (^0.9)
   1: fact: boop depends on scapy (*)
   1: fact: boop depends on pyric (^0.1.6)
   1: fact: boop depends on netaddr (^0.7)
   1: fact: boop depends on click (^7)
   1: selecting boop (3.0.2)
   1: derived: click (^7)
   1: derived: netaddr (^0.7)
   1: derived: pyric (^0.1.6)
   1: derived: scapy (*)
   1: derived: toml (^0.9)
PyPI: 1 packages found for click >=7,<8
   1: selecting click (7.0)
PyPI: No release information found for netaddr-0.7.4, skipping
PyPI: No release information found for netaddr-0.7.5, skipping
PyPI: No release information found for netaddr-0.7.6, skipping
PyPI: No release information found for netaddr-0.7.7, skipping
PyPI: No release information found for netaddr-0.7.8, skipping
PyPI: No release information found for netaddr-0.7.9, skipping
PyPI: 14 packages found for netaddr >=0.7,<0.8
   1: selecting netaddr (0.7.19)
PyPI: 4 packages found for pyric >=0.1.6,<0.2.0
   1: selecting pyric (0.1.6.3)

It eventually results in:

[RuntimeError]                                                 
Unable to retrieve the package version for /tmp/pypoetry-git-scapyilf8yynn  
                                                                              
Exception trace:
 /usr/local/lib/python3.7/dist-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /usr/local/lib/python3.7/dist-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /usr/local/lib/python3.7/dist-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /usr/local/lib/python3.7/dist-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /usr/local/lib/python3.7/dist-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /usr/local/lib/python3.7/dist-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /usr/local/lib/python3.7/dist-packages/poetry/console/commands/update.py in handle() at line 41
   return installer.run()
 /usr/local/lib/python3.7/dist-packages/poetry/installation/installer.py in run() at line 76
   self._do_install(local_repo)
 /usr/local/lib/python3.7/dist-packages/poetry/installation/installer.py in _do_install() at line 158
   ops = solver.solve(use_latest=self._whitelist)
 /usr/local/lib/python3.7/dist-packages/poetry/puzzle/solver.py in solve() at line 38
   packages, depths = self._solve(use_latest=use_latest)
 /usr/local/lib/python3.7/dist-packages/poetry/puzzle/solver.py in _solve() at line 171
   self._package, self._provider, locked=locked, use_latest=use_latest
 /usr/local/lib/python3.7/dist-packages/poetry/mixology/__init__.py in resolve_version() at line 7
   return solver.solve()
 /usr/local/lib/python3.7/dist-packages/poetry/mixology/version_solver.py in solve() at line 79
   next = self._choose_package_version()
 /usr/local/lib/python3.7/dist-packages/poetry/mixology/version_solver.py in _choose_package_version() at line 354
   packages = self._provider.search_for(dependency)
 /usr/local/lib/python3.7/dist-packages/poetry/puzzle/provider.py in search_for() at line 134
   packages = self.search_for_vcs(dependency)
 /usr/local/lib/python3.7/dist-packages/poetry/puzzle/provider.py in search_for_vcs() at line 191
   package = self.search_for_directory(directory_dependency)[0]
 /usr/local/lib/python3.7/dist-packages/poetry/puzzle/provider.py in search_for_directory() at line 292
   dependency.path

update [--no-dev] [--dry-run] [--lock] [--] [<packages>]...
@MisterBianco
Copy link
Author

If I change scapy to:

scapy = {version="^2.4"}

It works as expected, but I need the master branch for a recent commit...

@sdispater
Copy link
Member

Unfortunately, there is no way for Poetry to retrieve the version of the package from this line: https://github.com/secdev/scapy/blob/master/setup.py#L58

Poetry tries its best to retrieve the information it needs but sometimes it's just not possible without executing the setup.py which Poetry tries to do by executing python setup.py egg_info but it seems to fail for you, likely because setuptools does not exist in your virtualenv, and thus Poetry falls back on AST parsing.

I think if you do poetry run pip install setuptools before trying to install again it should work.

@MisterBianco
Copy link
Author

I guess I will chuck it up to an issue with scapys setup file and call this resolved. I shall just wait for them to do a release. Thanks

MoutonSanglant pushed a commit to MoutonSanglant/python-google-places that referenced this issue Jul 21, 2019
Poetry can not retrieve version because it is parsing setup.py with AST
parsing and thus consider there is no version of the package.
Read more: python-poetry/poetry#673
@laike9m
Copy link
Contributor

laike9m commented Aug 9, 2019

I installed setuptools by poetry add --dev setuptools, but this error still happens. Problem is this line

pytype = { git = "https://github.com/google/pytype.git", branch = "master" }

Copy link

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

3 participants