Skip to content

Update Test Dependencies versions #2925

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

Merged
merged 32 commits into from
May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e01602f
update deps ver in requirements & pre-commit
harshil21 Mar 8, 2022
cc2bee7
file update from black
harshil21 Mar 8, 2022
6a316ec
files updated from mypy
harshil21 Mar 8, 2022
2b7e6f5
update pytest.approx usage
harshil21 Mar 8, 2022
f1622ca
update black target versions
harshil21 Mar 8, 2022
0fcb735
upgrade pylint to 2.13.7 and enable useless-suppression
harshil21 Apr 27, 2022
0c769ea
update black to 22.3.0 and update related files
harshil21 Apr 27, 2022
ab44f54
bump sphinx, furo and mypy dep
harshil21 Apr 27, 2022
013bc82
update files updated by mypy
harshil21 Apr 27, 2022
cc5afa9
add isort
harshil21 Apr 27, 2022
7aaa2e0
update a lot of files from isort
harshil21 Apr 27, 2022
e7e6243
bump pytest to v7.1.2
harshil21 Apr 27, 2022
9db149c
change import style project wide
harshil21 Apr 27, 2022
b9ee9bf
review
harshil21 Apr 28, 2022
b74abc9
update more examples from pylint
harshil21 Apr 28, 2022
11d2c92
bump pyupgrade, pytest-asyncio, and test checkout versions
harshil21 Apr 28, 2022
1aaab00
remove pytest.mark.asyncio decorator
harshil21 Apr 28, 2022
4cce9a2
use asyncio sleep in bot tests and reduce sleep duration in few tests
harshil21 Apr 28, 2022
afc23aa
revert lowering of sleep in poll tests
harshil21 Apr 28, 2022
c35caf1
try making deepsource happy
Bibo-Joshi Apr 29, 2022
fb394f1
merge branch v14 and fix conflicts
harshil21 Apr 30, 2022
0febf5a
remove pre-commit from CI since we added pre-commit.ci
harshil21 Apr 30, 2022
9ce2514
try fixing test on windows
harshil21 Apr 30, 2022
03f89fd
fix tests on windows 3.8+
harshil21 May 1, 2022
6cbe6ec
fix stuck test on windows
harshil21 May 1, 2022
4327522
add CI-config to pre-commit.yaml
Bibo-Joshi May 2, 2022
622991e
Use call_after some more
Bibo-Joshi May 2, 2022
b7f195f
remove globally unused pylint ignores
Bibo-Joshi May 3, 2022
ee2b10c
Bump pylint again
Bibo-Joshi May 3, 2022
267c5d8
Merge branch 'v14' into upgrade-test-dep-ver
Bibo-Joshi May 3, 2022
0f63d4a
merge v14 and fix conflicts
harshil21 May 3, 2022
16b62d9
fix pre-commit
harshil21 May 3, 2022
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/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
os: [ubuntu-latest]
fail-fast: False
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Initialize vendored libs
run:
git submodule update --init --recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
31 changes: 5 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: False
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
shell: bash --noprofile --norc {0}

- name: Submit coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
name: ${{ matrix.os }}-${{ matrix.python-version }}
Expand All @@ -76,9 +76,9 @@ jobs:
os: [ubuntu-latest]
fail-fast: False
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -93,24 +93,3 @@ jobs:
env:
TEST_OFFICIAL: "true"
shell: bash --noprofile --norc {0}
test_pre_commit:
name: test-pre-commit
runs-on: ${{matrix.os}}
strategy:
matrix:
python-version: [3.7]
os: [ubuntu-latest]
fail-fast: False
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -W ignore -m pip install --upgrade pip
python -W ignore -m pip install -r requirements.txt
python -W ignore -m pip install -r requirements-dev.txt
- name: Run pre-commit tests
run: pre-commit run --all-files
25 changes: 18 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
# Make sure that
# * the revs specified here match requirements-dev.txt
# * the additional_dependencies here match requirements.txt

ci:
autofix_prs: false
autoupdate_schedule: monthly

repos:
- repo: https://github.com/psf/black
rev: 21.9b0
rev: 22.3.0
hooks:
- id: black
args:
- --diff
- --check
additional_dependencies:
- click==8.0.2
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/PyCQA/pylint
rev: v2.12.1
rev: v2.13.8
hooks:
- id: pylint
files: ^(telegram|examples)/.*\.py$
args:
- --rcfile=setup.cfg
# run pylint across multiple cpu cores to speed it up-
- --jobs=0 # See https://pylint.pycqa.org/en/latest/user_guide/run.html?#parallel-execution to know more
# https://pylint.pycqa.org/en/latest/user_guide/run.html?#parallel-execution to know more
- --jobs=0

additional_dependencies:
- httpx~=0.22.0
- tornado~=6.1
- APScheduler~=3.9.1
- cachetools~=5.0.0
- . # this basically does `pip install -e .`
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
rev: v0.950
hooks:
- id: mypy
name: mypy-ptb
Expand All @@ -58,9 +63,15 @@ repos:
- cachetools~=5.0.0
- . # this basically does `pip install -e .`
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
rev: v2.32.0
hooks:
- id: pyupgrade
files: ^(telegram|examples|tests)/.*\.py$
args:
- --py37-plus
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
name: isort
args: ["--diff"] # -diff will not apply the changes, just show them
4 changes: 2 additions & 2 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sphinx==4.4.0
sphinx==4.5.0
sphinx-pypi-upload
furo==2022.1.2
furo==2022.04.07
# Can be replaced with a sphinx-paramlinks==... dependency once a version is released that
# includes the commit mentioned below and maybe even
# https://github.com/sqlalchemyorg/sphinx-paramlinks/pull/14
Expand Down
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import subprocess
import inspect
import os
import re
import subprocess
import sys
import os
import inspect
from enum import Enum
from pathlib import Path
from typing import Tuple
Expand All @@ -34,7 +34,7 @@
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '4.3.2'
needs_sphinx = '4.5.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down
9 changes: 4 additions & 5 deletions examples/arbitrarycallbackdatabot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# pylint: disable=missing-function-docstring, unused-argument
# pylint: disable=unused-argument
# This program is dedicated to the public domain under the CC0 license.

