Skip to content

Error message confusing if a tag is missing #3

@miohtama

Description

@miohtama

If a tag is missing from a Git repo and you try to install a package with version_info, the error message is little bit confusing. Expected result: Say a git tag is missing. Now you get:

[~/code/xxx/xxx-frontend]% pip install -e .
Obtaining file:///Users/mikko/code/xxx/xxx-frontend
    Complete output from command python setup.py egg_info:
    zip_safe flag not set; analyzing archive contents...

    Installed /Users/mikko/code/xxx/xxx-frontend/.eggs/setuptools_git_version-1.0.3-py3.5.egg
    fatal: No names found, cannot describe anything.
    Traceback (most recent call last):
      File "/Users/mikko/code/xxx/xxx-frontend/.eggs/setuptools_git_version-1.0.3-py3.5.egg/setuptools_git_version.py", line 10, in validate_version_format
      File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 629, in check_output
        **kwargs).stdout
      File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/subprocess.py", line 711, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['git', 'describe', '--tags', '--long', '--dirty']' returned non-zero exit status 128

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/mikko/code/xxx/xxx-frontend/setup.py", line 35, in <module>
        'setuptools >= 8.0',
      File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/mikko/code/xxx/venv/lib/python3.5/site-packages/setuptools/dist.py", line 272, in __init__
        _Distribution.__init__(self,attrs)
      File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 281, in __init__
        self.finalize_options()
      File "/Users/mikko/code/xxx/venv/lib/python3.5/site-packages/setuptools/dist.py", line 327, in finalize_options
        ep.load()(self, ep.name, value)
      File "/Users/mikko/code/xxx/xxx-frontend/.eggs/setuptools_git_version-1.0.3-py3.5.egg/setuptools_git_version.py", line 12, in validate_version_format
      File "/Users/mikko/code/xxx/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 551, in get_distribution
        dist = get_provider(dist)
      File "/Users/mikko/code/xxx/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 431, in get_provider
        return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
      File "/Users/mikko/code/xxx/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 952, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/Users/mikko/code/xxx/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 839, in resolve
        raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'xxx-frontend' distribution was not found and is required by the application

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /Users/mikko/code/xxx/xxx-frontend/
[venv][master]                                                                                                                  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions