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

Exception handling doesn't work if the package isn't installed #8

Open
chrko opened this issue Feb 20, 2017 · 0 comments
Open

Exception handling doesn't work if the package isn't installed #8

chrko opened this issue Feb 20, 2017 · 0 comments

Comments

@chrko
Copy link

chrko commented Feb 20, 2017

Hi,

there is an error in the exception handling if the package isn't installed:

version = get_distribution(dist.get_name()).version

I have a setup where I don't transfer the git history to a remote machine, but I need to run the python code itself there.
A simple pip install -e . is failing with

(env)pi@pi:~/christian-dev/proj/src$ pip install -e .
Obtaining file:///home/pi/christian-dev/proj/src
    Complete output from command python setup.py egg_info:
    fatal: Not a git repository (or any of the parent directories): .git
    Traceback (most recent call last):
      File "/home/pi/christian-dev/env/lib/python3.4/site-packages/setuptools_git_version.py", line 11, in validate_version_format
        version = check_output(command.split()).decode('utf-8').strip()
      File "/usr/lib/python3.4/subprocess.py", line 620, in check_output
        raise CalledProcessError(retcode, process.args, output=output)
    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 "/home/pi/christian-dev/proj/src/setup.py", line 14, in <module>
        'pytest'
      File "/usr/lib/python3.4/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/pi/christian-dev/env/lib/python3.4/site-packages/setuptools/dist.py", line 320, in __init__
        _Distribution.__init__(self, attrs)
      File "/usr/lib/python3.4/distutils/dist.py", line 280, in __init__
        self.finalize_options()
      File "/home/pi/christian-dev/env/lib/python3.4/site-packages/setuptools/dist.py", line 387, in finalize_options
        ep.load()(self, ep.name, value)
      File "/home/pi/christian-dev/env/lib/python3.4/site-packages/setuptools_git_version.py", line 13, in validate_version_format
        version = get_distribution(dist.get_name()).version
      File "/home/pi/christian-dev/env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 552, in get_distribution
        dist = get_provider(dist)
      File "/home/pi/christian-dev/env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 426, in get_provider
        return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
      File "/home/pi/christian-dev/env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 968, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/home/pi/christian-dev/env/lib/python3.4/site-packages/pkg_resources/__init__.py", line 854, in resolve
        raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'proj' distribution was not found and is required by the application

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /home/pi/christian-dev/proj/src/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant