Skip to content

Configure Renovate #4887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
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
20 changes: 0 additions & 20 deletions .github/dependabot.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -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>=(?<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 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

}
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
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: 10 additions & 3 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,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
Expand All @@ -32,6 +37,7 @@ repos:
- id: mypy
name: mypy-ptb
files: ^(?!(tests|examples|docs)).*\.py$
language: python
additional_dependencies:
- types-pytz
- types-cryptography
Expand All @@ -45,6 +51,7 @@ repos:
- id: mypy
name: mypy-examples
files: ^examples/.*\.py$
language: python
args:
- --no-strict-optional
- --follow-imports=silent
Expand Down
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 @@ -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]
Expand Down
Loading
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