"""This example showcases how PTBs "arbitrary callback data" feature can be used.
Expand All @@ -12,15 +12,14 @@

from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.ext import (
CommandHandler,
Application,
CallbackContext,
CallbackQueryHandler,
CommandHandler,
InvalidCallbackData,
PicklePersistence,
Application,
CallbackContext,
)


# Enable logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO
Expand Down
41 changes: 14 additions & 27 deletions examples/chatmemberbot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# pylint: disable=missing-function-docstring, unused-argument
# pylint: disable=unused-argument
# This program is dedicated to the public domain under the CC0 license.

"""
Expand All @@ -12,16 +12,11 @@
"""

import logging
from typing import Tuple, Optional
from typing import Optional, Tuple

from telegram import Update, Chat, ChatMember, ChatMemberUpdated
from telegram import Chat, ChatMember, ChatMemberUpdated, Update
from telegram.constants import ParseMode
from telegram.ext import (
CommandHandler,
ChatMemberHandler,
Application,
CallbackContext,
)
from telegram.ext import Application, CallbackContext, ChatMemberHandler, CommandHandler

# Enable logging

Expand All @@ -46,24 +41,16 @@ def extract_status_change(
return None

old_status, new_status = status_change
was_member = (
old_status
in [
ChatMember.MEMBER,
ChatMember.OWNER,
ChatMember.ADMINISTRATOR,
]
or (old_status == ChatMember.RESTRICTED and old_is_member is True)
)
is_member = (
new_status
in [
ChatMember.MEMBER,
ChatMember.OWNER,
ChatMember.ADMINISTRATOR,
]
or (new_status == ChatMember.RESTRICTED and new_is_member is True)
)
was_member = old_status in [
ChatMember.MEMBER,
ChatMember.OWNER,
ChatMember.ADMINISTRATOR,
] or (old_status == ChatMember.RESTRICTED and old_is_member is True)
is_member = new_status in [
ChatMember.MEMBER,
ChatMember.OWNER,
ChatMember.ADMINISTRATOR,
] or (new_status == ChatMember.RESTRICTED and new_is_member is True)

return was_member, is_member

Expand Down
12 changes: 6 additions & 6 deletions examples/contexttypesbot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# pylint: disable=missing-function-docstring, unused-argument
# pylint: disable=unused-argument
# This program is dedicated to the public domain under the CC0 license.

"""
Expand All @@ -14,16 +14,16 @@
from collections import defaultdict
from typing import DefaultDict, Optional, Set

from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.constants import ParseMode
from telegram.ext import (
CommandHandler,
Application,
CallbackContext,
ContextTypes,
CallbackQueryHandler,
TypeHandler,
CommandHandler,
ContextTypes,
ExtBot,
Application,
TypeHandler,
)

# Enable logging
Expand Down
9 changes: 4 additions & 5 deletions examples/conversationbot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# pylint: disable=missing-function-docstring, unused-argument
# pylint: disable=unused-argument
# This program is dedicated to the public domain under the CC0 license.

"""
Expand All @@ -18,15 +18,14 @@

from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove, Update
from telegram.ext import (
Application,
CallbackContext,
CommandHandler,
ConversationHandler,
MessageHandler,
filters,
ConversationHandler,
Application,
CallbackContext,
)


# Enable logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO
Expand Down
11 changes: 5 additions & 6 deletions examples/conversationbot2.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# pylint: disable=missing-function-docstring, unused-argument
# pylint: disable=unused-argument
# This program is dedicated to the public domain under the CC0 license.

"""
Expand All @@ -17,17 +17,16 @@
import logging
from typing import Dict

from telegram import ReplyKeyboardMarkup, Update, ReplyKeyboardRemove
from telegram import ReplyKeyboardMarkup, ReplyKeyboardRemove, Update
from telegram.ext import (
Application,
CallbackContext,
CommandHandler,
ConversationHandler,
MessageHandler,
filters,
ConversationHandler,
Application,
CallbackContext,
)


# Enable logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO
Expand Down
10 changes: 5 additions & 5 deletions examples/deeplinking.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# pylint: disable=missing-function-docstring, unused-argument
# pylint: disable=unused-argument
# This program is dedicated to the public domain under the CC0 license.

"""Bot that explains Telegram's "Deep Linking Parameters" functionality.
Expand All @@ -20,14 +20,14 @@

import logging

from telegram import InlineKeyboardMarkup, InlineKeyboardButton, Update, helpers
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update, helpers
from telegram.constants import ParseMode
from telegram.ext import (
CommandHandler,
CallbackQueryHandler,
filters,
Application,
CallbackContext,
CallbackQueryHandler,
CommandHandler,
filters,
)

# Enable logging
Expand Down
13 changes: 3 additions & 10 deletions examples/echobot.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# pylint: disable=missing-function-docstring, unused-argument
# pylint: disable=unused-argument
# This program is dedicated to the public domain under the CC0 license.

"""
Expand All @@ -17,15 +17,8 @@

import logging

from telegram import Update, ForceReply
from telegram.ext import (
CommandHandler,
MessageHandler,
filters,
Application,
CallbackContext,
)

from telegram import ForceReply, Update
from telegram.ext import Application, CallbackContext, CommandHandler, MessageHandler, filters

# Enable logging
logging.basicConfig(
Expand Down
Loading