Skip to content

Commit

Permalink
Changes to github actions, mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
cgevans committed Aug 1, 2023
1 parent d9ebd7e commit 4c07f8b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 10 deletions.
48 changes: 41 additions & 7 deletions .github/workflows/python-package.yml
Expand Up @@ -13,24 +13,24 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", pypy3]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.10"]
optionals: [none, pandas, numba]
exclude:
- python-version: pypy3
- python-version: "pypy3.10"
optionals: pandas
- python-version: pypy3
- python-version: "pypy3.10"
optionals: numba
- python-version: "3.11"
optionals: numba
- os: macos-latest
python-version: pypy3
python-version: "pypy3.10"
- os: windows-latest
python-version: pypy3
python-version: "pypy3.10"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -50,3 +50,37 @@ jobs:
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false

mypy:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
- python-version: 3.7
extra-args: "--no-warn-unused-ignores"
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools_scm[toml] wheel setuptools
python -m pip install numpy pandas flake8 tox mypy
- name: Mypy
run: |
mypy --cache-dir .mypy_cache --install-types ${{ matrix.extra-args }} --non-interactive --strict --allow-untyped-calls --ignore-missing-imports --non-interactive ./src
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
with:
options: "--check --verbose --diff"
src: "./src"

1 change: 0 additions & 1 deletion pyproject.toml
Expand Up @@ -8,7 +8,6 @@ ignore = ["F405", "F403"]

[tool.mypy]
ignore_missing_imports = true
warn_unused_configs = true
warn_return_any = true

[tool.black]
Expand Down
4 changes: 2 additions & 2 deletions src/scikits/bootstrap/bootstrap.py
Expand Up @@ -452,9 +452,9 @@ def ci(
out = stat[(nvals, np.indices(nvals.shape)[1:].squeeze())]
elif output == "errorbar":
if nvals.ndim == 1:
out = np.abs(statfunction(*tdata) - stat[nvals])[np.newaxis].T # type: ignore
out = np.abs(statfunction(*tdata) - stat[nvals])[np.newaxis].T
else:
out = np.abs(statfunction(*tdata) - stat[(nvals, np.indices(nvals.shape)[1:])]).T.squeeze() # type: ignore
out = np.abs(statfunction(*tdata) - stat[(nvals, np.indices(nvals.shape)[1:])]).T.squeeze()
else:
raise ValueError("Output option {0} is not supported.".format(output))

Expand Down

0 comments on commit 4c07f8b

Please sign in to comment.