Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
af2d2e4
Add renovate.json
renovate[bot] Jul 29, 2025
9b9c5b1
Add chango fragment for PR #4887
renovate[bot] Jul 29, 2025
7279e67
Add initial Renovate configuration
harshil21 Jul 30, 2025
060cd51
Use cron syntax for lock file schedule
harshil21 Jul 30, 2025
15a3e7c
Enable pre-commit-config yaml updates (beta)
harshil21 Jul 30, 2025
891b7c9
Review: changelog, rm schedule in unit tests, add back pre-commit aut…
harshil21 Jul 30, 2025
6e671d8
Delete Dependabot files
harshil21 Jul 30, 2025
dea7cfc
try fixing stuff for chango & pyright-type-completeness
Bibo-Joshi Jul 31, 2025
35da332
Merge branch 'master' into renovate/configure
Bibo-Joshi Jul 31, 2025
d1b89d8
Add the linting dependency group
harshil21 Aug 1, 2025
0d874e5
Try grouping updating of dependencies in one PR
harshil21 Aug 2, 2025
f204c05
Move renovate.json5 to .github
harshil21 Aug 2, 2025
d1b68d7
Try a different grouping method?
harshil21 Aug 2, 2025
5f68f6d
Fix renovate config
harshil21 Aug 2, 2025
b03e630
Change renovate update strategy
harshil21 Aug 4, 2025
104ddf3
Merge branch 'master' into renovate/configure
harshil21 Aug 9, 2025
aed0fdd
External review: Fix grouping of deps, simply config
harshil21 Aug 13, 2025
a84ecf6
External review: Add new pre-commit job
harshil21 Aug 13, 2025
6beacfb
uv lock update
harshil21 Aug 13, 2025
82e7905
Revert "External review: Add new pre-commit job"
harshil21 Aug 13, 2025
5811faf
Group more dependencies together, increase prHourlyLimit
harshil21 Aug 13, 2025
477fe06
Add back config validator, but skip it on ci run
harshil21 Aug 13, 2025
05d8029
External review: Don't group uv updates, unlimited concurrent updates
harshil21 Aug 13, 2025
980a8d1
Don't manually install linting dependencies in copilot setup steps
harshil21 Aug 17, 2025
be3486a
Remove config validation check again
harshil21 Aug 17, 2025
44fe7fa
Fix pre-commit.ci
harshil21 Aug 18, 2025
add58af
Merge master and fix conflicts
harshil21 Aug 18, 2025
d699a74
Merge master and fix conflicts
harshil21 Sep 7, 2025
ab41d8c
Merge master and fix conflicts
harshil21 Sep 7, 2025
254b6c9
Use automerging
harshil21 Sep 7, 2025
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
20 changes: 0 additions & 20 deletions .github/dependabot.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [ // See what config:best-practices does: https://docs.renovatebot.com/presets-config/#configbest-practices
"config:best-practices",
// Opt-in to updating the pre-commit-config.yaml file too:
":enablePreCommit",
":prConcurrentLimitNone" // No limits on the number of open PRs.
],

// Add pull request labels:
"labels": ["dependencies"],

// Bump even patch versions:
"bumpVersion": "patch",

// Let Renovate decide how to update. See docs: https://docs.renovatebot.com/configuration-options/#rangestrategy
"rangeStrategy": "auto",
Comment on lines +16 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Let Renovate decide how to update. See docs: https://docs.renovatebot.com/configuration-options/#rangestrategy
"rangeStrategy": "auto",

There’s no need to explicitly specify when using the default value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I do want to explicitly mention it so anybody reading it is aware of our setting.


// Update the lock files:
"lockFileMaintenance": {
"enabled": true,
"schedule": ["* * * * 1,4"] // Run sometime on Monday and Thursday
},

// Bump the versions even in other files:
"bumpVersions": [
{
"name": "Update dependency versions in README.rst",
"filePatterns": ["README.rst"],
"matchStrings": [
"cryptography>=(?<version>\\d+\\.\\d+\\.\\d+)",
"aiolimiter~=(?<version>\\d+\\.\\d+\\.\\d+)",
"tornado~=(?<version>\\d+\\.\\d+)",
"cachetools>=(?<version>\\d+\\.\\d+\\.\\d+)", // Lower bound only
"APScheduler>=(?<version>\\d+\\.\\d+\\.\\d+)" // Lower bound only
],
"bumpType": "minor"
}
],

// Group package updates together:
"packageRules": [
// Linting dependencies in pyproject.toml in sync with the pre-commit-config hooks:
// Unfortunately it seems we need to do this for every dependency group (https://github.com/python-telegram-bot/python-telegram-bot/pull/4887#discussion_r2272025832):
{
"description": "Group Ruff updates together",
"matchPackageNames": ["ruff", "astral-sh/ruff-pre-commit"],
"groupName": "Ruff"
},
{
"description": "Group mypy updates together",
"matchPackageNames": ["mypy", "pre-commit/mirrors-mypy"],
"groupName": "Mypy"
},
{
"description": "Group pylint updates together",
"matchPackageNames": ["pylint", "PyCQA/pylint"],
"groupName": "Pylint"
},
{
"description": "Group chango updates together",
"matchPackageNames": ["chango", "Bibo-Joshi/chango"],
"groupName": "Chango"
},
// Automerge PR's for minor/patch/pin/digest (except major) updates:
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"automerge": true
}
],

