Repository navigation
Make external compiler discovery lazy in the test suite. #8661
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
Merged
sklam
merged 3 commits into
numba:main
from
stuartarchibald:wip/lazy_aot_compiler_check
Jan 11, 2023
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,10 +15,10 @@ | |
| from numba.core import utils | ||
| from numba.pycc.decorators import clear_export_registry | ||
| from numba.pycc.platform import find_shared_ending, find_pyext_ending | ||
| from numba.pycc.platform import _external_compiler_ok | ||
| from numba.pycc.platform import external_compiler_works | ||
|
|
||
| from numba.tests.support import (TestCase, tag, import_dynamic, temp_directory, | ||
| has_blas, needs_external_compilers) | ||
| has_blas) | ||
| import unittest | ||
|
|
||
|
|
||
|
|
@@ -48,12 +48,12 @@ class TestCompilerChecks(TestCase): | |
| @_windows_only | ||
| def test_windows_compiler_validity(self): | ||
| # When inside conda-build VSINSTALLDIR should be set and windows should | ||
| # have a valid compiler available, `_external_compiler_ok` should agree | ||
| # with this. If this is not the case then error out to alert devs. | ||
| # have a valid compiler available, `external_compiler_works()` should | ||
| # agree with this. If this is not the case then error out to alert devs. | ||
| is_running_conda_build = os.environ.get('CONDA_BUILD', None) is not None | ||
| if is_running_conda_build: | ||
| if os.environ.get('VSINSTALLDIR', None) is not None: | ||
| self.assertTrue(_external_compiler_ok) | ||
| self.assertTrue(external_compiler_works()) | ||
|
|
||
|
|
||
| class BasePYCCTest(TestCase): | ||
|
|
@@ -84,11 +84,11 @@ def check_c_ext(self, extdir, name): | |
| sys.modules.pop(name, None) | ||
|
|
||
|
|
||
| @needs_external_compilers | ||
| class TestCC(BasePYCCTest): | ||
|
|
||
| def setUp(self): | ||
| super(TestCC, self).setUp() | ||
| self.skip_if_no_external_compiler() # external compiler needed | ||
| from numba.tests import compile_with_pycc | ||
| self._test_module = compile_with_pycc | ||
| imp.reload(self._test_module) | ||
|
|
@@ -259,10 +259,13 @@ def test_c_extension_usecase(self): | |
| self.assertPreciseEqual(got, expect) | ||
|
|
||
|
|
||
| @needs_external_compilers | ||
| class TestDistutilsSupport(TestCase): | ||
|
|
||
|
|
||
| def setUp(self): | ||
| super().setUp() | ||
| self.skip_if_no_external_compiler() # external compiler needed | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just checked whether it's OK to call |
||
|
|
||
| unset_macosx_deployment_target() | ||
|
|
||
| # Copy the test project into a temp directory to avoid | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
empty line
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.
Thanks, fixed in 8e43a67.