Skip to content
Draft
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
6 changes: 1 addition & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
"ghcr.io/devcontainers/features/python:1": "none",
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
Expand Down Expand Up @@ -58,9 +57,6 @@
}
},
"forwardPorts": [8000],
"postCreateCommand": [
"uv",
"sync"
],
"postCreateCommand": "uv sync",
"remoteUser": "vscode"
}
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ jobs:
with:
python-version: "3.9"

- name: Install Pre-Commit
run: python -m pip install pre-commit
- name: Install uv
uses: astral-sh/setup-uv@v7

- name: Load cached Pre-Commit Dependencies
id: cached-pre-commit-dependencies
- name: Load cached prek Dependencies
id: cached-prek-dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit/
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
path: ~/.cache/prek/
key: prek-1|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Execute Pre-Commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
- name: Execute prek
run: uvx prek run --show-diff-on-failure --color=always --all-files

mypy:
runs-on: ubuntu-latest
Expand Down
22 changes: 18 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,24 @@ Workflow
#. Clone your fork locally with git
#. `Set up the environment <#setting-up-the-environment>`_
#. Make your changes
#. (Optional) Run ``pre-commit run --all-files`` to run linters and formatters. This step is optional and will be executed
automatically by git before you make a commit, but you may want to run it manually in order to apply fixes
#. (Optional) Run linters and formatters manually. This step is optional and will be executed
automatically by git before you make a commit, but you may want to run it manually in order to apply fixes:

.. code-block:: shell
:caption: Running linters with prek (recommended)

uvx prek run --all-files

.. code-block:: shell
:caption: Running linters with pre-commit (alternative)

uvx pre-commit run --all-files

We recommend `prek <https://prek.j178.dev/>`_ as a faster, Rust-based alternative to pre-commit.
Both tools use the same configuration file (``.pre-commit-config.yaml``).

#. Commit your changes to git. We follow `conventional commits <https://www.conventionalcommits.org/>`_
which are enforced using a ``pre-commit`` hook.
which are enforced using a pre-commit hook.
#. Push the changes to your fork
#. Open a `pull request <https://docs.github.com/en/pull-requests>`_. Give the pull request a descriptive title
indicating what it changes. The style of the PR title should also follow
Expand Down Expand Up @@ -137,7 +151,7 @@ enforce type safety. You can run them with:
- ``make mypy``
- ``make pyright``
- ``make type-check`` to run both
- ``make lint`` to run pre-commit hooks and type checkers.
- ``make lint`` to run linting hooks (via prek/pre-commit) and type checkers.

Our type checkers are run on Python 3.9 in CI, so you should make sure to run them on the same version locally as well.

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ upgrade: ## Upgrade all dependencies to the latest stable versio
@echo "=> Updating all dependencies"
@uv lock --upgrade
@echo "=> Dependencies Updated"
@uv run pre-commit autoupdate
@echo "=> Updated Pre-commit"
@uvx prek autoupdate
@echo "=> Updated pre-commit hooks"

# =============================================================================
# Developer Utils
Expand Down Expand Up @@ -80,8 +80,8 @@ type-check: mypy pyright ## Run all type checking

.PHONY: pre-commit
pre-commit: ## Runs pre-commit hooks; includes ruff formatting and linting, codespell
@echo "=> Running pre-commit process"
@uv run pre-commit run --all-files
@echo "=> Running pre-commit hooks"
@uvx prek run --all-files
@echo "=> Pre-commit complete"

.PHONY: slots-check
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ docs = [
linting = [
"ruff>=0.11.5",
"mypy",
"pre-commit",
"slotscheck",
"codecov-cli",
"pyright>=1.1.403",
Expand Down
Loading
Loading