diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2080ac7e8..4b3c5f5ef 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: pyjanitor tests +name: tests on: push: @@ -14,18 +14,28 @@ concurrency: jobs: run-tests: - strategy: - fail-fast: false - matrix: - test-subset: ["turtle", "not turtle"] - runs-on: ubuntu-latest - name: Run pyjanitor test suite + name: ${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.env }} + runs-on: ${{ matrix.os }} # https://github.com/marketplace/actions/setup-miniconda#use-a-default-shell defaults: run: shell: bash -l {0} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + dev: [false] + python-version: + - "3.8" + - "3.9" + - "3.10" + env: [ci/envs/latest.yaml] + steps: - name: Checkout repository uses: actions/checkout@v2 @@ -36,18 +46,21 @@ jobs: with: auto-update-conda: true miniforge-variant: Mambaforge - channels: conda-forge - environment-file: environment-dev.yml + environment-file: ${{ matrix.env }} use-mamba: true - name: Install pyjanitor run: python -m pip install -e . - name: Run docstrings tests + if: ${{ contains(matrix.env, 'latest.yaml') && contains(matrix.os, 'ubuntu') }} run: pytest -v -r a -n auto --color=yes --durations=0 --cov=janitor --cov-append --cov-report term-missing --cov-report xml --doctest-only janitor - - name: Run unit tests - run: pytest -v -r a -n auto --color=yes --durations=0 --cov=janitor --cov-append --cov-report term-missing --cov-report xml tests -m "${{ matrix.test-subset }}" + - name: Run not turtle unit tests + run: pytest -v -r a -n auto --color=yes --durations=0 --cov=janitor --cov-append --cov-report term-missing --cov-report xml tests -m "not turtle" + + - name: Run turtle unit tests + run: pytest -v -r a -n auto --color=yes --durations=0 --cov=janitor --cov-append --cov-report term-missing --cov-report xml tests -m "turtle" # https://github.com/codecov/codecov-action - name: Upload code coverage diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c6132aed..5225f9cbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] +- [INF] Set a series of complete testing envs. Issue #1127 @Zeroto521 - [INF] Replace `pytest.ini` file with `pyproject.toml` file. PR #1204 @Zeroto521 - [INF] Extract docstrings tests from all tests. PR #1205 @Zeroto521 - [BUG] address the `TypeError` when importing v0.24.0 (issue #1201 @xujiboy and @joranbeasley) diff --git a/ci/envs/latest.yaml b/ci/envs/latest.yaml new file mode 100644 index 000000000..d58beab4b --- /dev/null +++ b/ci/envs/latest.yaml @@ -0,0 +1,33 @@ +name: pyjanitor-test +channels: + - conda-forge +dependencies: + # required + - pandas + - pandas-flavor + - multipledispatch + - lazy_loader + - scipy # math, functions + + # optional + - natsort # functions + - numba # functions + - biopython # biology + - rdkit # chemistry + - tqdm # chemistry + - unyt # engineering + - requests # finance + - pyspark>=3.2.2 + - xarray + # io + - openpyxl + - xlrd + + # testing + - pytest + - pytest-cov + - pytest-xdist + - pytest-doctestplus + - hypothesis + - pandas-vet + - interrogate diff --git a/tests/functions/test_encode_categorical.py b/tests/functions/test_encode_categorical.py index 84ec60f95..c8819eb77 100644 --- a/tests/functions/test_encode_categorical.py +++ b/tests/functions/test_encode_categorical.py @@ -26,6 +26,7 @@ def df_checks(): @pytest.mark.functions @given(df=categoricaldf_strategy()) +@settings(deadline=None) def test_encode_categorical(df): df = df.encode_categorical("names") assert df["names"].dtypes == "category"