Skip to content

Commit 391e799

Browse files
committed
add ty experimental
1 parent 35d92d0 commit 391e799

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,6 @@ benchmark/data/*.json
133133
.swp
134134

135135
uv.lock
136+
137+
# While typing is experimental, don't mark the entire package as typed
138+
pointblank/py.typed

CONTRIBUTING.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ Once there is consensus that a PR based on the issue would be helpful, adhering
2525

2626
### Setting Up Your Development Environment
2727

28-
To set up your development environment, you can follow these steps:
28+
To set up your development environment, first clone the posit-dev/pointblank repository.
2929

30-
- Clone the posit-dev/pointblank repository
31-
- Create a virtual environment for the folder
32-
- Install the package in editable mode with `pip install -e .` from the root of the project folder
30+
If you're using UV, you may run `uv sync` and your environment is setup! If using pip or another package manager, keep following these steps:
31+
32+
- Create a virtual environment for the folder.
33+
- Install the package in editable mode with `pip install -e .` from the root of the project folder.
3334
- Install the development dependencies with `pip install '.[dev]'` (have a look at the `pyproject.toml` file for the list of development dependencies)
3435

3536
Our documentation uses `quartodoc` which in turn requires a local install of the Quarto CLI. To install Quarto, go to <https://quarto.org/docs/get-started/> to get the latest build for your platform.
@@ -43,3 +44,7 @@ Building the documentation can be done with `make docs-build` from the root of t
4344
The tests are located in the `tests` folder and we use `pytest` for running them. To run all of the tests, use `make test`. If you want to run a specific test file, you can use `pytest tests/test_file.py`.
4445

4546
If you create new tests involving snapshots, please ensure that the resulting snapshots are relatively small. After adding snapshots, use `make test-update` (this runs `pytest --snapshot-update`). A subsequent use of `make test` should pass without any issues.
47+
48+
### Linting and Type Checking
49+
50+
We use `ruff` for linting, the settings used are fairly loose and objective. Linting is run in pre-commit in CI. You can run it locally with `make lint`. Type checking is currently not enforced, but we intend on gradually typing the codebase. You can run `make type` to run Astral's new experimental type checker `ty`. Feel free to leverage type hints and occasionally type checking but it's not obligatory at this time.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ lint: ## Run ruff formatter and linter
1818
@uv run ruff format
1919
@uv run ruff check --fix
2020

21+
22+
type: ## Run experimental(!) type checking
23+
@uvx ty check pointblank
24+
25+
2126
check:
2227
pyright --pythonversion 3.8 pointblank
2328
pyright --pythonversion 3.9 pointblank

0 commit comments

Comments
 (0)