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

Can not calculate version #28

Closed
jaraco opened this issue Nov 12, 2014 · 7 comments
Closed

Can not calculate version #28

jaraco opened this issue Nov 12, 2014 · 7 comments
Labels

Comments

@jaraco
Copy link
Owner

jaraco commented Nov 12, 2014

Originally reported by: Renier de Bruyn (BitBucket: renierdbruyn, GitHub: renierdbruyn)


hgtools seems to break packages, when I try to install it trough pip i.e. pip install https://github.com/renierdbruyn/calendra/tarball/master#calendra or directly from your repo e.g. pip install https://github.com/jaraco/calendra/tarball/master

I got it to install by doing: pip install git+git://github.com/renierdbruyn/calendra.git@master#egg=calendra but this resets the version to 0.0.0 Why is this?

repo in question can be found here

The stack trace:

Traceback (most recent call last):
  File "setup.py", line 61, in <module>
    setuptools.setup(**params)
  File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "/home/renierdebruyn/calendra/local/lib/python2.7/site-packages/setuptools/dist.py", line 264, in __init__
    _Distribution.__init__(self,attrs)
  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/home/renierdebruyn/calendra/local/lib/python2.7/site-packages/setuptools/dist.py", line 298, in finalize_options
    ep.load()(self, ep.name, value)
  File "build/bdist.linux-x86_64/egg/hgtools/plugins.py", line 113, in version_calc
  File "build/bdist.linux-x86_64/egg/hgtools/plugins.py", line 94, in calculate_version
  File "build/bdist.linux-x86_64/egg/hgtools/managers/base.py", line 41, in get_first_valid_manager
StopIteration

Am I doing something wrong?


@jaraco
Copy link
Owner Author

jaraco commented Nov 12, 2014

Original comment by: Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco)


The StopIteration means that no hgtools Manager class was found that was suitable. Because you're doing a git checkout, that probably means that you don't have a late version of Git installed or in the path. hgtools 6.1 requires Git 1.7.10 or later. Older versions of hgtools probably won't help because they didn't work properly with Git for listing tags.

@jaraco
Copy link
Owner Author

jaraco commented Jan 12, 2015

Original comment by: Gustavo Picon (BitBucket: tabo, GitHub: tabo)


I'm affected by this issue too, and I do have git installed. The problem seems to be that hgtools is using setuptools' version parsing to compare version numbers, and this is what happens:

#!

>>> from pkg_resources import SetuptoolsVersion, SetuptoolsLegacyVersion
>>> SetuptoolsLegacyVersion('1.9.3 (Apple Git-50)') > SetuptoolsVersion('1.7.10')
False

So even while I have git 1.9.3 installed, hgtools discards it as if it was older than 1.7.10.

(The StopIteration exception could also be a little friendlier :)

@jaraco
Copy link
Owner Author

jaraco commented Jan 12, 2015

Original comment by: Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco)


@tabo The issue you're getting here I think is subtly different. SetuptoolsLegacyVersion was only very recently introduced in Setuptools 8, so hgtools probably needs to be updated to support that. I agreed the StopIteration is a poor experience.

@jaraco
Copy link
Owner Author

jaraco commented Jan 12, 2015

Original comment by: Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco)


Provide more information when the StopIteration happens. Ref #28.

@jaraco
Copy link
Owner Author

jaraco commented Jan 12, 2015

Original comment by: Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco)


Adapt parsing of git version output. Fixes failing test and fixes #28.

@jaraco
Copy link
Owner Author

jaraco commented Jan 12, 2015

Original comment by: Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco)


Add test capturing error on Mac OS X. Ref #28.

@jaraco
Copy link
Owner Author

jaraco commented Jan 12, 2015

Original comment by: Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco)


I've released the changes as 6.2. I believe with the improved error message, that's about as good as this issue will get, but if you have suggestions, please re-open or open another.

@jaraco jaraco added the bug label Jan 1, 2016
@jaraco jaraco closed this as completed Jan 1, 2016
jaraco added a commit that referenced this issue Feb 13, 2021
* Use `extend-ignore` in flake8 config

This option allows to add extra ignored rules to the default list
instead of replacing it.

The default exclusions are: E121, E123, E126, E226, E24, E704,
W503 and W504.

Fixes #28.

Refs:
* https://github.com/pypa/setuptools/pull/2486/files#r541943356
* https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-extend-ignore
*
https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-ignore

* Enable complexity limit. Fixes jaraco/skeleton#34.

* Replace pep517.build with build (#37)

* Replace pep517.build with build

Resolves #30

* Prefer simple usage

Co-authored-by: Jason R. Coombs <[email protected]>

* Use license_files instead of license_file in meta (#35)

Singular `license_file` is deprecated since wheel v0.32.0.

Refs:
* https://wheel.readthedocs.io/en/stable/news.html
* https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file

Co-authored-by: Jason R. Coombs <[email protected]>
jaraco added a commit that referenced this issue Jun 20, 2023
* Use `extend-ignore` in flake8 config

This option allows to add extra ignored rules to the default list
instead of replacing it.

The default exclusions are: E121, E123, E126, E226, E24, E704,
W503 and W504.

Fixes #28.

Refs:
* https://github.com/pypa/setuptools/pull/2486/files#r541943356
* https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-extend-ignore
*
https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-ignore

* Enable complexity limit. Fixes jaraco/skeleton#34.

* Replace pep517.build with build (#37)

* Replace pep517.build with build

Resolves #30

* Prefer simple usage

Co-authored-by: Jason R. Coombs <[email protected]>

* Use license_files instead of license_file in meta (#35)

Singular `license_file` is deprecated since wheel v0.32.0.

Refs:
* https://wheel.readthedocs.io/en/stable/news.html
* https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file

Co-authored-by: Jason R. Coombs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant