-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: add test-pypi * ci: sybil doctests * ci: add ruff ignores * docs: fix numpy version-dependent string Signed-off-by: nstarman <[email protected]>
- Loading branch information
Showing
4 changed files
with
81 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Doctest configuration.""" | ||
|
||
import platform | ||
from doctest import ELLIPSIS, NORMALIZE_WHITESPACE | ||
from importlib.util import find_spec | ||
|
||
from sybil import Sybil | ||
from sybil.parsers.rest import DocTestParser, PythonCodeBlockParser, SkipParser | ||
|
||
# TODO: stop skipping doctests on Windows when there is uniform support for | ||
# numpy 2.0+ scalar repr. On windows it is printed as 1.0 instead of | ||
# `np.float64(1.0)`. | ||
parsers = ( | ||
[DocTestParser(optionflags=ELLIPSIS | NORMALIZE_WHITESPACE)] | ||
if platform.system() != "Windows" | ||
else [] | ||
) + [ | ||
PythonCodeBlockParser(), | ||
SkipParser(), | ||
] | ||
|
||
pytest_collect_file = Sybil( | ||
parsers=parsers, | ||
patterns=["*.rst", "*.py"], | ||
).pytest() | ||
|
||
|
||
# TODO: via separate optional_deps package | ||
HAS_ASTROPY = find_spec("astropy") is not None | ||
HAS_GALA = find_spec("gala") is not None | ||
|
||
collect_ignore_glob = [] | ||
if not HAS_ASTROPY: | ||
collect_ignore_glob.append("src/unxt/_interop/unxt_interop_astropy/*") | ||
if not HAS_GALA: | ||
collect_ignore_glob.append("src/unxt/_interop/unxt_interop_gala/*") |
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