-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Make tests pass on conda builds #151
Conversation
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.
Hmm, will these get distributed to users? Maybe it would be cleaner to inline into test_typing_extensions and exec?
Could do! We already have What about creating an |
We definitely should make it so these files don't get put into people's site-packages on installation. I think I prefer inlining the files into test_typing_extensions so we don't have to deal with the complexity of distributing the additional files. |
@classmethod | ||
def setUpClass(cls): | ||
with tempfile.TemporaryDirectory() as tempdir: | ||
sys.path.append(tempdir) | ||
Path(tempdir, "ann_module.py").write_text(ANN_MODULE_SOURCE) | ||
Path(tempdir, "ann_module2.py").write_text(ANN_MODULE_2_SOURCE) | ||
Path(tempdir, "ann_module3.py").write_text(ANN_MODULE_3_SOURCE) | ||
cls.ann_module = importlib.import_module("ann_module") | ||
cls.ann_module2 = importlib.import_module("ann_module2") | ||
cls.ann_module3 = importlib.import_module("ann_module3") |
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.
There may be a simpler way of doing this, but I couldn't immediately figure it out
The test suite doesn't currently pass on conda builds of Python. This is somewhat annoying for me personally, as I generally use conda when I want to use an older version of Python, and testing on older versions of Python is pretty important for
typing_extensions
:)The main reason why the tests fail on conda is that conda debundles the
test
package from the standard library. This PR just vendorstest.ann_module
,test.ann_module2
andtest.ann_module3
from the CPythonmain
branch (and renames them as_ann_module
,_ann_module2
, and_ann_module3
). This is probably a good thing to do anyway; theLib/test
directory is sort of an implementation detail of CPython's internal test suite.There was also an
Any
test that was failing on Python <3.11 due to the module of a nested class being__main__
instead oftyping_extensions
. I'm not sure why this is different on conda, but it doesn't seem that big a deal to just change the test here.