Skip to content

Commit 7b6eae7

Browse files
committed
test back to CPython 3.5
1 parent 9a597b3 commit 7b6eae7

3 files changed

Lines changed: 34 additions & 7 deletions

File tree

.github/workflows/lint_python.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
python: ['3.10']
9+
python:
10+
- major_dot_minor: '3.10'
11+
safety: false
1012
steps:
1113
- uses: actions/checkout@v3
1214
- uses: actions/setup-python@v4
@@ -19,7 +21,7 @@ jobs:
1921
#
2022
# CPython -> 3.9.0-alpha - 3.9.X
2123
# PyPy -> pypy-3.7
22-
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
24+
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python.major_dot_minor), matrix.python.major_dot_minor))[startsWith(matrix.python.major_dot_minor, 'pypy')] }}
2325
architecture: x64
2426
- run: pip install --upgrade pip wheel
2527
- run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear
@@ -42,7 +44,23 @@ jobs:
4244
strategy:
4345
fail-fast: false
4446
matrix:
45-
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
47+
python:
48+
- major_dot_minor: '3.4'
49+
safety: false
50+
- major_dot_minor: '3.5'
51+
safety: false
52+
- major_dot_minor: '3.6'
53+
safety: false
54+
- major_dot_minor: '3.7'
55+
safety: false
56+
- major_dot_minor: '3.8'
57+
safety: true
58+
- major_dot_minor: '3.9'
59+
safety: true
60+
- major_dot_minor: '3.10'
61+
safety: true
62+
- major_dot_minor: '3.11'
63+
safety: true
4664
steps:
4765
- uses: actions/checkout@v3
4866
- uses: actions/setup-python@v4
@@ -55,12 +73,12 @@ jobs:
5573
#
5674
# CPython -> 3.9.0-alpha - 3.9.X
5775
# PyPy -> pypy-3.7
58-
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python), matrix.python))[startsWith(matrix.python, 'pypy')] }}
76+
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python.major_dot_minor), matrix.python.major_dot_minor))[startsWith(matrix.python.major_dot_minor, 'pypy')] }}
5977
architecture: x64
6078
- run: pip install --upgrade pip wheel
6179
- run: pip install pytest safety
6280
- run: pip install --editable .
6381
- run: pip install numpy pylab-sdk
6482
- run: make test
65-
- if: matrix.python != '3.7'
83+
- if: matrix.python.safety
6684
run: safety check

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers =
2323
py_modules =
2424
memory_profiler
2525
mprof
26-
python_requires = >=3.4
26+
python_requires = >=3.5
2727
install_requires = psutil
2828

2929
[options.entry_points]

test/test_async.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import sys
23

34
from memory_profiler import profile
45

@@ -14,5 +15,13 @@ async def main():
1415
task = asyncio.create_task(my_func())
1516
res = await asyncio.gather(task)
1617

18+
async def main_legacy():
19+
future = asyncio.ensure_future(my_func())
20+
res = await asyncio.gather(future)
21+
1722
if __name__ == '__main__':
18-
asyncio.run(main()) # main loop
23+
if sys.version_info >= (3, 7):
24+
asyncio.run(main()) # main loop
25+
else:
26+
loop = asyncio.get_event_loop()
27+
loop.run_until_complete(main_legacy())

0 commit comments

Comments
 (0)