Skip to content

Commit

Permalink
Merge pull request #174 from asmeurer/slotscheck
Browse files Browse the repository at this point in the history
Run slotscheck on CI
  • Loading branch information
asmeurer authored May 5, 2024
2 parents 901d1f3 + b9eb459 commit f43801a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,23 @@ jobs:
run: |
set -x
set -e
python -m pip install pyflakes pytest pytest-doctestplus hypothesis pytest-cov pytest-flakes packaging
python -m pip install -r requirements-dev.txt
if [[ ${{ matrix.numpy-version }} == 'latest' ]]; then
python -m pip install --upgrade numpy
elif [[ ${{ matrix.numpy-version }} == 'dev' ]]; then
python -m pip install --pre --upgrade --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
else
python -m pip install --upgrade numpy==${{ matrix.numpy-version }}.*
fi
- name: Run Doctests
run: |
./run_doctests
- name: Test Installation
run: |
python -m pip install .
- name: Run Slotscheck
run: |
python -m slotscheck ndindex
# Enable experimental faster sys.monitoring coverage for Python 3.12
- name: Set COVERAGE_CORE=sysmon
run: echo "COVERAGE_CORE=sysmon" >> $GITHUB_ENV
Expand All @@ -42,9 +51,6 @@ jobs:
# The coverage requirement check is done by the coverage report line below
PYTEST_FLAGS="$PYTEST_FLAGS -v --cov-fail-under=0";
pytest $PYTEST_FLAGS
./run_doctests
# Make sure it installs
pip install .
# Coverage. This also sets the failing status if the
# coverage is not 100%. Travis sometimes cuts off the last command, which is
# why we print stuff at the end.
Expand Down
4 changes: 0 additions & 4 deletions ndindex/shapetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class BroadcastError(ValueError):
compatible.
"""
__slots__ = ("arg1", "shape1", "arg2", "shape2")

def __init__(self, arg1, shape1, arg2, shape2):
self.arg1 = arg1
self.shape1 = shape1
Expand All @@ -33,8 +31,6 @@ class AxisError(ValueError, IndexError):
`iter_indices` does not need to depend on NumPy.
"""
__slots__ = ("axis", "ndim")

def __init__(self, axis, ndim):
# NumPy allows axis=-1 for 0-d arrays
if (ndim < 0 or -ndim <= axis < ndim) and not (ndim == 0 and axis == -1):
Expand Down
1 change: 1 addition & 0 deletions ndindex/tests/test_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def test_integer_reduce_exhaustive():
assert reduced.reduce(**kwargs) == reduced
assert reduced.reduce(10, **kwargs) == reduced

@example(0, (1,), {'negative_int': True})
@given(ints(), shapes, reduce_kwargs)
def test_integer_reduce_hypothesis(i, shape, kwargs):
a = arange(prod(shape)).reshape(shape)
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ pytest
pytest-cov
pytest-doctestplus
pytest-flakes
slotscheck

0 comments on commit f43801a

Please sign in to comment.