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 typing to tests #168

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d60c459
Type test_xarray.py
Illviljan Oct 9, 2022
6d22bb0
Fix typing
Illviljan Oct 9, 2022
42826a8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 9, 2022
91a5bd2
Add type hints to test_core.py
Illviljan Oct 9, 2022
203adb0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 9, 2022
492963a
Update test_core.py
Illviljan Oct 9, 2022
5631eb0
Merge branch 'add_typing_to_tests' of https://github.com/Illviljan/fl…
Illviljan Oct 9, 2022
071c869
Update test_core.py
Illviljan Oct 9, 2022
c7916aa
Merge remote-tracking branch 'upstream/main' into add_typing_to_tests
Illviljan Oct 11, 2022
5b8c5af
Merge remote-tracking branch 'upstream/main' into add_typing_to_tests
Illviljan Oct 14, 2022
4e9db60
Don't add type hints to kwargs for readability
Illviljan Nov 5, 2022
17b2243
Merge remote-tracking branch 'upstream/main' into add_typing_to_tests
Illviljan Nov 5, 2022
4b134fc
fix merge errors
Illviljan Nov 5, 2022
af5c912
Update test_core.py
Illviljan Nov 5, 2022
6656b7f
Update test_core.py
Illviljan Nov 5, 2022
51f448c
Update test_core.py
Illviljan Nov 5, 2022
83e3cec
Update mypy ci
Illviljan Nov 5, 2022
1698ed2
Update ci-additional.yaml
Illviljan Nov 5, 2022
87c8116
Update ci-additional.yaml
Illviljan Nov 5, 2022
7d619ea
Move tests to /flox so mypy finds it
Illviljan Nov 5, 2022
6117bc2
Update ci-additional.yaml
Illviljan Nov 5, 2022
391c7b5
include more files
Illviljan Nov 5, 2022
90bf14f
move back tests
Illviljan Nov 5, 2022
3bab2f0
Revert "move back tests"
Illviljan Nov 5, 2022
3e48319
fix type errors
Illviljan Nov 5, 2022
797a50e
numba numpy_groupies to ignore
Illviljan Nov 5, 2022
3026276
Update test_core.py
Illviljan Nov 5, 2022
d382393
move engine fixture to conftest
Illviljan Nov 5, 2022
8a52b4f
Update test_xarray.py
Illviljan Nov 5, 2022
1a02d23
comment out for now
Illviljan Nov 5, 2022
988956f
Update test_xarray.py
Illviljan Nov 5, 2022
a4d5a9e
Update ci-additional.yaml
Illviljan Nov 5, 2022
e0308b8
Update test_xarray.py
Illviljan Nov 5, 2022
c37db94
Merge branch 'main' into add_typing_to_tests
dcherian Nov 27, 2022
472db78
Clean up conftest
dcherian Nov 27, 2022
c5596b5
Cleanup ci-additional
dcherian Nov 27, 2022
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
23 changes: 12 additions & 11 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ jobs:
- name: Install flox
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
conda info -a
conda list
- name: Run doctests
run: |
python -m pytest --doctest-modules flox --ignore flox/tests
Expand Down Expand Up @@ -97,22 +93,27 @@ jobs:
uses: mamba-org/provision-with-micromamba@v14
with:
environment-file: ${{env.CONDA_ENV_FILE}}
environment-name: xarray-tests
environment-name: flox-tests
extra-specs: |
python=${{env.PYTHON_VERSION}}
lxml
cache-env: true
cache-env-key: "${{runner.os}}-${{runner.arch}}-py${{env.PYTHON_VERSION}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}"
- name: Install xarray
- name: Install flox
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
conda info -a
conda list
- name: Install mypy
run: |
python -m pip install mypy

- name: Run mypy
run: |
python -m mypy --install-types --non-interactive
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
- name: Upload mypy coverage to Codecov
uses: codecov/[email protected]
with:
file: mypy_report/cobertura.xml
flags: mypy
env_vars: PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false
13 changes: 13 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Configuration for pytest."""

import pytest


@pytest.fixture(scope="module", params=["flox", "numpy", "numba"])
def engine(request):
if request.param == "numba":
try:
import numba # noqa: F401
except ImportError:
pytest.xfail()
return request.param
10 changes: 0 additions & 10 deletions tests/__init__.py → flox/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,3 @@ def assert_equal_tuple(a, b):
np.testing.assert_array_equal(a_, b_)
else:
assert a_ == b_


@pytest.fixture(scope="module", params=["flox", "numpy", "numba"])
def engine(request):
if request.param == "numba":
try:
import numba
except ImportError:
pytest.xfail()
return request.param
Loading