Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit is the next in a commit chain improving our GitHub Actions-based continuous integration (CI) configuration to install optional test-time dependencies. Specifically, this commit attempts to circumvent installation woes induced by Apple's patently broken "Accelerate" BLAS replacement (as documented at numpy/numpy#15947) by conditionally avoiding installation of `pip` packages built against "Accelerate" under PyPy. Whereas forcing `pip` to reinstall these packages with `--force-reinstall` succeeds under CPython, the same approach fails to improve matters under PyPy for unknown reasons. We are short on sanity and even shorter on time, so the only remaining option is to nuke these packages from orbit under macOS + PyPy -- which is such an outlier edge-case to begin with that it seems doubtful anyone will care. We care, of course. But you can only do so much when your core platform is fundamentally broken. Thanks, Apple. (*Drip-fed metalhead!*)
- Loading branch information
Showing
10 changed files
with
140 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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 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
Empty file.
This file contains 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
# --------------------( LICENSE )-------------------- | ||
# Copyright (c) 2014-2021 Beartype authors. | ||
# See "LICENSE" for further details. | ||
|
||
''' | ||
Project-wide **platform tester** (i.e., functions detecting the current | ||
platform the active Python interpreter is running under) utilities. | ||
This private submodule is *not* intended for importation by downstream callers. | ||
''' | ||
|
||
# ....................{ IMPORTS }.................... | ||
from beartype._util.cache.utilcachecall import callable_cached | ||
from platform import system | ||
|
||
# See the "beartype.cave" submodule for further commentary. | ||
__all__ = ['STAR_IMPORTS_CONSIDERED_HARMFUL'] | ||
|
||
# ....................{ TESTERS }.................... | ||
@callable_cached | ||
def is_os_macos() -> bool: | ||
''' | ||
``True`` only if the current platform is **Apple macOS**, the operating | ||
system previously known as "OS X." | ||
This tester is memoized for efficiency. | ||
''' | ||
|
||
return system() == 'Darwin' |
This file contains 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 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
Empty file.
This file contains 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
# --------------------( LICENSE )-------------------- | ||
# Copyright (c) 2014-2021 Beartype authors. | ||
# See "LICENSE" for further details. | ||
|
||
''' | ||
Project-wide **platform tester** unit tests. | ||
This submodule unit tests the public API of the private | ||
:mod:`beartype._util.os.utilostest` submodule. | ||
''' | ||
|
||
# ....................{ IMPORTS }.................... | ||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
# WARNING: To raise human-readable test errors, avoid importing from | ||
# package-specific submodules at module scope. | ||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
# ....................{ TESTS ~ tester }.................... | ||
def test_is_os_macos() -> None: | ||
''' | ||
Test the :func:`beartype._util.os.utilostest.is_os_macos` tester. | ||
''' | ||
|
||
# Defer heavyweight imports. | ||
from beartype._util.os.utilostest import is_os_macos | ||
|
||
# Assert this tester returns a boolean. | ||
IS_OS_MACOS = is_os_macos() | ||
assert isinstance(IS_OS_MACOS, bool) |
30 changes: 30 additions & 0 deletions
30
beartype_test/a00_unit/a00_util/py/test_utilpyinterpreter.py
This file contains 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
# --------------------( LICENSE )-------------------- | ||
# Copyright (c) 2014-2021 Beartype authors. | ||
# See "LICENSE" for further details. | ||
|
||
''' | ||
Project-wide **Python interpreter** unit tests. | ||
This submodule unit tests the public API of the private | ||
:mod:`beartype._util.py.utilpyinterpreter` submodule. | ||
''' | ||
|
||
# ....................{ IMPORTS }.................... | ||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
# WARNING: To raise human-readable test errors, avoid importing from | ||
# package-specific submodules at module scope. | ||
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
# ....................{ TESTS ~ tester }.................... | ||
def test_is_py_pypy() -> None: | ||
''' | ||
Test the :func:`beartype._util.py.utilpyinterpreter.is_py_pypy` tester. | ||
''' | ||
|
||
# Defer heavyweight imports. | ||
from beartype._util.py.utilpyinterpreter import is_py_pypy | ||
|
||
# Assert this tester returns a boolean. | ||
IS_PY_PYPY = is_py_pypy() | ||
assert isinstance(IS_PY_PYPY, bool) |
This file contains 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