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

[FIX] errorreporting: Remove use of pip internal api #2724

Merged
merged 2 commits into from
Oct 30, 2017

Conversation

ales-erjavec
Copy link
Contributor

@ales-erjavec ales-erjavec commented Oct 30, 2017

Issue

Error reporting uses internal pip api, which will be moved in Pip 10.

Description of changes

Remove use of pip internal api

Includes
  • Code changes
  • Tests
  • Documentation

Pip 10 will move all internal APIs.
@codecov-io
Copy link

codecov-io commented Oct 30, 2017

Codecov Report

Merging #2724 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #2724      +/-   ##
==========================================
+ Coverage   76.03%   76.03%   +<.01%     
==========================================
  Files         338      338              
  Lines       59628    59628              
==========================================
+ Hits        45339    45341       +2     
+ Misses      14289    14287       -2

Copy link
Contributor

@jerneju jerneju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traceback (most recent call last):
  File "/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2459, in version
    return self._version
  File "/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2545, in __getattr__
    raise AttributeError(attr)
AttributeError: _version

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/orange3/Orange/canvas/application/errorreporting.py", line 245, in handle_exception
    return ErrorReporting.handle_exception(exc)
  File "/usr/lib/python3.5/unittest/mock.py", line 1157, in patched
    return func(*args, **keywargs)
  File "/orange3/Orange/canvas/application/errorreporting.py", line 195, in handle_exception
    for dist in pkg_resources.working_set))
  File "/orange3/Orange/canvas/application/errorreporting.py", line 195, in <genexpr>
    for dist in pkg_resources.working_set))
  File "/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2464, in version
    raise ValueError(tmpl % self.PKG_INFO, self)
ValueError: ("Missing 'Version:' header and/or PKG-INFO file", Orange [unknown version] (/orange3))
-------------------------------------------------------------------------------
Fatal Python error: Cannot recover from stack overflow.

@ales-erjavec
Copy link
Contributor Author

Which version of setuptools do you have installed (pip list --format=freeze | grep setuptools)

How was orange3 installed and what does /orange3/Orange3.egg-info/PKG-INFO contain

@jerneju
Copy link
Contributor

jerneju commented Oct 30, 2017

setuptools==36.5.0

PKG-INFO: Version: 3.8.0.dev0+cb8ab62

As documented accessing `version` can raise ValueError.
@ales-erjavec ales-erjavec changed the title errorreporting: Remove use of pip internal api [FIX] errorreporting: Remove use of pip internal api Oct 30, 2017
@ales-erjavec
Copy link
Contributor Author

I was unable to duplicate the error, but the error is part of the documented Distribution.version behavior.

Copy link
Contributor

@jerneju jerneju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it does not crash and a list of installed packages with their versions is sent to the server.

@kernc kernc merged commit 9b36a1a into biolab:master Oct 30, 2017
@ales-erjavec ales-erjavec deleted the remove-pip-internal-api branch November 14, 2017 08:51
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

Successfully merging this pull request may close these issues.

4 participants