forked from narwhals-dev/narwhals
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use
mypy
pre-commit in local environment (narwhals-dev#1966)
Co-authored-by: Dan Redding <[email protected]>
- Loading branch information
1 parent
b96c0e8
commit 2d6df36
Showing
34 changed files
with
242 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Type checking | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
mypy: | ||
strategy: | ||
matrix: | ||
python-version: ["3.11"] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: "true" | ||
cache-suffix: ${{ matrix.python-version }} | ||
cache-dependency-glob: "pyproject.toml" | ||
- name: Create venv | ||
run: uv venv .venv | ||
- name: install-reqs | ||
# TODO: add more dependencies/backends incrementally | ||
run: | | ||
source .venv/bin/activate | ||
uv pip install -e ".[tests, typing, core]" | ||
- name: show-deps | ||
run: | | ||
source .venv/bin/activate | ||
uv pip freeze | ||
- name: Run mypy | ||
run: | | ||
source .venv/bin/activate | ||
make typing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Mostly based on polars Makefile | ||
# https://github.com/pola-rs/polars/blob/main/py-polars/Makefile | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
SHELL=bash | ||
VENV=./.venv | ||
|
||
ifeq ($(OS),Windows_NT) | ||
VENV_BIN=$(VENV)/Scripts | ||
else | ||
VENV_BIN=$(VENV)/bin | ||
endif | ||
|
||
|
||
.PHONY: help | ||
help: ## Display this help screen | ||
@echo -e "\033[1mAvailable commands:\033[0m" | ||
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-22s\033[0m %s\n", $$1, $$2}' | sort | ||
|
||
.PHONY: typing | ||
typing: ## Run typing checks | ||
$(VENV_BIN)/mypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.