Skip to content

Commit

Permalink
ci: split dev from extra
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Dec 23, 2024
1 parent 82ab5fb commit 5020c08
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/extremes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
matrix:
python-version: ["3.8"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -87,7 +86,6 @@ jobs:
matrix:
python-version: ["3.9"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -117,7 +115,6 @@ jobs:
echo "$DEPS" | grep 'scipy==1.8.0'
echo "$DEPS" | grep 'scikit-learn==1.3.0'
echo "$DEPS" | grep 'dask==2024.7'
- name: Run pytest
run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=50 --runslow

Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
matrix:
python-version: ["3.8"]
os: [windows-latest, ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -25,6 +24,7 @@ jobs:
cache-suffix: ${{ matrix.python-version }}
cache-dependency-glob: "pyproject.toml"
- name: install-reqs
# Python3.8 is technically at end-of-life, so we don't test everything
run: uv pip install -e ".[dev]" --system
- name: show-deps
run: uv pip freeze
Expand All @@ -36,7 +36,6 @@ jobs:
matrix:
python-version: ["3.10", "3.12"]
os: [windows-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -50,22 +49,17 @@ jobs:
cache-suffix: ${{ matrix.python-version }}
cache-dependency-glob: "pyproject.toml"
- name: install-reqs
run: uv pip install -e ".[dev]" --system
- name: install-dask
run: uv pip install --upgrade dask[dataframe] --system
- name: install-modin
run: uv pip install --upgrade modin --system
run: uv pip install -e ".[dev, extra]" --system
- name: show-deps
run: uv pip freeze
- name: Run pytest
run: pytest tests --cov=narwhals --cov=tests --runslow --cov-fail-under=95

pytest-coverage:
pytest-full-coverage:
strategy:
matrix:
python-version: ["3.9", "3.11", "3.13"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -79,9 +73,7 @@ jobs:
cache-suffix: ${{ matrix.python-version }}
cache-dependency-glob: "pyproject.toml"
- name: install-reqs
run: uv pip install -e ".[dev]" --system
- name: install-modin
run: uv pip install --upgrade modin[dask] --system
run: uv pip install -e ".[dev, extra]" --system
- name: show-deps
run: uv pip freeze
- name: install ibis
Expand All @@ -92,5 +84,6 @@ jobs:
- name: Run pytest
run: pytest tests --cov=narwhals --cov=tests --cov-fail-under=100 --runslow
- name: Run doctests
# reprs differ between versions, so we only run doctests on the latest Python
if: matrix.python-version == '3.13'
run: pytest narwhals --doctest-modules
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ Here's how you can set up your local development environment to contribute.
uv venv -p 3.12 --seed
```
4. Activate it. On Linux, this is `. .venv/bin/activate`, on Windows `.\.venv\Scripts\activate`.
2. Install Narwhals: `uv pip install -e ".[dev, docs]"`
2. Install Narwhals: `uv pip install -e ".[dev, docs]"`. If you also want to test Dask , PySpark, and
Modin, you can install them too with `uv pip install -e ".[dev, docs, extra]"`.
3. Install a fork of griffe:
```
uv pip install git+https://github.com/MarcoGorelli/griffe.git@no-overloads
Expand Down
16 changes: 7 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ dev = [
"duckdb",
"pandas",
"polars",
"pre-commit",
"pyarrow",
"pyspark; python_version >= '3.9' and python_version < '3.12'",
"pyarrow-stubs",
"pytest",
"pytest-cov",
"pytest-randomly",
"pytest-env",
"hypothesis",
"hypothesis[numpy]",
"scikit-learn",
"typing_extensions",
]
extra = [ # heavier dependencies we don't necessarily need in every testing job
"scikit-learn",
"pyspark; python_version >= '3.9' and python_version < '3.12'",
"dask[dataframe]; python_version >= '3.9'",
]
docs = [
Expand Down Expand Up @@ -175,22 +177,18 @@ env = [
plugins = ["covdefaults"]

[tool.coverage.report]
fail_under = 80 # This is just for local development, in CI we set it to 100
omit = [
'narwhals/typing.py',
'narwhals/stable/v1/typing.py',
'narwhals/this.py',
# we can't run this in every environment that we measure coverage on due to upper-bound constraits
'narwhals/_ibis/*',
# the latest pyspark (3.5) doesn't officially support Python 3.12 and 3.13
'narwhals/_spark_like/*',
# we don't run these in every environment
'tests/spark_like_test.py',
]
exclude_also = [
"if sys.version_info() <",
"if (:?self._)?implementation is Implementation.MODIN",
"if .*implementation is Implementation.CUDF",
'request.applymarker\(pytest.mark.xfail',
'\w+._backend_version < ',
'backend_version <',
'if "cudf" in str\(constructor'
]
Expand Down

0 comments on commit 5020c08

Please sign in to comment.