MOTOR-419 Drop support for Python versions older than 3.5.2 (#61)

This commit is contained in:
Prashant Mital 2020-07-27 13:40:31 -07:00 committed by GitHub
parent 7c2978949f
commit 0825ed0a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 130 deletions

View File

@ -706,30 +706,10 @@ axes:
- id: tox-env
display_name: "Tox Env"
values:
- id: "tornado4-py27"
variables:
TOX_ENV: "tornado4-py27"
PYTHON_BINARY: "/opt/python/2.7/bin/python"
- id: "tornado4-py37"
variables:
TOX_ENV: "tornado4-py37"
PYTHON_BINARY: "/opt/python/3.7/bin/python3"
- id: "tornado5-py27"
variables:
TOX_ENV: "tornado5-py27"
PYTHON_BINARY: "/opt/python/2.7/bin/python"
- id: "tornado5-pypy"
variables:
TOX_ENV: "tornado5-pypy"
PYTHON_BINARY: "/opt/python/pypy/bin/pypy"
- id: "tornado5-pypy3"
variables:
TOX_ENV: "tornado5-pypy3"
PYTHON_BINARY: "/opt/python/pypy3.5/bin/pypy3"
- id: "tornado5-py34"
variables:
TOX_ENV: "tornado5-py34"
PYTHON_BINARY: "/opt/python/3.4/bin/python3"
- id: "tornado5-py35"
variables:
TOX_ENV: "tornado5-py35"
@ -783,10 +763,6 @@ axes:
TOX_ENV: "py3-pymongo-master"
# Use 3.6 for now until 3.7 is on all Evergreen distros.
PYTHON_BINARY: "/opt/python/3.6/bin/python3"
- id: "synchro27"
variables:
TOX_ENV: "synchro27"
PYTHON_BINARY: "/opt/python/2.7/bin/python"
- id: "synchro37"
variables:
TOX_ENV: "synchro37"
@ -850,7 +826,7 @@ buildvariants:
display_name: "${os}-${tox-env}-${ssl}"
matrix_spec:
os: "rhel"
tox-env: ["tornado4-py27", "tornado5-py36", "py3-pymongo-master"]
tox-env: ["tornado5-py36", "py3-pymongo-master"]
ssl: "*"
tasks:
- ".3.0"
@ -866,7 +842,7 @@ buildvariants:
# TODO: synchro needs PyMongo master's updated SSL test certs,
# which may require Motor test suite changes.
- os: "*"
tox-env: ["synchro27", "synchro37"]
tox-env: ["synchro37"]
ssl: "ssl"
tasks:
- ".latest"
@ -896,7 +872,7 @@ buildvariants:
- matrix_name: "enterprise-auth"
display_name: "Enterprise Auth-${tox-env}"
matrix_spec: {"tox-env": ["synchro27", "synchro37"], ssl: "ssl"}
matrix_spec: {"tox-env": ["synchro37"], ssl: "ssl"}
run_on:
- ubuntu1604-test
tasks:

View File

@ -1,8 +1,6 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"

View File

@ -41,12 +41,9 @@ Dependencies
Motor works in all the environments officially supported by Tornado or by
asyncio. It requires:
* Unix, including Mac OS X. Windows is not supported.
* Unix, including macOS. Windows is not supported.
* PyMongo_ 3.10 or later.
* Python 2.7 or later.
* `futures`_ on Python 2.7.
* `backports.pbkdf2`_ for faster authentication with MongoDB 3.0+,
especially on Python older than 2.7.8, or on Python 3 before Python 3.4.
* Python 3.5 or later.
See `requirements <https://motor.readthedocs.io/en/stable/requirements.html>`_
for details about compatibility.
@ -105,10 +102,6 @@ Tests are located in the ``test/`` directory.
.. _asyncio: https://docs.python.org/3/library/asyncio.html
.. _futures: https://pypi.python.org/pypi/futures
.. _backports.pbkdf2: https://pypi.python.org/pypi/backports.pbkdf2/
.. _ReadTheDocs: https://motor.readthedocs.io/
.. _MongoDB Community Forums:

View File

@ -3,28 +3,17 @@ Requirements
The current version of Motor requires:
* CPython 2.7, or 3.4 and later.
* CPython 3.5 and later.
* PyMongo_ 3.10 and later.
Motor can integrate with either Tornado or asyncio.
Requires the `futures`_ package from PyPI on Python 2.
The default authentication mechanism for MongoDB 3.0+ is SCRAM-SHA-1.
Install `backports.pbkdf2`_ for faster authentication with MongoDB 3.0+,
especially on Python older than 2.7.8.
(Python 2.7.9 and later, or Python 3.4 and later, have builtin hash functions
nearly as fast as backports.pbkdf2.)
Building the docs requires `sphinx`_.
.. _PyMongo: https://pypi.python.org/pypi/pymongo/
.. _futures: https://pypi.python.org/pypi/futures
.. _backports.pbkdf2: https://pypi.python.org/pypi/backports.pbkdf2/
.. _sphinx: http://sphinx.pocoo.org/
Starting in version 2.1, Motor offers experimental support for Windows when it
@ -56,27 +45,31 @@ Motor and PyMongo
+-------------------+-----------------+
| 2.1 | 3.10+ |
+-------------------+-----------------+
| 2.2 | 3.11+ |
+-------------------+-----------------+
Motor and MongoDB
`````````````````
+---------------------------------------------------------------------------+
| MongoDB Version |
+=====================+=====+=====+=====+=====+=====+=====+=====+=====+=====+
| | 2.2 | 2.4 | 2.6 | 3.0 | 3.2 | 3.4 | 3.6 | 4.0 | 4.2 |
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| Motor Version | 1.0 | Y | Y | Y | Y | Y |**N**|**N**|**N**|**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 1.1 | Y | Y | Y | Y | Y | Y |**N**|**N**|**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 1.2 |**N**|**N**| Y | Y | Y | Y | Y |**N**|**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 1.3 |**N**|**N**| Y | Y | Y | Y | Y |**N**|**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 2.0 |**N**|**N**|**N**| Y | Y | Y | Y | Y | Y |
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 2.1 |**N**|**N**|**N**| Y | Y | Y | Y | Y | Y |
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+---------------------------------------------------------------------------+-----+
| MongoDB Version |
+=====================+=====+=====+=====+=====+=====+=====+=====+=====+=====+=====+
| | 2.2 | 2.4 | 2.6 | 3.0 | 3.2 | 3.4 | 3.6 | 4.0 | 4.2 | 4.4 |
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| Motor Version | 1.0 | Y | Y | Y | Y | Y |**N**|**N**|**N**|**N**|**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 1.1 | Y | Y | Y | Y | Y | Y |**N**|**N**|**N**|**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 1.2 |**N**|**N**| Y | Y | Y | Y | Y |**N**|**N**|**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 1.3 |**N**|**N**| Y | Y | Y | Y | Y |**N**|**N**|**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 2.0 |**N**|**N**|**N**| Y | Y | Y | Y | Y | Y |**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 2.1 |**N**|**N**|**N**| Y | Y | Y | Y | Y | Y |**N**|
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
| | 2.2 |**N**|**N**|**N**| Y | Y | Y | Y | Y | Y | Y |
+---------------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
There is no relationship between PyMongo and MongoDB version numbers, although
the numbers happen to be close or equal in recent releases of PyMongo and MongoDB.
@ -84,7 +77,7 @@ Use `the PyMongo compatibility matrix`_ to determine what MongoDB version is
supported by PyMongo. Use the compatibility matrix above to determine what
MongoDB version Motor supports.
.. _the PyMongo compatibility matrix: https://docs.mongodb.org/ecosystem/drivers/python/#mongodb-compatibility
.. _the PyMongo compatibility matrix: https://docs.mongodb.com/drivers/pymongo#mongodb-compatibility
Motor and Tornado
`````````````````
@ -109,6 +102,8 @@ known to be incompatible, or have not been tested together.
+---------------+-----+-----+-----+-----+-----+
| | 2.1 |**N**| Y | Y | Y |
+---------------+-----+-----+-----+-----+-----+
| | 2.2 |**N**|**N**| Y | Y |
+---------------+-----+-----+-----+-----+-----+
Motor and Python
````````````````
@ -118,8 +113,8 @@ the "async for" protocol implemented in Python 3.5.0 and 3.5.1. Motor continues
to work with "async for" loops in Python 3.5.2 and later.
Motor 1.2.5 and 1.3.1 add compatibility with Python 3.7, but at the cost of
dropping Python 3.4.3 and older. Python 3.4.4 and later are supported by all
Motor versions.
dropping Python 3.4.3 and older. Motor 2.2 dropped support for Pythons older
than 3.5.2.
+-------------------------------------------------------------------------------------+
| Python Version |
@ -138,6 +133,8 @@ Motor versions.
+---------------+-----+-----+-----+-----+-----+-----+-------+-------+-----+-----+-----+
| | 2.1 |**N**|**N**| Y |**N**| Y |**N** | Y | Y | Y | Y |
+---------------+-----+-----+-----+-----+-----+-----+-------+-------+-----+-----+-----+
| | 2.2 |**N**|**N**|**N**|**N**|**N**|**N** | Y | Y | Y | Y |
+---------------+-----+-----+-----+-----+-----+-----+-------+-------+-----+-----+-----+
Not Supported
-------------

View File

@ -1,23 +1,16 @@
import sys
from distutils.cmd import Command
from distutils.errors import DistutilsOptionError
from setuptools import setup
try:
from setuptools import setup
except ImportError:
from ez_setup import use_setuptools
use_setuptools('28.0')
from setuptools import setup
if sys.version_info[:2] < (3, 5):
raise Exception("This version of Motor requires Python>=3.5")
classifiers = """\
Intended Audience :: Developers
License :: OSI Approved :: Apache Software License
Development Status :: 5 - Production/Stable
Natural Language :: English
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
@ -33,14 +26,10 @@ description = 'Non-blocking MongoDB driver for Tornado or asyncio'
long_description = open("README.rst").read()
install_requires = ['pymongo>=3.10,<4']
install_requires = ['pymongo>3.10,<4']
tests_require = ['mockupdb>=1.4.0']
if sys.version_info[0] < 3:
install_requires.append('futures')
class test(Command):
description = "run the tests"
@ -103,21 +92,10 @@ class test(Command):
loader.avoid('asyncio_tests.test_aiohttp_gridfs',
reason='no aiohttp')
if sys.version_info[:2] < (3, 5):
loader.avoid('asyncio_tests.test_asyncio_await',
'asyncio_tests.test_asyncio_change_stream',
'asyncio_tests.test_examples',
'tornado_tests.test_motor_transaction',
reason='python < 3.5')
# Decide if we can run async / await tests with Tornado.
test_motor_await = 'tornado_tests.test_motor_await'
if not testenv.HAVE_TORNADO:
loader.avoid(test_motor_await, reason='no tornado')
elif sys.version_info[:2] < (3, 5):
loader.avoid(test_motor_await, reason='python < 3.5')
loader.avoid('tornado_tests.test_motor_change_stream',
reason='python < 3.5')
if self.test_suite is None:
suite = loader.discover(self.test_module)
@ -143,15 +121,9 @@ class test(Command):
sys.exit(not result.wasSuccessful())
packages = ['motor', 'motor.frameworks', 'motor.frameworks.tornado']
packages = ['motor', 'motor.frameworks', 'motor.frameworks.tornado',
'motor.frameworks.asyncio', 'motor.aiohttp']
if sys.version_info[0] >= 3:
# Trying to install and byte-compile motor/frameworks/asyncio/__init__.py
# causes SyntaxError in Python 2.
packages.append('motor.frameworks.asyncio')
# Install aiohttp integration - aiohttp itself need not be installed.
packages.append('motor.aiohttp')
setup(name='motor',
version='2.2.0.dev0',
@ -161,15 +133,7 @@ setup(name='motor',
author='A. Jesse Jiryu Davis',
author_email='jesse@mongodb.com',
url='https://github.com/mongodb/motor/',
python_requires=', '.join((
'>=2.7',
'!=3.0.*',
'!=3.1.*',
'!=3.2.*',
'!=3.3.*',
'!=3.5.0',
'!=3.5.1',
)),
python_requires='>=3.5.2',
install_requires=install_requires,
license='http://www.apache.org/licenses/LICENSE-2.0',
classifiers=[c for c in classifiers.split('\n') if c],

20
tox.ini
View File

@ -5,17 +5,14 @@
[tox]
envlist =
# Minimal Tornado 4 compatibility check.
tornado4-{py27,py36,py37},
# Tornado 5 supports Python 2.7.9+ and 3.4+.
tornado5-{py27,pypy,pypy3,py34,py35,py36,py37},
tornado5-{pypy3,py35,py36,py37},
# Tornado 6 supports Python 3.5+.
tornado6-{pypy3,py35,py36,py37,py38},
# Test Tornado on master in a few configurations.
tornado_git-{py27,py34,py35,py36,py37},
tornado_git-{py35,py36,py37},
# Ensure the sphinx build has no errors or warnings.
py3-sphinx-docs,
@ -24,13 +21,12 @@ envlist =
py3-sphinx-doctest,
# asyncio without Tornado.
asyncio-{py34,py35,py36,py37,py38},
asyncio-{py35,py36,py37,py38},
# Test PyMongo HEAD, not the latest release.
py3-pymongo-master,
# Apply PyMongo's test suite to Motor via Synchro.
synchro27,
synchro37
[testenv]
@ -43,26 +39,20 @@ passenv =
ASYNC_TEST_TIMEOUT
basepython =
py27,synchro27: {env:PYTHON_BINARY:python2.7}
py34: {env:PYTHON_BINARY:python3.4}
py35: {env:PYTHON_BINARY:python3.5}
py36: {env:PYTHON_BINARY:python3.6}
py37,synchro37: {env:PYTHON_BINARY:python3.7}
py38: {env:PYTHON_BINARY:python3.8}
pypy: {env:PYTHON_BINARY:pypy}
pypy3: {env:PYTHON_BINARY:pypy3}
# Default Python 3 when we don't care about minor version.
py3: {env:PYTHON_BINARY:python3.6}
deps =
tornado4: tornado>=4,<5
tornado5: tornado>=5,<6
tornado6: tornado>=6,<7
tornado_git: git+https://github.com/tornadoweb/tornado.git
{py27,pypy}: futures
{py35,py36,py37,py38}: aiohttp
sphinx: sphinx
@ -72,10 +62,6 @@ deps =
py3-pymongo-master: git+https://github.com/mongodb/mongo-python-driver.git
py3-pymongo-master: tornado>=5,<6
synchro27: tornado>=5,<6
synchro27: nose
synchro27: futures
synchro37: tornado>=6,<7
synchro37: nose