From af2d2e460e5229655772823df37c44e53e51fd9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 05:16:58 +0000 Subject: [PATCH 01/14] Add renovate.json --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000000..5db72dd6a94 --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ] +} From 9b9c5b1f22e8177eaaed4d1e4a2dccf5f2941df3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 05:17:36 +0000 Subject: [PATCH 02/14] Add chango fragment for PR #4887 --- changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml diff --git a/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml b/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml new file mode 100644 index 00000000000..ec7eab58c67 --- /dev/null +++ b/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml @@ -0,0 +1,5 @@ +other = "Configure Renovate" +[[pull_requests]] +uid = "4887" +author_uid = "renovate[bot]" +closes_threads = [] From 7279e6755c7ecb8d8c9f1120ade7b9198f447a99 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 30 Jul 2025 04:07:54 -0700 Subject: [PATCH 03/14] Add initial Renovate configuration --- renovate.json | 6 ----- renovate.json5 | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 6 deletions(-) delete mode 100644 renovate.json create mode 100644 renovate.json5 diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 5db72dd6a94..00000000000 --- a/renovate.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended" - ] -} diff --git a/renovate.json5 b/renovate.json5 new file mode 100644 index 00000000000..37ceb640ab2 --- /dev/null +++ b/renovate.json5 @@ -0,0 +1,61 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ // See what config:recommended does: https://docs.renovatebot.com/presets-config/#configrecommended + "config:recommended", + // Dependency Dashboards are Issues Renovate creates which list all pending updates. We disable it + // because we don't need it, we can see the pending updates in the PRs. This is also noisy. + // https://docs.renovatebot.com/configuration-options/#dependencydashboard + // ":disableDependencyDashboard" + ], + + // Add pull request labels: + "labels": ["dependencies"], + + // Bump even patch versions: + "bumpVersion": "patch", + + // Update the lock files: + "lockFileMaintenance": { + "enabled": true, + "recreateWhen": "always", + "rebaseStalePrs": true, + "branchTopic": "lock-file-maintenance", + "commitMessageAction": "Lock file maintenance", + "commitMessageTopic": null, + "commitMessageExtra": null, + "schedule": [ + "twice a week" + ], + "groupName": "Bump versions in lock files", + "prBodyDefinitions": { + "Change": "All locks refreshed" + } + }, + + // Bump the versions even in other files: + "bumpVersions": [ + { + "name": "Update dependency versions in README.rst", + "filePatterns": ["README.rst"], + "matchStrings": [ + "cryptography>=(?\\d+\\.\\d+\\.\\d+)", + "aiolimiter~=(?\\d+\\.\\d+\\.\\d+)", + "tornado~=(?\\d+\\.\\d+)", + "cachetools>=(?\\d+\\.\\d+\\.\\d+)", // Lower bound only + "APScheduler>=(?\\d+\\.\\d+\\.\\d+)" // Lower bound only + ], + "bumpType": "minor" + } + ], + + // Renovate may change the schema or syntax, this option will make it so that Renovate creates a + // new PR to help us migrate to the new schema or syntax: + "configMigration": true, + + // Temporarily disabled: + "ignoreDeps": ["pytest-asyncio"], + + // schedule to allow PR's from Renovate: + "schedule": ["* * * * 0,6"] // Every weekend + +} From 060cd51c258def1ec0f0f2b07c670c9e9071a29e Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 30 Jul 2025 04:17:34 -0700 Subject: [PATCH 04/14] Use cron syntax for lock file schedule --- renovate.json5 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/renovate.json5 b/renovate.json5 index 37ceb640ab2..2c7482e3a95 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -23,9 +23,7 @@ "commitMessageAction": "Lock file maintenance", "commitMessageTopic": null, "commitMessageExtra": null, - "schedule": [ - "twice a week" - ], + "schedule": ["* * * * 1,4"], // Run sometime on Monday and Thursday "groupName": "Bump versions in lock files", "prBodyDefinitions": { "Change": "All locks refreshed" From 15a3e7c8e20df14c3225293c239e56d1d7411093 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 30 Jul 2025 04:31:38 -0700 Subject: [PATCH 05/14] Enable pre-commit-config yaml updates (beta) --- .pre-commit-config.yaml | 8 ++++---- renovate.json5 | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b091946e44..66cecfc8470 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,5 @@ -# Make sure that the additional_dependencies here match pyproject.toml - ci: autofix_prs: false - autoupdate_schedule: quarterly - autoupdate_commit_msg: 'Bump `pre-commit` Hooks to Latest Versions' repos: - repo: https://github.com/astral-sh/ruff-pre-commit @@ -11,6 +7,7 @@ repos: hooks: - id: ruff name: ruff + language: python additional_dependencies: - httpx~=0.27 - tornado~=6.4 @@ -33,6 +30,7 @@ repos: hooks: - id: pylint files: ^(?!(tests|docs)).*\.py$ + language: python additional_dependencies: - httpx~=0.27 - tornado~=6.4 @@ -46,6 +44,7 @@ repos: - id: mypy name: mypy-ptb files: ^(?!(tests|examples|docs)).*\.py$ + language: python additional_dependencies: - types-pytz - types-cryptography @@ -59,6 +58,7 @@ repos: - id: mypy name: mypy-examples files: ^examples/.*\.py$ + language: python args: - --no-strict-optional - --follow-imports=silent diff --git a/renovate.json5 b/renovate.json5 index 2c7482e3a95..6d60f3f1240 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -46,6 +46,11 @@ } ], + // Opt-in to updating the pre-commit-config.yaml file too: + "pre-commit": { + "enabled": true + }, + // Renovate may change the schema or syntax, this option will make it so that Renovate creates a // new PR to help us migrate to the new schema or syntax: "configMigration": true, From 891b7c9fa0326efc8db4978224c7bc4862493759 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 30 Jul 2025 16:30:40 -0700 Subject: [PATCH 06/14] Review: changelog, rm schedule in unit tests, add back pre-commit auto update --- .github/workflows/unit_tests.yml | 3 --- .pre-commit-config.yaml | 5 +++++ changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml | 2 +- renovate.json5 | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index a4fd47910c2..15f7675a126 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -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: {} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 66cecfc8470..5fb51595668 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,10 @@ 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 diff --git a/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml b/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml index ec7eab58c67..ecea6e10f9f 100644 --- a/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml +++ b/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml @@ -1,4 +1,4 @@ -other = "Configure Renovate" +internal = "Use Renovate to Keep Dependencies Up-To-Date" [[pull_requests]] uid = "4887" author_uid = "renovate[bot]" diff --git a/renovate.json5 b/renovate.json5 index 6d60f3f1240..aba250153fa 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -5,6 +5,7 @@ // Dependency Dashboards are Issues Renovate creates which list all pending updates. We disable it // because we don't need it, we can see the pending updates in the PRs. This is also noisy. // https://docs.renovatebot.com/configuration-options/#dependencydashboard + // Enabled for now to see how it works and if it's useful, we can disable it later if needed. // ":disableDependencyDashboard" ], From 6e671d8f3c498d7d95f9e52a58b63e5ec468bdb0 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Wed, 30 Jul 2025 16:32:03 -0700 Subject: [PATCH 07/14] Delete Dependabot files --- .github/dependabot.yml | 20 -------------- .github/workflows/dependabot-prs.yml | 41 ---------------------------- 2 files changed, 61 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/dependabot-prs.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index fb5b1d14166..00000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "weekly" - day: "friday" - labels: - - "⚙️ dependencies" - - "🔗 python" - - # Updates the dependencies of the GitHub Actions workflows - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "monthly" - day: "friday" - labels: - - "⚙️ dependencies" - - "🔗 github-actions" diff --git a/.github/workflows/dependabot-prs.yml b/.github/workflows/dependabot-prs.yml deleted file mode 100644 index 7c60835624c..00000000000 --- a/.github/workflows/dependabot-prs.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Process Dependabot PRs - -on: - pull_request: - types: [opened, reopened] - -permissions: {} - -jobs: - process-dependabot-prs: - permissions: - pull-requests: read - contents: write - - runs-on: ubuntu-latest - if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }} - steps: - - - name: Fetch Dependabot metadata - id: dependabot-metadata - uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0 - - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ github.event.pull_request.head.ref }} - persist-credentials: false - - - name: Update Version Number in Other Files - uses: jacobtomlinson/gha-find-replace@f1069b438f125e5395d84d1c6fd3b559a7880cb5 # v3 - with: - find: ${{ steps.dependabot-metadata.outputs.previous-version }} - replace: ${{ steps.dependabot-metadata.outputs.new-version }} - regex: false - exclude: CHANGES.rst - - - name: Commit & Push Changes to PR - uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 - with: - message: 'Update version number in other files' - committer_name: GitHub Actions - committer_email: 41898282+github-actions[bot]@users.noreply.github.com From dea7cfc5d41e5617eed77778ee62edfa59a066df Mon Sep 17 00:00:00 2001 From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Date: Thu, 31 Jul 2025 22:26:31 +0200 Subject: [PATCH 08/14] try fixing stuff for chango & pyright-type-completeness --- .github/workflows/chango.yml | 2 +- .github/workflows/type_completeness.yml | 2 +- .github/workflows/type_completeness_monthly.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/chango.yml b/.github/workflows/chango.yml index cba4fb7d7b3..35742d2cb65 100644 --- a/.github/workflows/chango.yml +++ b/.github/workflows/chango.yml @@ -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 diff --git a/.github/workflows/type_completeness.yml b/.github/workflows/type_completeness.yml index 56b57f5e539..947f931c2f8 100644 --- a/.github/workflows/type_completeness.yml +++ b/.github/workflows/type_completeness.yml @@ -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 diff --git a/.github/workflows/type_completeness_monthly.yml b/.github/workflows/type_completeness_monthly.yml index af7b6da7848..30a8a1c8a3b 100644 --- a/.github/workflows/type_completeness_monthly.yml +++ b/.github/workflows/type_completeness_monthly.yml @@ -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 From d1b89d87bd42391a02158c4df2a37c449299bfee Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Fri, 1 Aug 2025 12:31:54 -0700 Subject: [PATCH 09/14] Add the linting dependency group --- .readthedocs.yml | 2 +- pyproject.toml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 6d89b823dba..5e14cbfe2a2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index a333c0f662e..979d4b6f07f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,7 +135,13 @@ docs = [ # version is released. "pydantic @ git+https://github.com/pydantic/pydantic ; 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] From 0d874e5b1efaf4bd863583ec4ed6eda582aab8d6 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Sat, 2 Aug 2025 00:05:36 -0700 Subject: [PATCH 10/14] Try grouping updating of dependencies in one PR --- renovate.json5 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/renovate.json5 b/renovate.json5 index aba250153fa..d6d8efce9a8 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -47,6 +47,15 @@ } ], + // Group package updates together, so e.g. Ruff is updated in both pyproject.toml and pre-commit-config.yaml + // in one PR: + "packageRules": [ + { + "matchPackageNames": ["*"], + "groupName": "Upgrade {{packageName}} to {{newVersion}}" + } + ], + // Opt-in to updating the pre-commit-config.yaml file too: "pre-commit": { "enabled": true From f204c05627f44a65898589a9f68864517117337e Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Sat, 2 Aug 2025 00:06:28 -0700 Subject: [PATCH 11/14] Move renovate.json5 to .github --- renovate.json5 => .github/renovate.json5 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename renovate.json5 => .github/renovate.json5 (100%) diff --git a/renovate.json5 b/.github/renovate.json5 similarity index 100% rename from renovate.json5 rename to .github/renovate.json5 From d1b68d7fdc08202752652f3cb85f409ee0c94e0c Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Sat, 2 Aug 2025 01:51:22 -0700 Subject: [PATCH 12/14] Try a different grouping method? --- .github/renovate.json5 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index d6d8efce9a8..3109b63169f 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -7,6 +7,9 @@ // https://docs.renovatebot.com/configuration-options/#dependencydashboard // Enabled for now to see how it works and if it's useful, we can disable it later if needed. // ":disableDependencyDashboard" + + // Update the digest of the github action workflows to the latest version: + "helpers:pinGithubActionDigests" ], // Add pull request labels: @@ -15,6 +18,9 @@ // Bump even patch versions: "bumpVersion": "patch", + // Always bump the versions. See docs: https://docs.renovatebot.com/configuration-options/#rangestrategy + "rangeStrategy": "bump", + // Update the lock files: "lockFileMaintenance": { "enabled": true, @@ -47,11 +53,12 @@ } ], - // Group package updates together, so e.g. Ruff is updated in both pyproject.toml and pre-commit-config.yaml - // in one PR: + // Group package updates together: "packageRules": [ + // Linting dependencies in sync with the pre-commit-config hooks: { - "matchPackageNames": ["*"], + "matchDepTypes": ["mypy", "ruff", "pylint"], + "matchManagers": ["pre-commit", "pep621"], "groupName": "Upgrade {{packageName}} to {{newVersion}}" } ], From 5f68f6d1c2a30088c7a6e7114815b99dd1488728 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Sat, 2 Aug 2025 01:56:13 -0700 Subject: [PATCH 13/14] Fix renovate config --- .github/renovate.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 3109b63169f..1d817b6397c 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -9,7 +9,7 @@ // ":disableDependencyDashboard" // Update the digest of the github action workflows to the latest version: - "helpers:pinGithubActionDigests" + "helpers:pinGitHubActionDigests" ], // Add pull request labels: From b03e6300129a7e657718f4876eb0f380230ae52a Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Sun, 3 Aug 2025 23:08:18 -0700 Subject: [PATCH 14/14] Change renovate update strategy --- .github/renovate.json5 | 10 ++++++++-- pyproject.toml | 6 ++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 1d817b6397c..fd715acc45e 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -18,8 +18,8 @@ // Bump even patch versions: "bumpVersion": "patch", - // Always bump the versions. See docs: https://docs.renovatebot.com/configuration-options/#rangestrategy - "rangeStrategy": "bump", + // Let Renovate decide how to update. See docs: https://docs.renovatebot.com/configuration-options/#rangestrategy + "rangeStrategy": "auto", // Update the lock files: "lockFileMaintenance": { @@ -60,6 +60,12 @@ "matchDepTypes": ["mypy", "ruff", "pylint"], "matchManagers": ["pre-commit", "pep621"], "groupName": "Upgrade {{packageName}} to {{newVersion}}" + }, + // Replace the versions in the dependency-groups: + { + "matchManagers": ["pep621"], + "matchDepTypes": ["dependency-groups"], + "matchUpdateTypes": ["replacement"] // Replace the current version with new one } ], diff --git a/pyproject.toml b/pyproject.toml index 979d4b6f07f..7a2f78b03bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy