aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-matrix-nio/0001-CI-Fix-our-tox-setup-for-github-CI.patch
blob: 1e29a557779893e16f8bdd378f5c3b3bfc44361c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Newbyte's note: This patch has been modified to not drop setup.py
Reason it is included because in the latest release of matrix-nio
the tests expect an older version of aioresponses. This patch makes them
support the most recent release of aioresponses, and should probably be
dropped with the next release of matrix-nio.

From 1662375abba8ebe9d513da24b938f1381d96416a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Damir=20Jeli=C4=87?= <poljar@termina.org.uk>
Date: Sat, 7 Nov 2020 16:36:23 +0100
Subject: [PATCH] CI: Fix our tox setup for github CI.

---
 pyproject.toml             |  8 +++----
 test-requirements.txt      |  8 +++----
 tests/async_client_test.py |  6 ++---
 tox.ini                    | 16 +++++---------
 4 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index 557943c..786d0f2 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,7 @@
+[build-system]
+requires = ["poetry_core>=1.0.0"]
+build-backend = "poetry.core.masonry.api"
+
 [tool.poetry]
 name = "matrix-nio"
 version = "0.15.2"
@@ -41,7 +45,3 @@ hpack = "^3.0.0"
 faker = "^4.0.2"
 mypy = "^0.770"
 pytest-aiohttp = "^0.3.0"
-
-[build-system]
-requires = ["poetry>=0.12"]
-build-backend = "poetry.masonry.api"
diff --git a/test-requirements.txt b/test-requirements.txt
index 3984633..d085901 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -8,10 +8,10 @@ hypothesis
 hpack
 faker
 mypy
-mypy_extensions>=0.4.3,<0.5.0
-aiohttp; python_version >= '3.5'
-pytest-aiohttp; python_version >= '3.5'
-aioresponses <= 0.6.1; python_version >= '3.5'
+mypy_extensions
+aiohttp
+pytest-aiohttp
+aioresponses
 python-olm >= '3.1.0'
 peewee >= '3.9.5'
 atomicwrites
diff --git a/tests/async_client_test.py b/tests/async_client_test.py
index 407f41e..7e54060 100644
--- a/tests/async_client_test.py
+++ b/tests/async_client_test.py
@@ -735,7 +735,7 @@ class TestClass:
         # Test with filter ID
 
         aioresponse.get(
-            re.compile(fr"{url}&filter=test_id&since=.*"),
+            re.compile(fr"{url}&filter=test_id&since=[\w\d_]*"),
             status=200,
             payload=self.sync_response
         )
@@ -745,7 +745,7 @@ class TestClass:
         # Test with filter dict
 
         aioresponse.get(
-            re.compile(url + r"&filter=" + quote("{}") + "&since=.*"),
+            re.compile(fr"{url}&filter=[\w\d%]*&since=[\w\d_]*"),
             status=200,
             payload=self.sync_response,
         )
@@ -1793,7 +1793,7 @@ class TestClass:
 
         session = ClientSession()
         context = Context()
-        params  = TraceRequestChunkSentParams(chunk=b"x")
+        params = TraceRequestChunkSentParams(method="POST", url="test", chunk=b"x")
 
         await on_request_chunk_sent(session, context, params)
         assert monitor.transferred == 1
diff --git a/tox.ini b/tox.ini
index c33bb60..8f5862b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,18 +1,12 @@
-# content of: tox.ini , put in same dir as setup.py
 [tox]
-envlist = py36,py37,py38,coverage,mypy
-[testenv]
-basepython =
-    py36: python3.6
-    py37: python3.7
-    py38: python3.8
+envlist = coverage,mypy
+isolated_build = True
 
-deps = -rtest-requirements.txt
-install_command = pip install {opts} {packages}
+[testenv]
+deps = -r test-requirements.txt
 
-passenv = TOXENV CI TRAVIS TRAVIS_*
+passenv = TOXENV CI
 commands = pytest --benchmark-disable
-usedevelop = True
 
 [testenv:mypy]
 basepython = python3.8
-- 
2.26.2