Skip to content

Commit 86de40c

Browse files
committed
Maintenance update of dependencies
1 parent a36e8ed commit 86de40c

File tree

11 files changed

+33
-55
lines changed

11 files changed

+33
-55
lines changed

.github/workflows/test-manual.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: ["3.10", "3.9", "3.8", "3.7"]
10+
python-version: ["3.12", "3.11", "3.10", "3.9", "3.8"]
1111
event-loop: [asyncio, uvloop]
1212

1313
steps:

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.10", "3.9", "3.8", "3.7"]
14+
python-version: ["3.12", "3.11", "3.10", "3.9", "3.8"]
1515
event-loop: [asyncio, uvloop]
1616

1717
steps:

CHANGELOG.rst

+9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
Changelog
22
*********
33

4+
`8.0.0`_ (2024-08-21)
5+
---------------------
6+
7+
- Add support for Python 3.10 and Python 3.11
8+
- Drop support for Python versions below 3.8
9+
- Bump dependencies
10+
411
`7.0.1`_ (2023-02-21)
12+
---------------------
513

614
- Fix parsing of unknown reception capabilities
715
- Add new `ReceptionCapability` items
@@ -85,6 +93,7 @@ Server:
8593

8694
- Initial publication on PyPI
8795

96+
.. _8.0.0: https://github.com/threema-ch/threema-msgapi-sdk-python/compare/v7.0.1...v8.0.0
8897
.. _7.0.1: https://github.com/threema-ch/threema-msgapi-sdk-python/compare/v6.0.0...v7.0.1
8998
.. _6.0.0: https://github.com/threema-ch/threema-msgapi-sdk-python/compare/v5.0.0...v6.0.0
9099
.. _5.0.0: https://github.com/threema-ch/threema-msgapi-sdk-python/compare/v4.0.0...v5.0.0

README.rst

-29
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
Threema Gateway API
22
===================
33

4-
|Travis| |codecov|
5-
64
**threema-gateway** is a Python 3 module for the Threema gateway service.
75
This API can be used to send and receive text messages to and from any Threema
86
user.
@@ -125,34 +123,7 @@ You should also run the type checker that might catch some additional bugs:
125123
126124
$ mypy setup.py tests examples threema
127125
128-
Reporting Security Issues
129-
*************************
130-
131-
Please report security issues directly to one or both of the following
132-
contacts:
133-
134-
- Danilo Bargen
135-
136-
137-
- Threema: EBEP4UCA
138-
- GPG: `EA456E8BAF0109429583EED83578F667F2F3A5FA`_
139-
140-
- Lennart Grahl
141-
142-
143-
- Threema: MSFVEW6C
144-
- GPG: `3FDB14868A2B36D638F3C495F98FBED10482ABA6`_
145-
146126
.. _asyncio: https://docs.python.org/3/library/asyncio.html
147127
.. _venv: https://docs.python.org/3/library/venv.html
148128
.. _virtualenvwrapper: https://virtualenvwrapper.readthedocs.io/
149129
.. _libsodium: https://download.libsodium.org/doc/installation/index.html
150-
151-
.. |Travis| image:: https://travis-ci.org/threema-ch/threema-msgapi-sdk-python.svg?branch=master
152-
:target: https://travis-ci.org/threema-ch/threema-msgapi-sdk-python
153-
.. |codecov| image:: https://codecov.io/gh/threema-ch/threema-msgapi-sdk-python/branch/master/graph/badge.svg
154-
:target: https://codecov.io/gh/threema-ch/threema-msgapi-sdk-python
155-
.. |PyPI| image:: https://badge.fury.io/py/threema.gateway.svg
156-
:target: https://badge.fury.io/py/threema.gateway
157-
.. _EA456E8BAF0109429583EED83578F667F2F3A5FA: https://keybase.io/dbrgn
158-
.. _3FDB14868A2B36D638F3C495F98FBED10482ABA6: https://keybase.io/lgrahl

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bdist_wheel]
2-
python-tag = py37.py38.py39.py310
2+
python-tag = py38.py39.py310.py311.py312
33

44
[flake8]
55
max-line-length = 90

setup.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ def read(file):
3838
# Note: These are just tools that aren't required, so a version range
3939
# is not necessary here.
4040
tests_require = [
41-
'pytest>=7.1.2,<8',
42-
'pytest-asyncio>=0.18.3,<0.19',
43-
'pytest-cov>=3.0.0,<4',
44-
'flake8==4.0.1',
45-
'isort==5.10.1',
41+
'pytest>=8.3.2,<9',
42+
'pytest-asyncio>=0.21.2,<0.23',
43+
'flake8==7.1.1',
44+
'isort==5.13.2',
4645
'collective.checkdocs>=0.2,<0.3',
47-
'Pygments>=2.12.0', # required by checkdocs
48-
'mypy==0.961',
46+
'Pygments>=2.18.0', # required by checkdocs
47+
'mypy==1.11.1',
4948
]
5049

