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

EntryPoint's repr also fails with PyPy3 #102

Closed
jaraco opened this issue Oct 22, 2020 · 12 comments
Closed

EntryPoint's repr also fails with PyPy3 #102

jaraco opened this issue Oct 22, 2020 · 12 comments

Comments

@jaraco
Copy link
Member

jaraco commented Oct 22, 2020

In GitLab by @sbraz on Dec 2, 2019, 11:52

Hi,
I see that #97 applied only to PyPy2 but I see failures with PyPy3 (7.2.0) too. Changing the compatibility function to make it apply to all PyPy versions fixed it for me.

======================================================================
ERROR: test_repr (importlib_metadata.tests.test_main.TestEntryPoints)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/importlib_metadata-1.1.0/work/importlib_metadata-1.1.0/importlib_metadata/tests/test_main.py", line 211, in test_repr
    assert 'EntryPoint' in repr(self.ep)
  File "<string>", line 33, in __repr__
  File "<string>", line 33, in __repr__
  File "<string>", line 33, in __repr__
  [Previous line repeated 832 more times]
  File "/var/tmp/portage/dev-python/importlib_metadata-1.1.0/work/importlib_metadata-1.1.0/importlib_metadata/__init__.py", line 127, in __iter__
    return iter((self.name, self))
RecursionError: maximum recursion depth exceeded
@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @asottile on Dec 4, 2019, 17:11

mentioned in merge request !102

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @jaraco on Dec 4, 2019, 21:43

Interesting - I'm 90% sure I did test it on pypy3, probably a newer version than you tested.

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @asottile on Dec 4, 2019, 21:52

here was the failure before my PR above:

$ pypy3 --version
Python 3.6.9 (5da45ced70e5, Oct 09 2019, 19:12:54)
[PyPy 7.2.0 with GCC 6.2.0 20160901]
$ git checkout master 
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
$ tox -e pypy3
pypy3 develop-inst-noop: /tmp/importlib_metadata
pypy3 installed: cffi==1.13.0,greenlet==0.4.13,-e git+git@gitlab.com:python-devs/importlib_metadata@031c7f0e4994eea815b3101155f9f573d7d8f51e#egg=importlib_metadata,importlib-resources==1.0.2,more-itertools==8.0.0,packaging==19.2,pyparsing==2.4.5,readline==6.2.4.1,six==1.13.0,zipp==0.6.0
pypy3 run-test-pre: PYTHONHASHSEED='794755354'
pypy3 run-test: commands[0] | python -m unittest discover
.......................................E............
======================================================================
ERROR: test_repr (importlib_metadata.tests.test_main.TestEntryPoints)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/importlib_metadata/importlib_metadata/tests/test_main.py", line 211, in test_repr
    assert 'EntryPoint' in repr(self.ep)
  File "<string>", line 33, in __repr__
  File "<string>", line 33, in __repr__
  File "<string>", line 33, in __repr__
  [Previous line repeated 877 more times]
  File "/tmp/importlib_metadata/importlib_metadata/__init__.py", line 127, in __iter__
    return iter((self.name, self))
RecursionError: maximum recursion depth exceeded

----------------------------------------------------------------------
Ran 52 tests in 0.540s

FAILED (errors=1)
ERROR: InvocationError for command /tmp/importlib_metadata/.tox/pypy3/bin/python -m unittest discover (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   pypy3: commands failed

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @jaraco on Dec 4, 2019, 22:36

Hmm. Okay, I have an older version of pypy3.

importlib_metadata master $ tox -e pypy3                                                                                                                                  
pypy3 develop-inst-noop: /Users/jaraco/code/public/importlib_metadata
pypy3 installed: -e git+gl://python-devs/importlib_metadata@031c7f0e4994eea815b3101155f9f573d7d8f51e#egg=importlib_metadata,more-itertools==8.0.0,packaging==19.2,pyparsing==2.4.5,six==1.13.0,zipp==0.6.0
pypy3 run-test-pre: PYTHONHASHSEED='3575366809'
pypy3 run-test: commands[0] | python -m unittest discover
....................................................
----------------------------------------------------------------------
Ran 52 tests in 0.155s

OK
________________________________________________________________________________ summary _________________________________________________________________________________
  pypy3: commands succeeded
  congratulations :)

importlib_metadata master $ pypy3 -V                                                                                                                                      
Python 3.6.1 (784b254d669919c872a505b807db8462b6140973, Sep 06 2019, 16:56:28)
[PyPy 7.1.1-beta0 with GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.46.4)]

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @jaraco on Dec 4, 2019, 22:40

Weirdly, even on PyPy 7.2, I don't encounter the failure:

importlib_metadata master $ pypy3 -V                                                                                                                                      
Python 3.6.9 (5da45ced70e515f94686be0df47c59abd1348ebc, Nov 22 2019, 03:55:25)
[PyPy 7.2.0 with GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.33.12)]
$ tox -q -e pypy3 -- -q                                                                                                                         
----------------------------------------------------------------------
Ran 52 tests in 0.150s

OK
________________________________________________________________________________ summary _________________________________________________________________________________
  pypy3: commands succeeded
  congratulations :)

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @asottile on Dec 4, 2019, 22:46

try with tox -r?

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @jaraco on Dec 4, 2019, 23:03

Same with -r. Previously, it had detected the need to "recreate" when I upgraded pypy3, so had already done that. It's not crucial that I replicate it, though it is interesting that the issue isn't happening for me. I felt better about the compatibility shim when it was only for select, older interpreters, but when it's happening with the ongoing releases of PyPy3, that's more severe.

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @jaraco on Dec 4, 2019, 23:16

mentioned in commit 37659f8

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @jaraco on Dec 4, 2019, 23:16

closed via merge request !102

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @jaraco on Dec 4, 2019, 23:17

Fix released as v1.1.1.

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @asottile on Dec 4, 2019, 23:18

hmmmm weird! seems odd that it would be platform dependent 🤔

@jaraco
Copy link
Member Author

jaraco commented Oct 22, 2020

In GitLab by @sbraz on Dec 4, 2019, 23:19

FWIW I tested on Archlinux (PyPy 7.2.0 too) instead of Gentoo and I was still running into that recursion error:

$ pypy3 -c "from importlib_metadata import EntryPoint; repr(EntryPoint('a', 'b', None))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 33, in __repr__
  File "<string>", line 33, in __repr__
  File "<string>", line 33, in __repr__
  [Previous line repeated 812 more times]
  File "/tmp/importlib_metadata/importlib_metadata/__init__.py", line 127, in __iter__
    return iter((self.name, self))
RecursionError: maximum recursion depth exceeded

Thanks for the fix!

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