-
Notifications
You must be signed in to change notification settings - Fork 129
Fix import errors if setuptools is too old #483
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
Conversation
@@ -1,4 +1,7 @@ | |||
from setuptools.errors import CompileError as BaseCompileError | |||
try: |
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.
Can you add a comment?
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.
I want to instead add a warning here. I'm tracking down the various relevant setuptools versions to cite.
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.
@ferrine, @twiecki, I added a warning. Does this look helpful?
In [1]: import pytensor
~/repos/pytensor/pytensor/link/c/exceptions.py:14: UserWarning: You appear to be using an ancient
version of setuptools: v57.4.0. Please upgrade to at least v59.0.0. Support for this version of
setuptools is provisionary and may be removed without warning in the future.
warnings.warn(
In [2]:
I'm not sure what the dangling warnings.warn(
is about, but I'm not sure we should care.
@ricardoV94, any idea what this error is about? FAILED tests/tensor/test_blockwise.py::TestMatrixInverse::test_grad - AssertionError:
Not equal to tolerance rtol=1e-07, atol=1e-05
Mismatched elements: 6 / 49 (12.2%)
Max absolute difference: 256.
Max relative difference: 1.1633778e-07
x: array([[[-7.521472e+06, -7.038032e+07, 7.009835e+07, 1.882100e+08,
8.302121e+07, 9.111284e+07, -2.939551e+07],
[-7.038031e+07, -6.585663e+08, 6.559279e+08, 1.761128e+09,...
y: array([[[-7.521472e+06, -7.038032e+07, 7.009834e+07, 1.882100e+08,
8.302120e+07, 9.111284e+07, -2.939550e+07],
[-7.038031e+07, -6.585663e+08, 6.559280e+08, 1.761128e+09,...
FAILED tests/tensor/test_blockwise.py::TestSolveMatrix::test_grad - AssertionError:
Not equal to tolerance rtol=1e-07, atol=1e-05
Mismatched elements: 3 / 245 (1.22%)
Max absolute difference: 6.1035156e-05
Max relative difference: 4.040853e-06
x: array([[[-2.208488e+00, 5.503439e+00, 1.240619e+01, -6.283111e+00,
1.377477e+01, 1.137324e+01, 2.236404e+00],
[ 1.198226e+00, -2.985918e+00, -6.731038e+00, 3.408931e+00,...
y: array([[[-2.208488e+00, 5.503440e+00, 1.240619e+01, -6.283111e+00,
1.377477e+01, 1.137324e+01, 2.236404e+00],
[ 1.198226e+00, -2.985918e+00, -6.731038e+00, 3.408931e+00,...
= 2 failed, 2295 passed, 9 skipped, 2 xfailed, 80 xpassed, 15 warnings in 748.25s (0:12:28) =
Error: Process completed with exit code 1. I can't imagine that this was caused by anything in this PR. Also, this PR does what I want, but I feel it's very inelegant. Any suggestions? |
Yeah that test is flaky on float32, some operations that are not actually deterministic on some machines. Feel free to ignore. Regarding the hoops, you can just type ignore it ;) If mypy is dumb why should we make our code worse for it? |
Ya, thanks. I was tying myself in knots trying to satisfy both mypy and Pyright. I think I have a good solution now. |
fix #481 when setuptools is too old