Skip to content

Commit 28b167e

Browse files
Tornado warning only if exists continued (#22)
* Warn about MEMOIZE_FORCE_ASYNCIO only if tornado exists If tornado _does not_ exist, forcing asyncio is a noop, consistent with normal operation, and does not deserve a warning. * Fixed redundant waring if `tornado` is not available to be used (silenced) - version and changelog * Fixed GitHub Actions build (python 3.5 & 3.6 no longer available). --------- Co-authored-by: Charles Duffy <[email protected]> Co-authored-by: Michał Żmuda <[email protected]>
1 parent 34687bb commit 28b167e

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

.github/workflows/tox-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11.0-alpha - 3.11']
11+
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
1212

1313
steps:
1414
- uses: actions/checkout@v2

CHANGELOG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
1.1.4
2+
-----
3+
4+
* Fixed redundant waring if `tornado` is not available to be used (silenced).
5+
* Fixed GitHub Actions build (python 3.5 & 3.6 no longer available).
6+
17
1.1.3
28
-----
39

memoize/coerced.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
"""
44

55
import datetime
6+
import importlib.util
67
import logging
78

89
from memoize.memoize_configuration import force_asyncio
910

1011
logger = logging.getLogger('memoize')
1112
try:
12-
if force_asyncio:
13-
logger.warning('Forcefully omitting tornado availability check & switching to asyncio')
13+
if force_asyncio and importlib.util.find_spec('tornado'):
14+
logger.warning('Forcefully switching to asyncio even though tornado exists')
1415
raise ImportError()
1516

1617
from tornado.ioloop import IOLoop

setup.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def prepare_description():
1414

1515
setup(
1616
name='py-memoize',
17-
version='1.1.3',
17+
version='1.1.4',
1818
author='Michal Zmuda',
1919
author_email='[email protected]',
2020
url='https://github.com/DreamLab/memoize',
@@ -37,8 +37,6 @@ def prepare_description():
3737
'Topic :: Software Development :: Libraries',
3838
'Programming Language :: Python :: 3',
3939
'Programming Language :: Python :: 3 :: Only',
40-
'Programming Language :: Python :: 3.5',
41-
'Programming Language :: Python :: 3.6',
4240
'Programming Language :: Python :: 3.7',
4341
'Programming Language :: Python :: 3.8',
4442
'Programming Language :: Python :: 3.9',

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ skipdist = True
33

44
# py-{asyncio,tornado} are added for GitHub Actions (where we have only one interpreter at the time)
55
# py{35,36,37,38,39}-{asyncio,tornado} are added for development purposes (where one has multiple interpreters)
6-
envlist = py-{asyncio,tornado},py{35,36,37,38,39,310,311}-{asyncio,tornado},coverage-py310,mypy-py310
6+
envlist = py-{asyncio,tornado},py{37,38,39,310,311}-{asyncio,tornado},coverage-py310,mypy-py310
77

88
[testenv]
99
setenv =

0 commit comments

Comments
 (0)