Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions template/.config/mypy.ini

This file was deleted.

11 changes: 11 additions & 0 deletions template/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ repos:
rev: v1.46.2
hooks:
- id: typos
args: [--config, .config/typos.toml, --force-exclude]

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
Expand All @@ -42,3 +43,13 @@ repos:
args: [--fix]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/facebook/pyrefly-pre-commit
# Note: this is the version of the pre-commit hook, NOT the pyrefly version used for type checking.
rev: 1.2.0.dev1
hooks:
- id: pyrefly-check
name: Pyrefly (type checking)
# Recommended to do full repo checks, not just on changed files.
pass_filenames: false
language: system
2 changes: 1 addition & 1 deletion template/.vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"GitHub.vscode-pull-request-github",
"ms-python.python",
"ms-python.vscode-pylance",
"matangover.mypy",
"meta.pyrefly",
"njpwerner.autodocstring",
"quarto.quarto",
"ms-toolsai.jupyter",
Expand Down
2 changes: 0 additions & 2 deletions template/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
"files.insertFinalNewline": true,
"python.testing.pytestEnabled": true,
"python.testing.pytestPath": "${workspaceFolder}/.venv/bin/pytest",
"mypy.runUsingActiveInterpreter": true,
"mypy.configFile": ".config/mypy.ini",
"conventionalCommits.emojiFormat": "emoji",
"conventionalCommits.promptScopes": false,
"typos.config": ".config/typos.toml",
Expand Down
6 changes: 1 addition & 5 deletions template/CONTRIBUTING.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ It's easiest to install uv and justfile using
install uv and justfile by running:

``` bash
pipx install uv rust-just
pipx install uv rust-just pyrefly
```

We keep all our development workflows in the `justfile`, so you can
Expand Down Expand Up @@ -79,19 +79,15 @@ commit.
such as:
- `quartodoc.py`: Custom
[`quartodoc`](https://machow.github.io/quartodoc/) renderer.
- `mypy.ini`: [`mypy`](https://mypy.readthedocs.io/en/stable/)
configuration file for type checking Python code.
- `ruff.toml`: [Ruff](https://docs.astral.sh/ruff/) configuration file
for linting and formatting Python code.
- `rumdl.toml` and `panache.toml`: [rumdl](https://rumdl.dev) and
[Panache](https://panache.bz) configuration file for formatting Markdown
files in the project.
{% if for_seedcase -%}
- `cog.toml`: [Cocogitto](https://docs.cocogitto.io) configuration file
for managing versions.
- `cliff.toml`: [git-cliff](https://git-cliff.org) configuration file for
creating the changelog.
{%- endif %}
- `.copier-answers.yml`: Contains the answers you gave when copying the
package from the template.
**You should not modify this file directly.**
Expand Down
2 changes: 1 addition & 1 deletion template/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
project.
- Run `git init -b main` to create the project as a Git repository.
- Install these packages
`uv add --dev pytest genbadge jupyter pytest-cov quartodoc quarto types-tabulate mypy`
`uv add --dev pytest genbadge jupyter pytest-cov quartodoc quarto types-tabulate`
- Run `just list-todos` and complete all the TODO items.
- Run `just install-precommit` to install the pre-commit hooks.
- Run `just build-readme` to build the Markdown version of the README. {%- if
Expand Down
2 changes: 1 addition & 1 deletion template/justfile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ check-python:
# Check formatting
uvx ruff check .
# Check types
uv run mypy --pretty . --config-file .config/mypy.ini
uvx pyrefly check

# Run basic security checks on the package
check-security:
Expand Down
8 changes: 7 additions & 1 deletion template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = []
classifiers = [
"License :: OSI Approved :: MIT License",

# Strict typing, checked via mypy
# Strict typing, checked via Pyrefly
"Typing :: Typed",

# How mature is this project? Common values are
Expand Down Expand Up @@ -57,5 +57,11 @@ build-backend = "hatchling.build"
# - Trigger failure if below 90% code coverage
addopts = "--tb=short --import-mode=importlib --cov=src --no-cov-on-fail --cov-report=term --cov-report=xml --cov-report=html --cov-fail-under=90"

[tool.pyrefly]
project-includes = ["src/"]
min-severity = "warn"
python-version = "3.12.0"
preset = "strict"

[tool.ruff]
extend = ".config/ruff.toml"
1 change: 0 additions & 1 deletion template/tools/vulture-allowlist.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# ruff: noqa
# mypy: ignore-errors
Loading