Skip to content

Commit 46ce6a1

Browse files
RayJWlgrahl
andcommitted
Update docs and bump click dependency
Breaking: This changes the CLI command syntax from snake_case to dash-case Co-authored-by: Lennart Grahl <lennart.grahl@gmail.com>
1 parent e175083 commit 46ce6a1

6 files changed

Lines changed: 46 additions & 33 deletions

File tree

CHANGELOG.rst

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,38 @@
11
Changelog
22
*********
33

4+
`6.0.0`_ (TBD)
5+
--------------
6+
7+
General:
8+
9+
- Add support for Python 3.10
10+
- Drop support for Python versions below 3.7
11+
- Major dependencies bump to increase compatibility with other packages
12+
- Updated all tests to work with the newest dependencies
13+
- Changed CLI syntax: All commands are now `dash-case` instead of `snake_case`,
14+
e.g. the `send_e2e` command is now called `send-e2e`.
15+
16+
417
`5.0.0`_ (2021-05-17)
518
---------------------
619

7-
- Added custom session and session arguments to `Connection` (#55, #56)
8-
- Removed the `fingerprint` and `verify_fingerprint` arguments, see #55 for a
20+
- Add custom session and session arguments to `Connection` (#55, #56)
21+
- Remove the `fingerprint` and `verify_fingerprint` arguments, see #55 for a
922
detailed explanation and how to achieve pinning
1023

1124
`4.0.0`_ (2021-01-23)
1225
---------------------
1326

1427
General:
1528

16-
- Dropped support for Python versions below 3.6.1.
17-
- Deprecated `ReceiptType.user_ack` has been removed. Use
29+
- Drop support for Python versions below 3.6.1.
30+
- Remove `ReceiptType.user_ack` after deprecation. Use
1831
`ReceiptType.user_acknowledge` instead.
19-
- `util.aio_run` has been simplified. It does not allow for passing a specific
20-
event loop or closing the event loop on completion any longer.
21-
- `util.aio_run_proxy_decorator` has been renamed to `aio_run_proxy` and now
22-
always creates the class instance within a running event loop.
32+
- Simplify `util.aio_run`. It does not allow for passing a specific event loop
33+
or closing the event loop on completion any longer.
34+
- Rename `util.aio_run_proxy_decorator` to `aio_run_proxy`. It now always
35+
creates the class instance within a running event loop.
2336

2437
Client:
2538

@@ -66,6 +79,7 @@ Server:
6679

6780
- Initial publication on PyPI
6881

82+
.. _6.0.0: https://github.com/lgrahl/threema-msgapi-sdk-python/compare/v5.0.0...v6.0.0
6983
.. _5.0.0: https://github.com/lgrahl/threema-msgapi-sdk-python/compare/v4.0.0...v5.0.0
7084
.. _4.0.0: https://github.com/lgrahl/threema-msgapi-sdk-python/compare/v3.1.0...v4.0.0
7185
.. _3.1.0: https://github.com/lgrahl/threema-msgapi-sdk-python/compare/v3.0.6...v3.1.0

RELEASING.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
Release Process
22
===============
33

4-
Signing key: https://lgrahl.de/pub/pgp-key.txt
4+
Signing key: <https://lgrahl.de/pub/pgp-key.txt>
55

66
1. Check the code:
77

88
```bash
99
flake8 .
10-
isort -rc -c . || isort -rc -df
10+
isort -c . || isort --df .
1111
mypy setup.py tests examples threema
1212
py.test
1313
```
@@ -26,11 +26,11 @@ Signing key: https://lgrahl.de/pub/pgp-key.txt
2626

2727
4. Do a signed commit and signed tag of the release:
2828

29-
```bash
30-
git add threema/gateway/__init__.py CHANGELOG.rst
31-
git commit -S${GPG_KEY} -m "Release v${VERSION}"
32-
git tag -u ${GPG_KEY} -m "Release v${VERSION}" v${VERSION}
33-
```
29+
```bash
30+
git add threema/gateway/__init__.py CHANGELOG.rst
31+
git commit -S${GPG_KEY} -m "Release v${VERSION}"
32+
git tag -u ${GPG_KEY} -m "Release v${VERSION}" v${VERSION}
33+
```
3434

3535
5. Build source and binary distributions:
3636

@@ -69,4 +69,3 @@ Signing key: https://lgrahl.de/pub/pgp-key.txt
6969
```
7070

7171
10. Pat yourself on the back and celebrate!
72-

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[mypy]
2-
python_version = 3.7
2+
python_version = 3.10
33
ignore_missing_imports = True

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def read(file):
4242
'pytest-cov>=3.0.0,<4',
4343
'flake8==4.0.1',
4444
'isort==5.10.1',
45-
'collective.checkdocs>=0.2',
45+
'collective.checkdocs>=0.2,<0.3',
4646
'Pygments>=2.12.0', # required by checkdocs
4747
'mypy==0.961',
4848
]
@@ -54,7 +54,7 @@ def read(file):
5454
install_requires=[
5555
'logbook>=1.1.0,<2',
5656
'libnacl>=1.5.2,<2',
57-
'click>=6.7,<7', # doesn't seem to follow semantic versioning
57+
'click>=8,<9',
5858
'aiohttp>=3.7.3,<4',
5959
'wrapt>=1.10.10,<2',
6060
],

tests/test_cli.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,18 @@ async def test_derive(self, cli):
9191
@pytest.mark.asyncio
9292
async def test_send_simple(self, cli):
9393
id_, secret = pytest.msgapi['msgapi']['id'], pytest.msgapi['msgapi']['secret']
94-
output = await cli('send_simple', 'ECHOECHO', id_, secret, input='Hello!')
94+
output = await cli('send-simple', 'ECHOECHO', id_, secret, input='Hello!')
9595
assert output
9696

9797
@pytest.mark.asyncio
9898
async def test_send_e2e(self, cli, server):
9999
output_1 = await cli(
100-
'send_e2e', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
100+
'send-e2e', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
101101
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
102102
input='Hello!')
103103
assert output_1
104104
output_2 = await cli(
105-
'send_e2e', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
105+
'send-e2e', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
106106
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'], '-k',
107107
server.echoecho_encoded_key, input='Hello!')
108108
assert output_2
@@ -112,13 +112,13 @@ async def test_send_e2e(self, cli, server):
112112
async def test_send_image(self, cli, server):
113113
server.latest_blob_ids = []
114114
output_1 = await cli(
115-
'send_image', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
115+
'send-image', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
116116
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
117117
server.threema_jpg)
118118
assert output_1
119119
assert len(server.latest_blob_ids) == 1
120120
output_2 = await cli(
121-
'send_image', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
121+
'send-image', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
122122
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
123123
server.threema_jpg, '-k', server.echoecho_encoded_key)
124124
assert output_2
@@ -129,20 +129,20 @@ async def test_send_image(self, cli, server):
129129
async def test_send_video(self, cli, server):
130130
server.latest_blob_ids = []
131131
output_1 = await cli(
132-
'send_video', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
132+
'send-video', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
133133
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
134134
server.threema_mp4, server.threema_jpg)
135135
assert output_1
136136
assert len(server.latest_blob_ids) == 2
137137
output_2 = await cli(
138-
'send_video', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
138+
'send-video', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
139139
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
140140
server.threema_mp4, server.threema_jpg, '-k', server.echoecho_encoded_key)
141141
assert output_2
142142
assert output_1 == output_2
143143
assert len(server.latest_blob_ids) == 4
144144
output = await cli(
145-
'send_video', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
145+
'send-video', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
146146
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
147147
server.threema_mp4, server.threema_jpg, '-d', '1337')
148148
assert output
@@ -152,26 +152,26 @@ async def test_send_video(self, cli, server):
152152
async def test_send_file(self, cli, server):
153153
server.latest_blob_ids = []
154154
output_1 = await cli(
155-
'send_file', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
155+
'send-file', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
156156
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
157157
server.threema_jpg)
158158
assert output_1
159159
assert len(server.latest_blob_ids) == 1
160160
output_2 = await cli(
161-
'send_file', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
161+
'send-file', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
162162
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
163163
server.threema_jpg, '-k', server.echoecho_encoded_key)
164164
assert output_2
165165
assert output_1 == output_2
166166
assert len(server.latest_blob_ids) == 2
167167
output = await cli(
168-
'send_file', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
168+
'send-file', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
169169
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
170170
server.threema_jpg, '-t', server.threema_jpg)
171171
assert output
172172
assert len(server.latest_blob_ids) == 4
173173
output = await cli(
174-
'send_file', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
174+
'send-file', 'ECHOECHO', pytest.msgapi['msgapi']['id'],
175175
pytest.msgapi['msgapi']['secret'], pytest.msgapi['msgapi']['private'],
176176
server.threema_jpg, '-k', server.echoecho_encoded_key, '-t',
177177
server.threema_jpg)
@@ -253,5 +253,5 @@ async def test_insufficient_credits(self, cli):
253253
with pytest.raises(subprocess.CalledProcessError) as exc_info:
254254
id_, secret = pytest.msgapi['msgapi']['nocredit_id'],\
255255
pytest.msgapi['msgapi']['secret']
256-
await cli('send_simple', 'ECHOECHO', id_, secret, input='!')
256+
await cli('send-simple', 'ECHOECHO', id_, secret, input='!')
257257
assert 'Insufficient credits' in exc_info.value.output

threema/gateway/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
__author__ = 'Lennart Grahl <lennart.grahl@gmail.com>'
3232
__status__ = 'Production'
33-
__version__ = '5.0.0'
33+
__version__ = '6.0.0'
3434
feature_level = 3
3535

3636
__all__ = tuple(itertools.chain(

0 commit comments

Comments
 (0)