Skip to content

Commit 8d0a3e2

Browse files
authored
chore: move dev dependencies to dependency-groups (#2238)
1 parent 4d5fb30 commit 8d0a3e2

File tree

11 files changed

+52
-41
lines changed

11 files changed

+52
-41
lines changed

.github/workflows/check_docs_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
cache-suffix: ${{ matrix.python-version }}
2626
cache-dependency-glob: "pyproject.toml"
2727
- name: local-install
28-
run: uv pip install -e .[docs] --system
28+
run: uv pip install -e . --group docs --system
2929
- name: check-no-errors
3030
run: |
3131
python -m mkdocs build 2>&1 | tee output.txt

.github/workflows/check_tpch_queries.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
# once https://github.com/duckdb/duckdb/issues/16445
3333
# is addressed, try using `--pre`
34-
uv pip install -U -e ".[tests, core, dask]" --system
34+
uv pip install -U -e ".[dask]" --group core-tests --system
3535
- name: generate-data
3636
run: cd tpch && python generate_data.py
3737
- name: tpch-tests

.github/workflows/downstream_tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,16 @@ jobs:
228228
run: |
229229
cd tea-tasting
230230
pdm remove narwhals
231-
pdm add ./..[tests]
231+
pdm add ./..
232232
- name: show-deps
233233
run: |
234234
cd tea-tasting
235235
pdm list
236236
- name: run-pytest
237237
run: |
238238
cd tea-tasting
239+
# empty pytest.ini to avoid pytest using narwhals configs
240+
touch pytest.ini
239241
pdm run test
240242
241243
# temporarily commented out until they address the `new_series` deprecation

.github/workflows/extremes.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: uv pip install pipdeptree tox virtualenv setuptools pandas==0.25.3 polars==0.20.3 numpy==1.17.5 pyarrow==11.0.0 "pyarrow-stubs<17" scipy==1.5.0 scikit-learn==1.1.0 duckdb==1.0 tzdata backports.zoneinfo --system
2929
- name: install-reqs
3030
run: |
31-
uv pip install -e ".[tests]" --system
31+
uv pip install -e . --group tests --system
3232
- name: show-deps
3333
run: uv pip freeze
3434
- name: Assert dependencies
@@ -64,7 +64,7 @@ jobs:
6464
- name: install-pretty-old-versions
6565
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.5 polars==0.20.3 numpy==1.17.5 pyarrow==11.0.0 "pyarrow-stubs<17" pyspark==3.5.0 scipy==1.5.0 scikit-learn==1.1.0 duckdb==1.0 tzdata backports.zoneinfo --system
6666
- name: install-reqs
67-
run: uv pip install -e ".[tests]" --system
67+
run: uv pip install -e . --group tests --system
6868
- name: show-deps
6969
run: uv pip freeze
7070
- name: show-deptree
@@ -103,7 +103,7 @@ jobs:
103103
- name: install-not-so-old-versions
104104
run: uv pip install tox virtualenv setuptools pandas==2.0.3 polars==0.20.8 numpy==1.24.4 pyarrow==15.0.0 "pyarrow-stubs<17" pyspark==3.5.0 scipy==1.8.0 scikit-learn==1.3.0 duckdb==1.0 dask[dataframe]==2024.10 tzdata --system
105105
- name: install-reqs
106-
run: uv pip install -e ".[tests]" --system
106+
run: uv pip install -e . --group tests --system
107107
- name: show-deps
108108
run: uv pip freeze
109109
- name: Assert not so old versions dependencies
@@ -140,7 +140,7 @@ jobs:
140140
cache-suffix: ${{ matrix.python-version }}
141141
cache-dependency-glob: "pyproject.toml"
142142
- name: install-reqs
143-
run: uv pip install -e ".[tests]" --system
143+
run: uv pip install -e . --group tests --system
144144
- name: install-kaggle
145145
run: uv pip install kaggle --system
146146
- name: Download Kaggle notebook artifact

.github/workflows/pytest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
cache-dependency-glob: "pyproject.toml"
2929
- name: install-reqs
3030
# Python3.8 is technically at end-of-life, so we don't test everything
31-
run: uv pip install -e ".[tests, core]" backports.zoneinfo --system
31+
run: uv pip install -e ".[pandas,polars,pyarrow]" backports.zoneinfo --group tests --system
3232
- name: show-deps
3333
run: uv pip freeze
3434
- name: Run pytest
@@ -53,7 +53,7 @@ jobs:
5353
cache-dependency-glob: "pyproject.toml"
5454
- name: install-reqs
5555
# we are not testing pyspark on Windows here because it is very slow
56-
run: uv pip install -e ".[tests, core, extra, dask, modin]" --system
56+
run: uv pip install -e ".[dask, modin]" --group core-tests --group extra --system
5757
- name: show-deps
5858
run: uv pip freeze
5959
- name: Run pytest
@@ -83,7 +83,7 @@ jobs:
8383
cache-suffix: ${{ matrix.python-version }}
8484
cache-dependency-glob: "pyproject.toml"
8585
- name: install-reqs
86-
run: uv pip install -e ".[tests, core, extra, modin, dask]" --system
86+
run: uv pip install -e ".[modin, dask]" --group core-tests --group extra --system
8787
- name: install pyspark
8888
run: uv pip install -e ".[pyspark]" --system
8989
# PySpark is not yet available on Python3.12+

.github/workflows/random_ci_pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: install-random-verions
3131
run: uv pip install -r random-requirements.txt --system
3232
- name: install-narwhals
33-
run: uv pip install -e ".[tests]" --system
33+
run: uv pip install -e . --group tests --system
3434
- name: show versions
3535
run: uv pip freeze
3636
- name: Run pytest

.github/workflows/typing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# TODO: add more dependencies/backends incrementally
3333
run: |
3434
source .venv/bin/activate
35-
uv pip install -e ".[typing, core, pyspark]"
35+
uv pip install -e ".[pyspark]" --group core --group typing
3636
- name: show-deps
3737
run: |
3838
source .venv/bin/activate

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,13 @@ If you want to run PySpark-related tests, you'll need to have Java installed. Re
107107
108108
4. Activate it. On Linux, this is `. .venv/bin/activate`, on Windows `.\.venv\Scripts\activate`.
109109
110-
2. Install Narwhals: `uv pip install -e ".[dev, core, docs]"`. This will include fast-ish core libraries.
110+
2. Install Narwhals: `uv pip install -e . --group local-dev"`. This will include fast-ish core libraries and dev dependencies.
111111
If you also want to test other libraries like Dask , PySpark, and Modin, you can install them too with
112-
`uv pip install -e ".[dev, core, docs, dask, pyspark, modin]"`.
112+
`uv pip install -e ".[dask, pyspark, modin]" --group local-dev"`.
113113
114114
You should also install pre-commit:
115115
116116
```terminal
117-
uv pip install pre-commit
118117
pre-commit install
119118
```
120119

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ help: ## Display this help screen
2020

2121
.PHONY: typing
2222
typing: ## Run typing checks
23-
$(VENV_BIN)/uv pip install -e .[typing]
23+
$(VENV_BIN)/uv pip install -e . --group typing
2424
$(VENV_BIN)/mypy

noxfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
def run_common(session: Session, coverage_threshold: float) -> None:
1717
if session.python == "3.8":
18-
session.install("-e .[dev,core]")
18+
session.install("-e . --group dev-core")
1919
elif session.python == "3.12":
20-
session.install("-e .[dev,core,extra,dask,modin]")
20+
session.install("-e .[dask,modin] --group dev-core --group extra")
2121
else:
22-
session.install("-e .[dev,core,extra,dask,modin,pyspark,ibis]")
22+
session.install("-e .[dask,modin,pyspark,ibis] --group dev-core --group extra")
2323

2424
session.run(
2525
"pytest",

0 commit comments

Comments
 (0)