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

Unable to retrieve the package version #2175

Closed
3 tasks done
leibowitz opened this issue Mar 11, 2020 · 5 comments
Closed
3 tasks done

Unable to retrieve the package version #2175

leibowitz opened this issue Mar 11, 2020 · 5 comments
Labels
kind/bug Something isn't working as expected

Comments

@leibowitz
Copy link

Issue

I am trying to install a package from a git repository (because I had to fork the original package, and I haven't published it to pypi) with:

poetry add git+https://github.com/carlospalol/django-moneyfield.git

But I get the following error:

[RuntimeError]
Unable to retrieve the package version for /var/folders/5f/134_dwks64jfppffv26mvkbr0000gn/T/pypoetry-git-django-moneyfieldrvmFVf

The package is django-moneyfield, and the setup.py is using setup from distutils:

from distutils.core import setup

This seems to be the issue, as any package I try to install in this way (using the git repository url) which has this import seems to fail with the same error.

Using poetry -vvv return the traceback, in case it is useful:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/usr/local/lib/python2.7/site-packages/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/usr/local/lib/python2.7/site-packages/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/usr/local/lib/python2.7/site-packages/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/usr/local/lib/python2.7/site-packages/poetry/console/commands/add.py", line 89, in handle
packages, allow_prereleases=self.option('allow-prereleases')
File "/usr/local/lib/python2.7/site-packages/poetry/console/commands/init.py", line 293, in _determine_requirements
requires = self._parse_requirements(requires)
File "/usr/local/lib/python2.7/site-packages/poetry/console/commands/init.py", line 381, in _parse_requirements
"git", url.url, reference=pair.get("rev")
File "/usr/local/lib/python2.7/site-packages/poetry/puzzle/provider.py", line 204, in get_package_from_vcs
package = cls.get_package_from_directory(tmp_dir, name=name)
File "/usr/local/lib/python2.7/site-packages/poetry/puzzle/provider.py", line 345, in get_package_from_directory
directory

Reading other issues, I can see some comments about installing setuptools, to allow parsing. This doesn't seem to help.
Reference: #673 (comment)

Another one mention changing the setup.py to use setuptools. Is this the only potential solution I could try?
Reference: #835 (comment)

I tried with python 3.7.4 (with poetry add -vvv ...), and got another error:

[AttributeError]
'NoneType' object has no attribute 'group'

Not sure what this one is all about. Doesn't even seems related to this issue... Indeed, removing the -vvv argument (using poetry add ...) seems to work ?! Therefore, ignoring the NoneType error, it seems to be related to the python version.
Is this then related to #661?

Feel free to close if this is a duplicate issue of the above

@leibowitz leibowitz added the kind/bug Something isn't working as expected label Mar 11, 2020
@finswimmer
Copy link
Member

Hello @leibowitz,

the issue is the same as explained in #673. poetry itself is running with python2. There there is no support for parsing the setup.py, which is necessary to receive the version number.

The only chance to get it work is to make sure poetry runs with python3.

fin swimmer

@leibowitz
Copy link
Author

Did you mean it is a duplicate of #661?

@cyberbudy
Copy link

Have the same issue while installing this package https://github.com/preusx/python-chain-caller
Tried the last stable and prerelease versions

@finswimmer
Copy link
Member

@cyberbudy this work for me with no problems with the latest pre-release (1.1.0b2)

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
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants