Skip to content

Commit 1b66b72

Browse files
committed
Merge branch 'master' into menu-poc
# Conflicts: # telegram/ext/handler.py
2 parents bf0a9e8 + a2c0431 commit 1b66b72

File tree

368 files changed

+18653
-12464
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+18653
-12464
lines changed

.codeclimate.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
languages:
2-
Python: true
31
exclude_paths:
4-
- "telegram/emoji.py"
52
- "tests/*"
3+
- "examples/*"
4+
engines:
5+
duplication:
6+
enabled: true
7+
config:
8+
languages:
9+
- python:
10+
checks:
11+
Similar code:
12+
enabled: false
13+
14+
radon:
15+
enabled: true
16+
config:
17+
threshold: "C"
18+
ratings:
19+
paths:
20+
- "**.py"

.coveragerc

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/CONTRIBUTING.rst

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
How To Contribute
2-
===================
2+
=================
33

44
Every open source project lives from the generous help by contributors that sacrifice their time and ``python-telegram-bot`` is no different. To make participation as pleasant as possible, this project adheres to the `Code of Conduct`_ by the Python Software Foundation.
55

66
Setting things up
7-
-------------------
7+
-----------------
88

99
1. Fork the ``python-telegram-bot`` repository to your GitHub account.
1010

1111
2. Clone your forked repository of ``python-telegram-bot`` to your computer:
1212

1313
.. code-block:: bash
1414
15-
$ git clone https://github.com/<your username>/python-telegram-bot
15+
$ git clone https://github.com/<your username>/python-telegram-bot --recursive
1616
$ cd python-telegram-bot
1717
1818
3. Add a track to the original repository:
@@ -35,7 +35,7 @@ Setting things up
3535
$ pre-commit install
3636
3737
Finding something to do
38-
###################
38+
#######################
3939

4040
If you already know what you'd like to work on, you can skip this section.
4141

@@ -44,7 +44,7 @@ If you have an idea for something to do, first check if it's already been filed
4444
Another great way to start contributing is by writing tests. Tests are really important because they help prevent developers from accidentally breaking existing code, allowing them to build cool things faster. If you're interested in helping out, let the development team know by posting to the `developers' mailing list`_, and we'll help you get started.
4545

4646
Instructions for making a code change
47-
####################
47+
#####################################
4848

4949
The central development branch is ``master``, which should be clean and ready for release at any time. In general, all changes should be done as feature branches based off of ``master``.
5050

@@ -89,7 +89,7 @@ Here's how to make a one-off code change.
8989

9090
.. code-block::
9191
92-
$ nosetests -v
92+
$ pytest -v
9393
9494
- To actually make the commit (this will trigger tests for yapf, lint and pep8 automatically):
9595

@@ -129,13 +129,19 @@ Here's how to make a one-off code change.
129129

130130
.. code-block:: bash
131131
132-
$ git checkout your-branch-name
133-
$ git fetch upstream
134-
$ git merge upstream/master
135-
$ ...[fix the conflicts]...
136-
$ ...[make sure the tests pass before committing]...
137-
$ git commit -a
138-
$ git push origin your-branch-name
132+
$ git checkout your-branch-name
133+
$ git fetch upstream
134+
$ git merge upstream/master
135+
$ ...[fix the conflicts]...
136+
$ ...[make sure the tests pass before committing]...
137+
$ git commit -a
138+
$ git push origin your-branch-name
139+
140+
- If after merging you see local modified files in ``telegram/vendor/`` directory, that you didn't actually touch, that means you need to update submodules with this command:
141+
142+
.. code-block:: bash
143+
144+
$ git submodule update --init --recursive
139145
140146
- At the end, the reviewer will merge the pull request.
141147

@@ -149,20 +155,29 @@ Here's how to make a one-off code change.
149155
7. **Celebrate.** Congratulations, you have contributed to ``python-telegram-bot``!
150156

151157
Style commandments
152-
---------------------
158+
------------------
153159

154160
Specific commandments
155161
#####################
156162

157163
- Avoid using "double quotes" where you can reasonably use 'single quotes'.
158164

159-
AssertEqual argument order
160-
######################
165+
Assert comparison order
166+
#######################
161167

162-
- assertEqual method's arguments should be in ('actual', 'expected') order.
168+
- assert statements should compare in **actual** == **expected** order.
169+
For example (assuming ``test_call`` is the thing being tested):
170+
171+
.. code-block:: python
172+
173+
# GOOD
174+
assert test_call() == 5
175+
176+
# BAD
177+
assert 5 == test_call()
163178
164179
Properly calling callables
165-
#######################
180+
##########################
166181

167182
Methods, functions and classes can specify optional parameters (with default
168183
values) using Python's keyword arg syntax. When providing a value to such a
@@ -180,7 +195,7 @@ This gives us the flexibility to re-order arguments and more importantly
180195
to add new required arguments. It's also more explicit and easier to read.
181196

182197
Properly defining optional arguments
183-
########################
198+
####################################
184199

185200
It's always good to not initialize optional arguments at class creation,
186201
instead use ``**kwargs`` to get them. It's well known Telegram API can

.github/ISSUE_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<!--
22
Thanks for reporting issues of python-telegram-bot!
3+
4+
Use this template to notify us if you found a bug, or if you want to request a new feature.
5+
If you're looking for help with programming your bot using our library, feel free to ask your
6+
questions in out telegram group at: https://t.me/pythontelegrambotgroup
7+
38
To make it easier for us to help you please enter detailed information below.
49
510
Please note, we only support the latest version of python-telegram-bot and

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ target/
6565
# unitests files
6666
telegram.mp3
6767
telegram.mp4
68+
telegram2.mp4
6869
telegram.ogg
6970
telegram.png
7071
telegram.webp
72+
telegram.jpg
7173

7274
# original files from merges
7375
*.orig

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
- repo: git://github.com/python-telegram-bot/mirrors-yapf
2-
sha: v0.12.2
2+
sha: master
33
hooks:
44
- id: yapf
55
files: ^(telegram|tests)/.*\.py$
66
args:
77
- --diff
88
- repo: git://github.com/pre-commit/pre-commit-hooks
9-
sha: 18d7035de5388cc7775be57f529c154bf541aab9
9+
sha: 78818b90cd694c29333ba54d38f9e60b6359ccfc
1010
hooks:
1111
- id: flake8
1212
files: ^telegram/.*\.py$
1313
- repo: git://github.com/pre-commit/mirrors-pylint
14-
sha: v1.5.5
14+
sha: v1.7.1
1515
hooks:
1616
- id: pylint
1717
files: ^telegram/.*\.py$
1818
args:
1919
- --errors-only
20-
- --disable=no-name-in-module,import-error
20+
- --disable=import-error

.readthedocs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# syntax: https://docs.readthedocs.io/en/latest/yaml-config.html
2+
3+
formats:
4+
- pdf
5+
6+
python:
7+
setup_py_install: true
8+
9+
requirements_file: docs/requirements-docs.txt

.travis.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
11
language: python
22
python:
33
- "2.7"
4-
- "3.3"
54
- "3.4"
65
- "3.5"
76
- "3.6"
8-
- "pypy"
9-
- "pypy3"
7+
- "pypy-5.7.1"
8+
- "pypy3.5-5.8.0"
9+
10+
dist: trusty
11+
sudo: false
12+
1013
branches:
1114
only:
1215
- master
16+
17+
cache:
18+
directories:
19+
- $HOME/.cache/pip
20+
- $HOME/.pre-commit
21+
before_cache:
22+
- rm -f $HOME/.cache/pip/log/debug.log
23+
- rm -f $HOME/.pre-commit/pre-commit.log
24+
1325
install:
14-
- pip install coveralls
15-
- pip install -r requirements.txt
16-
- pip install -r requirements-dev.txt
26+
- pip install -U codecov pytest-cov
27+
- pip install -U wheel
28+
- pip install -U -r requirements.txt
29+
- pip install -U -r requirements-dev.txt
1730
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then pip install ujson; fi
31+
1832
script:
19-
- nosetests -v --with-flaky --no-flaky-report --with-coverage --cover-package=telegram/ tests
20-
- if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then pre-commit run --all-files; fi
33+
- pytest -v -m nocoverage
34+
- pytest -v -m "not nocoverage" --cov
35+
2136
after_success:
22-
coveralls
37+
- coverage combine
38+
- codecov -F Travis

AUTHORS.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,32 @@ Contributors
1515

1616
The following wonderful people contributed directly or indirectly to this project:
1717

18-
- `Avanatiker <https://github.com/Avanatiker>`_
18+
- `Alateas <https://github.com/alateas>`_
1919
- `Anton Tagunov <https://github.com/anton-tagunov>`_
20+
- `Avanatiker <https://github.com/Avanatiker>`_
2021
- `Balduro <https://github.com/Balduro>`_
2122
- `bimmlerd <https://github.com/bimmlerd>`_
2223
- `d-qoi <https://github.com/d-qoi>`_
2324
- `daimajia <https://github.com/daimajia>`_
25+
- `Daniel Reed <https://github.com/nmlorg>`_
2426
- `Eli Gao <https://github.com/eligao>`_
2527
- `ErgoZ Riftbit Vaper <https://github.com/ergoz>`_
2628
- `Eugene Lisitsky <https://github.com/lisitsky>`_
29+
- `Eugenio Panadero <https://github.com/azogue>`_
2730
- `evgfilim1 <https://github.com/evgfilim1>`_
2831
- `franciscod <https://github.com/franciscod>`_
2932
- `Hugo Damer <https://github.com/HakimusGIT>`_
33+
- `ihoru <https://github.com/ihoru>`_
3034
- `Jacob Bom <https://github.com/bomjacob>`_
3135
- `JASON0916 <https://github.com/JASON0916>`_
36+
- `jeffffc <https://github.com/jeffffc>`_
37+
- `Jelle Besseling <https://github.com/pingiun>`_
3238
- `jh0ker <https://github.com/jh0ker>`_
39+
- `jlmadurga <https://github.com/jlmadurga>`_
3340
- `John Yong <https://github.com/whipermr5>`_
41+
- `Joscha Götzer <https://github.com/Rostgnom>`_
3442
- `jossalgon <https://github.com/jossalgon>`_
3543
- `JRoot3D <https://github.com/JRoot3D>`_
36-
- `jlmadurga <https://github.com/jlmadurga>`_
3744
- `Kjwon15 <https://github.com/kjwon15>`_
3845
- `Li-aung Yip <https://github.com/LiaungYip>`_
3946
- `macrojames <https://github.com/macrojames>`_
@@ -47,8 +54,9 @@ The following wonderful people contributed directly or indirectly to this projec
4754
- `Patrick Hofmann <https://github.com/PH89>`_
4855
- `Pieter Schutz <https://github.com/eldinnie>`_
4956
- `Rahiel Kasim <https://github.com/rahiel>`_
50-
- `Joscha Götzer <https://github.com/Rostgnom>`_
57+
- `Sascha <https://github.com/saschalalala>`_
5158
- `Shelomentsev D <https://github.com/shelomentsevd>`_
59+
- `Simon Schürrle <https://github.com/SitiSchu>`_
5260
- `sooyhwang <https://github.com/sooyhwang>`_
5361
- `thodnev <https://github.com/thodnev>`_
5462
- `Valentijn <https://github.com/Faalentijn>`_

0 commit comments

Comments
 (0)