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
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Setting things up

.. code-block:: bash

$ pre-commit install
$ prek install -f

Finding something to do
=======================
Expand Down Expand Up @@ -100,7 +100,7 @@ Here's how to make a one-off code change.

.. code-block:: bash

$ pre-commit run -a
$ prek run -a

- To actually make the commit (this will trigger tests style & type checks automatically):

Expand Down
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The repository follows a standard structure for Python projects. Here are some k
- Read the stability guide mentioned at docs/source/stability_policy.rst to understand if your changes
are breaking or incompatible.
- Try to make sure your code is asyncio-friendly and thread-safe.
- Run `uv run pre-commit` to run pre-commit hooks before committing your changes, but after `git add`ing them.
- Run `uv run prek` to run pre-commit hooks before committing your changes, but after `git add`ing them.
- Make sure you always test your changes. Either update or write new tests in the `tests/` directory.

### Pull Requests:
Expand Down
9 changes: 0 additions & 9 deletions .github/labeler.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/labelling.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/prek.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Prek checks
permissions:
contents: read # Needed to see what files to run pre-commit on

on:
pull_request:
branches:
- '**' # Matches all branch names, for PRs
push:
branches:
- 'master' # Run tests on master branch

# Cancel any in-progress runs of this workflow for the same PR or branch when a new commit is pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
prek:
name: prek
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: j178/prek-action@0bb87d7f00b0c99306c8bcb8b8beba1eb581c037 # v1.1.1
11 changes: 3 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
ci:
autofix_prs: false
# We use Renovate to update this file now, but we can't disable automatic pre-commit updates
# when using the `pre-commit` GitHub Action, so we set the schedule to quarterly to avoid
# frequent updates.
autoupdate_schedule: quarterly
autoupdate_commit_msg: 'Bump `pre-commit` Hooks to Latest Versions'

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.15.5'
Expand All @@ -29,6 +21,7 @@ repos:
- cachetools>=7.0.0,<8.0.0
- aiolimiter~=1.1,<1.3
- . # this basically does `pip install -e .`
priority: 10
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.19.1
hooks:
Expand All @@ -46,6 +39,7 @@ repos:
- cachetools>=7.0.0,<8.0.0
- aiolimiter~=1.1,<1.3
- . # this basically does `pip install -e .`
priority: 10
- id: mypy
name: mypy-examples
files: ^examples/.*\.py$
Expand All @@ -58,3 +52,4 @@ repos:
- APScheduler>=3.10.4,<3.12.0
- cachetools>=7.0.0,<8.0.0
- . # this basically does `pip install -e .`
priority: 10
4 changes: 0 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
:target: https://app.codacy.com/gh/python-telegram-bot/python-telegram-bot/dashboard
:alt: Code quality: Codacy

.. image:: https://results.pre-commit.ci/badge/github/python-telegram-bot/python-telegram-bot/master.svg
:target: https://results.pre-commit.ci/latest/github/python-telegram-bot/python-telegram-bot/master
:alt: pre-commit.ci status

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black
Expand Down
5 changes: 5 additions & 0 deletions changes/unreleased/5142.h7G2mCUQ2PobeTyLNewpvx.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
internal = "Replace `pre-commit` with `prek`"
[[pull_requests]]
uid = "5142"
author_uids = ["harshil21"]
closes_threads = ["5138"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ docs = [
"pydantic >= 2.12.0a1 ; python_version >= '3.14'"
]
linting = [
"pre-commit",
"prek",
"ruff==0.15.5",
"mypy==1.18.2",
"pylint==4.0.5"
Expand Down
996 changes: 559 additions & 437 deletions uv.lock

Large diffs are not rendered by default.

Loading