-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Numpy 2.0 + scipy + matplotlib pre-release workflow (#89)
* pin pytest to 8.0 and above * move conftest.py to root and turn warnings into errors * add workflow testing against numpy 2.0 * skip coverage * fix config file used * also install pip-pre scipy and matplotlib * scikit-learn also for nilearn compatibility with numpy 2.0 * don't run nilearn tests on pip-pre * run 3.9 and 3.12 on circle and 3.7 compat on gh * fix workflow name * fix: importorskip is not a mark decorator * catch user warning * fix deprecated readfp * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * ignore conftest in module discovery * fix uninstall step of nilearn * try again to rm nilearn * fix module discovery logic * fix numpy deprecation of np.NINF and np.trapz * fix missed importorskip("nilearn") * fix deprecation of find_module in module discovery logic * fix compatibility trapz <-> trapezoid * fix compatibility function * add missed pytest.importorskip("nilearn") * fix imports, drop pkg_utils entirely * fix missed imports * rm unused variable * use relative imports and fix circular import and namespace * revert version import * close log file handler * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix missed importorskip("nilearn") * fix codecov yml * suppress sphinx gallery warning * mv trapezoid_compat * trigger ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
cb99342
commit 3a8bd18
Showing
20 changed files
with
230 additions
and
93 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,84 @@ | ||
name: pytest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }} | ||
cancel-in-progress: true | ||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 8 * * 1' | ||
|
||
jobs: | ||
pytest-compat: | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7"] | ||
name: pip compat - py${{ matrix.python-version }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: 'x64' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools | ||
python -m pip install --progress-bar off .[all,style] | ||
python -m pip install --progress-bar off pytest pytest-cov coverage | ||
- name: Run pytest | ||
run: pytest nigsp --cov=nigsp --cov-report=xml --cov-config=setup.cfg | ||
- name: Upload to codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./coverage.xml | ||
flags: unittests # optional | ||
name: codecov-umbrella # optional | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true # optional (default = false) | ||
pytest-pip-pre: | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.11"] | ||
name: pip pre-release - py${{ matrix.python-version }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: 'x64' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools | ||
python -m pip install --progress-bar off .[test] | ||
python -m pip install matplotlib | ||
python -m pip install --progress-bar off --upgrade --no-deps --pre --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --timeout=180 matplotlib | ||
python -m pip install --progress-bar off --upgrade --pre --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --timeout=180 numpy scipy | ||
python -m pip uninstall -y nilearn | ||
- name: Run pytest | ||
run: pytest nigsp --cov=nigsp --cov-report=xml --cov-config=setup.cfg | ||
- name: Upload to codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./coverage.xml | ||
flags: unittests # optional | ||
name: codecov-umbrella # optional | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true # optional (default = false) |
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
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 |
---|---|---|
@@ -1,18 +1,16 @@ | ||
"""Hopefully importing everything.""" | ||
|
||
import pkgutil | ||
|
||
from . import ( | ||
blocks, | ||
cli, | ||
due, | ||
io, | ||
objects, | ||
operations, | ||
references, | ||
utils, | ||
viz, | ||
workflow, | ||
) | ||
from ._version import get_versions | ||
from .operations import graph, laplacian, metrics, nifti, surrogates, timeseries | ||
|
||
SKIP_MODULES = ["tests"] | ||
|
||
__version__ = get_versions()["version"] | ||
del get_versions | ||
|
||
__all__ = [] | ||
for loader, module_name, is_pkg in pkgutil.walk_packages(__path__): | ||
if "tests" not in module_name: | ||
__all__.append(module_name) | ||
_module = loader.find_module(module_name).load_module(module_name) | ||
globals()[module_name] = _module |
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
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
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
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
Oops, something went wrong.