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 Cython compiled check in ipython #573
Conversation
Addresses the issue raised in pydantic#548 related to running non-compiled in IPython
@samuelcolvin Not sure why the build is failing. It says
in the build logs (https://app.netlify.com/sites/pydantic-docs/deploys/5cf5977b10a4b80009431880), but I don't understand how the change I made could have introduced this error. Also, the tests pass for me locally whether or not I have cython installed in the testing environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea why this fails, but it does. Both on travis and netlify.
wrap this in an AttributeError
try/except and add pragma: no cover
wherever required.
Please add an entry to history too.
Codecov Report
@@ Coverage Diff @@
## master #573 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 15 15
Lines 2508 2508
Branches 501 501
=====================================
Hits 2508 2508 |
…nstalled It's possible sometimes that 'import cython' does not fail but then 'cython.compiled' raises AttributeError. It actually happened in our internal production environment... So to check if cython library was actually installed we try to do `from cython import compiled`, which will raise ImportError if `compiled` variable is not present (it must be there for the 'real' cython, but sometimes a 'pretend' one sneaks in if sys.path has been messed with). Similar issue to pydantic/pydantic#573 and ipython/ipython#13294
…nstalled It's possible sometimes that 'import cython' does not fail but then 'cython.compiled' raises AttributeError. It actually happened in our internal production environment... Similar issue to pydantic/pydantic#573 and ipython/ipython#13294
Addresses the issue raised in #548 related to running non-compiled in IPython