Skip to content

Commit dcb65a2

Browse files
committed
Merge remote-tracking branch 'upstream/main' into oh-nodes
2 parents f1d58db + e2b644b commit dcb65a2

File tree

8 files changed

+29
-24
lines changed

8 files changed

+29
-24
lines changed

.github/workflows/downstream_tests.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ jobs:
3838
run: |
3939
cd altair
4040
uv pip install -e ".[dev, all]" --system
41-
# temporary pin to get ci green
42-
uv pip install "numpy<2.2" --system
4341
- name: install-narwhals-dev
4442
run: |
4543
uv pip uninstall narwhals --system
@@ -186,10 +184,7 @@ jobs:
186184
UV_SYSTEM_PYTHON: 1
187185
run: |
188186
cd py-shiny
189-
# temporary pin to get ci green
190187
make narwhals-install-shiny
191-
uv pip install "pyflakes<3.3.0" "flake8<7.2.0" --system
192-
uv pip install "plotly<6.1.0" --system
193188
- name: install-narwhals-dev
194189
run: |
195190
uv pip uninstall narwhals --system
@@ -280,6 +275,8 @@ jobs:
280275
run: |
281276
uv pip uninstall narwhals --system
282277
uv pip install -e . --system
278+
# temporary pin to get CI green
279+
uv pip install "polars<1.30" --system
283280
- name: show-deps
284281
run: uv pip freeze
285282
- name: Run pytest
@@ -356,8 +353,6 @@ jobs:
356353
- name: install-deps
357354
run: |
358355
cd hierarchicalforecast
359-
# temporary pin to get ci green
360-
uv pip install "IPython<9" --system
361356
uv pip install --system ".[dev]"
362357
- name: install-narwhals-dev
363358
run: |

.github/workflows/typing.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,5 @@ jobs:
4848
- name: Run pyright type completeness
4949
run: |
5050
source .venv/bin/activate
51-
output=$(pyright --verifytypes narwhals --ignoreexternal 2>&1)
52-
echo "$output"
53-
echo "$output" | grep "Type completeness score: 100%" || exit 1
51+
uv pip install -U pyright-cov
52+
pyright-cov --verifytypes narwhals --ignoreexternal --fail-under 100

.pre-commit-config.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
ci:
22
autoupdate_schedule: monthly
3-
skip: [mypy]
43
repos:
54
- repo: https://github.com/astral-sh/ruff-pre-commit
65
# Ruff version.
@@ -84,13 +83,6 @@ repos:
8483
entry: pull_request_target
8584
language: pygrep
8685
files: ^\.github/workflows/
87-
- id: mypy
88-
name: mypy
89-
entry: make typing
90-
language: system
91-
types: [python]
92-
require_serial: true
93-
pass_filenames: false
9486
- repo: https://github.com/adamchainz/blacken-docs
9587
rev: "1.19.1" # replace with latest tag on GitHub
9688
hooks:

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
Thank you for your interest in contributing to Narwhals! Any kind of improvement is welcome!
44

5+
## **TLDR**
6+
7+
If you've got experience with open source contributions, the following instructions might suffice:
8+
9+
- clone repo: `git clone [email protected]:narwhals-dev/narwhals.git narwhals-dev`
10+
- `cd narwhals-dev/`
11+
- `git remote rename origin upstream`
12+
- `git remote add origin <your fork goes here>`
13+
- `uv venv -p 3.12`
14+
- `. .venv/bin/activate`
15+
- `uv pip install -U -e . --group local-dev`
16+
- To run tests: `pytest`
17+
- To run all linting checks: `pre-commit run --all-files`
18+
- To run static typing checks: `make typing`
19+
20+
For more detailed and beginner-friendly instructions, see below!
21+
522
## Local development vs Codespaces
623

724
You can contribute to Narwhals in your local development environment, using python3, git and your editor of choice.
@@ -113,6 +130,8 @@ If you want to run PySpark-related tests, you'll need to have Java installed. Re
113130
114131
The pre-commit tool is installed as part of the local-dev dependency group. This will automatically format and lint your code before each commit, and it will block the commit if any issues are found.
115132
133+
Static typing is run separately from `pre-commit`, as it's quite slow. Assuming you followed all the instructions above, you can run it with `make typing`.
134+
116135
#### Option 2: use python3-venv
117136
118137
1. Make sure you have Python 3.8+ installed. If you don't, you can check [install Python](https://realpython.com/installing-python/)

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ help: ## Display this help screen
2020

2121
.PHONY: typing
2222
typing: ## Run typing checks
23-
# install duckdb nightly so mypy recognises duckdb.SQLExpression
24-
$(VENV_BIN)/uv pip install -U --pre duckdb
2523
$(VENV_BIN)/uv pip install -e . --group typing
2624
$(VENV_BIN)/mypy
25+
$(VENV_BIN)/pyright

narwhals/_duckdb/dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
from narwhals.utils import _FullContext
5454

5555
with contextlib.suppress(ImportError): # requires duckdb>=1.3.0
56-
from duckdb import SQLExpression # type: ignore[attr-defined, unused-ignore]
56+
from duckdb import SQLExpression
5757

5858

5959
class DuckDBLazyFrame(

narwhals/_duckdb/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
from narwhals.utils import _FullContext
5757

5858
with contextlib.suppress(ImportError): # requires duckdb>=1.3.0
59-
from duckdb import SQLExpression # type: ignore[attr-defined, unused-ignore]
59+
from duckdb import SQLExpression
6060

6161

6262
class DuckDBExpr(LazyExpr["DuckDBLazyFrame", "Expression"]):

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ tests = [
6161
extra = [ # heavier dependencies we don't necessarily need in every testing job
6262
"scikit-learn",
6363
]
64-
typing = [
64+
typing = [ # keep some of these pinned and bump periodically so there's fewer surprises for contributors
65+
"duckdb==1.3.0",
6566
"hypothesis",
6667
"pytest",
6768
"pandas-stubs==2.2.3.250308",
@@ -70,7 +71,7 @@ typing = [
7071
"pyright",
7172
"pyarrow-stubs==19.2",
7273
"sqlframe",
73-
"polars==1.25.2",
74+
"polars==1.30.0",
7475
"uv",
7576
"narwhals[ibis]",
7677
]

0 commit comments

Comments
 (0)