5150
setup(
@@ -54,7 +53,7 @@ def read(file):
5453
packages=find_packages(include=["threema.*"]),
5554
install_requires=[
5655
'logbook>=1.1.0,<2',
57-
'libnacl>=1.5.2,<2',
56+
'libnacl>=1.5.2,<3',
5857
'click>=8,<9',
5958
'aiohttp>=3.7.3,<4',
6059
'wrapt>=1.10.10,<2',
@@ -73,7 +72,7 @@ def read(file):
7372

7473
# PyPI metadata
7574
author='Lennart Grahl',
76-
author_email='lennart.grahl@gmail.com',
75+
author_email='lennart.grahl@threema.ch',
7776
description=('An API for the Threema gateway service to send and receive '
7877
'messages including text, images, files and delivery reports.'),
7978
long_description=long_description,

tests/conftest.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,9 @@ def event_loop(request):
353353
"""
354354
default_event_loop(request=request)
355355

356-
# Close previous event loop
357-
policy = asyncio.get_event_loop_policy()
358-
policy.get_event_loop().close()
359-
360356
# Create new event loop
361-
_event_loop = policy.new_event_loop()
362-
policy.set_event_loop(_event_loop)
357+
_event_loop = asyncio.new_event_loop()
358+
asyncio.set_event_loop(_event_loop)
363359

364360
def fin():
365361
_event_loop.close()
@@ -383,8 +379,7 @@ async def start_server():
383379
runner = web.AppRunner(app)
384380
await runner.setup()
385381
site = web.TCPSite(
386-
runner, host=pytest.msgapi['msgapi']['ip'], port=port, shutdown_timeout=1.0
387-
)
382+
runner, host=pytest.msgapi['msgapi']['ip'], port=port, shutdown_timeout=1.0)
388383
await site.start()
389384
return app, runner, site
390385
app, runner, site = event_loop.run_until_complete(start_server())

tests/test_cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ async def test_invalid_id(self, cli):
252252
@pytest.mark.asyncio
253253
async def test_insufficient_credits(self, cli):
254254
with pytest.raises(subprocess.CalledProcessError) as exc_info:
255-
id_, secret = pytest.msgapi['msgapi']['nocredit_id'],\
255+
id_, secret = pytest.msgapi['msgapi']['nocredit_id'], \
256256
pytest.msgapi['msgapi']['secret']
257257
await cli('send-simple', 'ECHOECHO', id_, secret, input='!')
258258
assert 'Insufficient credits' in exc_info.value.output

threema/gateway/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
2020
The mode that you can use depends on the way your account was set up.
2121
22-
.. moduleauthor:: Lennart Grahl <lennart.grahl@gmail.com>
22+
.. moduleauthor:: Lennart Grahl <lennart.grahl@threema.ch>
2323
"""
2424
import itertools
2525

@@ -28,7 +28,7 @@
2828
from ._gateway import * # noqa
2929
from .exception import * # noqa
3030

31-
__author__ = 'Lennart Grahl <lennart.grahl@gmail.com>'
31+
__author__ = 'Lennart Grahl <lennart.grahl@threema.ch>'
3232
__status__ = 'Production'
3333
__version__ = '7.0.1'
3434
feature_level = 3

threema/gateway/_gateway.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import enum
2+
import io
23

34
import aiohttp
45
import libnacl.encode
@@ -293,7 +294,7 @@ async def upload(self, data):
293294
294295
Return the hex-encoded ID of the blob.
295296
"""
296-
return await self._upload(self.urls['upload_blob'], data)
297+
return await self._upload(self.urls['upload_blob'], data=io.BytesIO(data))
297298

298299
async def download(self, blob_id):
299300
"""

threema/gateway/e2e.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
import mimetypes
1414
import os
1515
import struct
16-
from typing import Tuple
16+
from typing import (
17+
Optional,
18+
Tuple,
19+
)
1720

1821
import libnacl
1922
import libnacl.encode
@@ -61,7 +64,7 @@
6164
MAX_HTTP_REQUEST_SIZE = 16384
6265

6366

64-
def _pk_encrypt(key_pair: Tuple[Key, Key], data: bytes, nonce: bytes = None):
67+
def _pk_encrypt(key_pair: Tuple[Key, Key], data: bytes, nonce: Optional[bytes] = None):
6568
"""
6669
Encrypt data by using public-key encryption.
6770

0 commit comments

Comments
 (0)