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/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 00000000000..fd715acc45e --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,87 @@ +{ + "$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 + // 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: + "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", + + // Update the lock files: + "lockFileMaintenance": { + "enabled": true, + "recreateWhen": "always", + "rebaseStalePrs": true, + "branchTopic": "lock-file-maintenance", + "commitMessageAction": "Lock file maintenance", + "commitMessageTopic": null, + "commitMessageExtra": null, + "schedule": ["* * * * 1,4"], // Run sometime on Monday and Thursday + "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" + } + ], + + // Group package updates together: + "packageRules": [ + // Linting dependencies in sync with the pre-commit-config hooks: + { + "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 + } + ], + + // 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, + + // Temporarily disabled: + "ignoreDeps": ["pytest-asyncio"], + + // schedule to allow PR's from Renovate: + "schedule": ["* * * * 0,6"] // Every weekend + +} 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/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 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 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 474dd749adb..5ed7d73a8b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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' @@ -11,14 +12,18 @@ repos: hooks: # Run the linter: - id: ruff-check - name: ruff + name: ruff check + language: python # Run the formatter: - id: ruff-format + name: ruff format + language: python - 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 @@ -32,6 +37,7 @@ repos: - id: mypy name: mypy-ptb files: ^(?!(tests|examples|docs)).*\.py$ + language: python additional_dependencies: - types-pytz - types-cryptography @@ -45,6 +51,7 @@ repos: - id: mypy name: mypy-examples files: ^examples/.*\.py$ + language: python args: - --no-strict-optional - --follow-imports=silent 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/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml b/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml new file mode 100644 index 00000000000..ecea6e10f9f --- /dev/null +++ b/changes/unreleased/4887.5yypYZV7Sq5PN4ihmf2NUr.toml @@ -0,0 +1,5 @@ +internal = "Use Renovate to Keep Dependencies Up-To-Date" +[[pull_requests]] +uid = "4887" +author_uid = "renovate[bot]" +closes_threads = [] diff --git a/pyproject.toml b/pyproject.toml index a179a5f4114..fff131daf50 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 = [ @@ -135,7 +133,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] 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