Skip to content
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

Add a pre-release CI job #152

Merged
merged 4 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
python-version: ['3.10', '3.11']
os: [ubuntu-latest]
pytest: ['"pytest<8.0"', pytest]
pre: ['', '--pre']

steps:
# actions/setup-python@v5 has built-in functionality for caching and restoring dependencies.
Expand All @@ -32,8 +33,13 @@ jobs:
- name: Install core dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ${{matrix.pytest}}
python -m pip install -e .
python -m pip install ${{matrix.pytest}} ${{matrix.pre}}
python -m pip install -e . ${{matrix.pre}}

- name: Echo versions
run: |
python -m pytest --version
python -c"import numpy; print(f'{numpy.__version__ = }')"

# Run self-tests without Scipy and MPL
# Tests that require Scipy and MPL will be skipped
Expand Down Expand Up @@ -61,7 +67,7 @@ jobs:

- name: Test testfile CLI
run: |
python -m scpdt ./scpdt/tests/scipy_linalg_tutorial_clone.rst -v
python -m scpdt ./scpdt/tests/scipy_ndimage_tutorial_clone.rst -v

- name: Run testmod a scipy submodule
run: |
Expand Down
14 changes: 10 additions & 4 deletions scpdt/tests/module_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
'func7', 'manip_printoptions', 'array_abbreviation'
]

import numpy as np
import pytest

def func():
"""
>>> 2 / 3
Expand Down Expand Up @@ -171,16 +174,19 @@ def nan_equal():
>>> import numpy as np
>>> np.nan
np.float64(nan)
"""


def test_cmplx_nan():
"""
Complex nans
>>> import numpy as np
>>> np.nan - 1j*np.nan
nan + nanj

>>> np.nan + 1j*np.nan
np.complex128(nan+nanj)

Throw in infs, for a good measure
>>> np.inf + 1j*np.inf
inf + infj

>>> 1j*np.complex128(np.nan)
np.complex128(nan+nanj)
"""
Loading