// Increase the number of PR's Renovate can create in a hour. Default is 2.
"prHourlyLimit": 5,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using presets is convenient, and there's nothing wrong with creating all PRs at once.

    ':prConcurrentLimitNone',
    ':prHourlyLimitNone',

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the fence with this one. I don't really want to spam everything at once because our CI has flaky tests which fail when many PRs are opened at once.

If Renovate has an option of spacing out PRs by a set amount of time, say 30 minutes, that would be better imo.


// Temporarily disabled:
"ignoreDeps": ["pytest-asyncio"],

// schedule to allow PR's from Renovate:
"schedule": ["* * * * 0,6"] // Every weekend

}
2 changes: 1 addition & 1 deletion .github/workflows/chango.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
fi

# Create the new fragment
- uses: Bibo-Joshi/chango@9d6bd9d7612eca5fab2c5161687011be59baaf19 # v0.4.0
- uses: Bibo-Joshi/chango@9d6bd9d7612eca5fab2c5161687011be59baaf19 # 0.4.0
with:
github-token: ${{ secrets.CHANGO_PAT }}
query-issue-types: true
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,3 @@ jobs:

- name: Install the project
run: uv sync --all-extras --all-groups --locked

- name: Install linting dependencies
# Make sure the pinned versions here match the ones in .pre-commit-config.yaml
run: uv pip install black==25.1.0 isort==6.0.1 mypy==1.16.1 flake8==7.3.0 ruff==0.12.2
41 changes: 0 additions & 41 deletions .github/workflows/dependabot-prs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/type_completeness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: test-type-completeness
runs-on: ubuntu-latest
steps:
- uses: Bibo-Joshi/pyright-type-completeness@c85a67ff3c66f51dcbb2d06bfcf4fe83a57d69cc # v1.0.1
- uses: Bibo-Joshi/pyright-type-completeness@c85a67ff3c66f51dcbb2d06bfcf4fe83a57d69cc # 1.0.1
with:
package-name: telegram
python-version: 3.12
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/type_completeness_monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: test-type-completeness
runs-on: ubuntu-latest
steps:
- uses: Bibo-Joshi/pyright-type-completeness@c85a67ff3c66f51dcbb2d06bfcf4fe83a57d69cc # v1.0.1
- uses: Bibo-Joshi/pyright-type-completeness@c85a67ff3c66f51dcbb2d06bfcf4fe83a57d69cc # 1.0.1
id: pyright-type-completeness
with:
package-name: telegram
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
push:
branches:
- master
schedule:
# Run monday and friday morning at 03:07 - odd time to spread load on GitHub Actions
- cron: '7 3 * * 1,5'

permissions: {}

Expand Down
13 changes: 9 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Make sure that the additional_dependencies here match pyproject.toml

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'

Expand All @@ -11,14 +12,16 @@ repos:
hooks:
# Run the linter:
- id: ruff-check
name: ruff
name: ruff check
# Run the formatter:
- id: ruff-format
name: ruff format
- repo: https://github.com/PyCQA/pylint
rev: v3.3.7
hooks:
- id: pylint
files: ^(?!(tests|docs)).*\.py$
language: python
additional_dependencies:
- httpx~=0.27
- tornado~=6.4
Expand All @@ -32,6 +35,7 @@ repos:
- id: mypy
name: mypy-ptb
files: ^(?!(tests|examples|docs)).*\.py$
language: python
additional_dependencies:
- types-pytz
- types-cryptography
Expand All @@ -45,11 +49,12 @@ repos:
- id: mypy
name: mypy-examples
files: ^examples/.*\.py$
language: python
args:
- --no-strict-optional
- --follow-imports=silent
additional_dependencies:
- tornado~=6.4
- APScheduler~=3.10.4
- cachetools>=5.3.3,<5.5.0
- . # this basically does `pip install -e .`
- . # this basically does `pip install -e .`
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ build:
jobs:
install:
- pip install -U pip
- pip install .[all] --group 'all' # install all the dependency groups
- pip install .[all] --group 'docs' --group 'tests' # install most dependency groups

post_build:
# Based on https://github.com/readthedocs/readthedocs.org/issues/3242#issuecomment-1410321534
Expand Down
5 changes: 5 additions & 0 deletions changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
internal = "Use Renovate to Keep Dependencies Up-To-Date"
[[pull_requests]]
uid = "4887"
author_uid = "renovate[bot]"
closes_threads = []
14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ dependencies = [
"Support" = "https://t.me/pythontelegrambotgroup"

[project.optional-dependencies]
# Make sure to install those as additional_dependencies in the
# pre-commit hooks for pylint & mypy
# Also update the readme accordingly
# Make sure to install those as additional_dependencies in the pre-commit hooks
#
# When dependencies release new versions and tests succeed, we should try to expand the allowed
# versions and only increase the lower bound if necessary
#
# When adding new groups, make sure to update `ext` and `all` accordingly
# When adding new extras, make sure to update `ext` and `all` accordingly

# Optional dependencies for production
all = [
Expand Down Expand Up @@ -133,7 +131,13 @@ docs = [
# stable pydantic version is released.
"pydantic >= 2.12.0a1 ; python_version >= '3.14'"
]
all = ["pre-commit", { include-group = "tests" }, { include-group = "docs" }]
linting = [
"pre-commit",
"ruff==0.12.7",
"mypy==1.16.1",
"pylint==3.3.7"
]
all = [{ include-group = "tests" }, { include-group = "docs" }, { include-group = "linting"}]

# HATCH
[tool.hatch.version]
Expand Down
Loading
Loading