[Python-modules-commits] [python-motor] 01/14: Import python-motor_1.1.orig.tar.gz
Ondřej Nový
onovy at moszumanska.debian.org
Sat Apr 8 13:43:32 UTC 2017
This is an automated email from the git hooks/post-receive script.
onovy pushed a commit to branch master
in repository python-motor.
commit 438d7827afcc2f8884347767bc9b07f45617305f
Author: Ondřej Nový <onovy at debian.org>
Date: Mon Dec 5 18:56:37 2016 +0100
Import python-motor_1.1.orig.tar.gz
---
README.rst | 2 +-
doc/changelog.rst | 61 ++++++++++++++++++++++++++
doc/conf.py | 2 +-
doc/pymongo-objects.inv | Bin 6488 -> 0 bytes
doc/requirements.rst | 113 ++++++++++++++++++++++++++++++------------------
motor/__init__.py | 15 ++++---
motor/core.py | 1 +
motor/motor_gridfs.py | 1 +
setup.py | 4 +-
synchro/__init__.py | 6 ++-
synchro/synchrotest.py | 11 ++++-
tox.ini | 8 +++-
12 files changed, 168 insertions(+), 56 deletions(-)
diff --git a/README.rst b/README.rst
index 61db65a..d4431fa 100644
--- a/README.rst
+++ b/README.rst
@@ -42,7 +42,7 @@ Motor works in all the environments officially supported by Tornado or by
asyncio. It requires:
* Unix, including Mac OS X. Windows is not supported.
-* PyMongo_ 3.3 or later.
+* PyMongo_ 3.4 or later.
* Python 2.6 or later.
* `futures`_ on Python 2.6.
* `backports.pbkdf2`_ for faster authentication with MongoDB 3.0+,
diff --git a/doc/changelog.rst b/doc/changelog.rst
index 363874c..6cf45ec 100644
--- a/doc/changelog.rst
+++ b/doc/changelog.rst
@@ -3,6 +3,67 @@ Changelog
.. currentmodule:: motor.motor_tornado
+Motor 1.1
+---------
+
+Motor depends on PyMongo 3.4 or later. It wraps the latest PyMongo code which
+support the new server features introduced in MongoDB 3.4. (It is a coincidence
+that the latest MongoDB and PyMongo versions are the same number.)
+
+Highlights include:
+
+- Complete support for MongoDB 3.4:
+
+ - Unicode aware string comparison using collations. See :ref:`PyMongo's examples for collation <collation-on-operation>`.
+ - :class:`MotorCursor` and :class:`MotorGridOutCursor` have a new attribute :meth:`~MotorCursor.collation`.
+ - Support for the new :class:`~bson.decimal128.Decimal128` BSON type.
+ - A new maxStalenessSeconds read preference option.
+ - A username is no longer required for the MONGODB-X509 authentication
+ mechanism when connected to MongoDB >= 3.4.
+ - :meth:`~MotorCollection.parallel_scan` supports maxTimeMS.
+ - :class:`~pymongo.write_concern.WriteConcern` is automatically
+ applied by all helpers for commands that write to the database when
+ connected to MongoDB 3.4+. This change affects the following helpers:
+
+ - :meth:`MotorClient.drop_database`
+ - :meth:`MotorDatabase.create_collection`
+ - :meth:`MotorDatabase.drop_collection`
+ - :meth:`MotorCollection.aggregate` (when using $out)
+ - :meth:`MotorCollection.create_indexes`
+ - :meth:`MotorCollection.create_index`
+ - :meth:`MotorCollection.drop_indexes`
+ - :meth:`MotorCollection.drop_indexes`
+ - :meth:`MotorCollection.drop_index`
+ - :meth:`MotorCollection.map_reduce` (when output is not
+ "inline")
+ - :meth:`MotorCollection.reindex`
+ - :meth:`MotorCollection.rename`
+
+- Improved support for logging server discovery and monitoring events. See
+ :mod:`PyMongo's monitoring documentation <pymongo.monitoring>` for examples.
+- Support for matching iPAddress subjectAltName values for TLS certificate
+ verification.
+- TLS compression is now explicitly disabled when possible.
+- The Server Name Indication (SNI) TLS extension is used when possible.
+- PyMongo's `bson` module provides finer control over JSON encoding/decoding
+ with :class:`~bson.json_util.JSONOptions`.
+- Allow :class:`~bson.code.Code` objects to have a scope of ``None``,
+ signifying no scope. Also allow encoding Code objects with an empty scope
+ (i.e. ``{}``).
+
+.. warning:: Starting in PyMongo 3.4, :attr:`bson.code.Code.scope` may return
+ ``None``, as the default scope is ``None`` instead of ``{}``.
+
+.. note:: PyMongo 3.4+ attempts to create sockets non-inheritable when possible
+ (i.e. it sets the close-on-exec flag on socket file descriptors). Support
+ is limited to a subset of POSIX operating systems (not including Windows) and
+ the flag usually cannot be set in a single atomic operation. CPython 3.4+
+ implements `PEP 446`_, creating all file descriptors non-inheritable by
+ default. Users that require this behavior are encouraged to upgrade to
+ CPython 3.4+.
+
+.. _PEP 446: https://www.python.org/dev/peps/pep-0446/
+
Motor 1.0
---------
diff --git a/doc/conf.py b/doc/conf.py
index f4b1f44..05a002c 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -184,7 +184,7 @@ autodoc_default_flags = ['inherited-members']
autodoc_member_order = 'groupwise'
pymongo_inventory = ('http://api.mongodb.org/python/%s/' % pymongo_version,
- 'pymongo-objects.inv')
+ None)
intersphinx_mapping = {
'bson': pymongo_inventory,
diff --git a/doc/pymongo-objects.inv b/doc/pymongo-objects.inv
deleted file mode 100644
index f188202..0000000
Binary files a/doc/pymongo-objects.inv and /dev/null differ
diff --git a/doc/requirements.rst b/doc/requirements.rst
index 84636c7..ce8eeba 100644
--- a/doc/requirements.rst
+++ b/doc/requirements.rst
@@ -4,7 +4,7 @@ Requirements
The current version of Motor requires:
* CPython 2.6, 2.7, or 3.3 and later.
-* PyMongo_ 3.3 and later.
+* PyMongo_ 3.4 and later.
Beginning with version 0.5, Motor can integrate with either Tornado or asyncio.
@@ -40,8 +40,9 @@ Motor and PyMongo
`````````````````
Older versions of Motor depended on exact PyMongo versions. Version 0.7 requires
-the latest PyMongo 2.9.x release beginning with 2.9.4, and Version 1.0 works
-with any PyMongo version beginning with 3.3.0.
+the latest PyMongo 2.9.x release beginning with 2.9.4, Version 1.0 works
+with any PyMongo version beginning with 3.3.0, and Version 1.1 works with any
+PyMongo version beginning with 3.4.0.
+-------------------+-----------------+
| Motor Version | PyMongo Version |
@@ -62,6 +63,8 @@ with any PyMongo version beginning with 3.3.0.
+-------------------+-----------------+
| 1.0 | 3.3+ |
+-------------------+-----------------+
+| 1.1 | 3.4+ |
++-------------------+-----------------+
Motor and MongoDB
`````````````````
@@ -70,28 +73,32 @@ All Motor versions are usable with all MongoDB versions as old as 2.2.
Where "N" appears there are some incompatibilities and
unsupported server features.
-+---------------------------------------------------+
-| MongoDB Version |
-+=====================+=====+=====+=====+=====+=====+
-| | 2.2 | 2.4 | 2.6 | 3.0 | 3.2 |
-+---------------+-----+-----+-----+-----+-----+-----+
-| Motor Version | 0.1 | Y | Y |**N**|**N**|**N**|
-+---------------+-----+-----+-----+-----+-----+-----+
-| | 0.2 | Y | Y | Y |**N**|**N**|
-+---------------+-----+-----+-----+-----+-----+-----+
-| | 0.3 | Y | Y | Y |**N**|**N**|
-+---------------+-----+-----+-----+-----+-----+-----+
-| | 0.4 | Y | Y | Y | Y |**N**|
-+---------------+-----+-----+-----+-----+-----+-----+
-| | 0.5 | Y | Y | Y | Y |**N**|
-+---------------+-----+-----+-----+-----+-----+-----+
-| | 0.6 | Y | Y | Y | Y |**N**|
-+---------------+-----+-----+-----+-----+-----+-----+
-| | 0.7 | Y | Y | Y | Y | Y |
-+---------------+-----+-----+-----+-----+-----+-----+
++---------------------------------------------------------+
+| MongoDB Version |
++=====================+=====+=====+=====+=====+=====+=====+
+| | 2.2 | 2.4 | 2.6 | 3.0 | 3.2 | 3.4 |
++---------------+-----+-----+-----+-----+-----+-----+-----+
+| Motor Version | 0.1 | Y | Y |**N**|**N**|**N**|**N**|
++---------------+-----+-----+-----+-----+-----+-----+-----+
+| | 0.2 | Y | Y | Y |**N**|**N**|**N**|
++---------------+-----+-----+-----+-----+-----+-----+-----+
+| | 0.3 | Y | Y | Y |**N**|**N**|**N**|
++---------------+-----+-----+-----+-----+-----+-----+-----+
+| | 0.4 | Y | Y | Y | Y |**N**|**N**|
++---------------+-----+-----+-----+-----+-----+-----+-----+
+| | 0.5 | Y | Y | Y | Y |**N**|**N**|
++---------------+-----+-----+-----+-----+-----+-----+-----+
+| | 0.6 | Y | Y | Y | Y |**N**|**N**|
++---------------+-----+-----+-----+-----+-----+-----+-----+
+| | 0.7 | Y | Y | Y | Y | Y |**N**|
++---------------+-----+-----+-----+-----+-----+-----+-----+
+| | 1.0 | Y | Y | Y | Y | Y |**N**|
++---------------+-----+-----+-----+-----+-----+-----+-----+
+| | 1.1 | Y | Y | Y | Y | Y | Y |
++---------------+-----+-----+-----+-----+-----+-----+-----+
There is no relationship between PyMongo and MongoDB version numbers, although
-the numbers happen to be close in recent releases of PyMongo and MongoDB.
+the numbers happen to be close or equal in recent releases of PyMongo and MongoDB.
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.
@@ -123,6 +130,10 @@ known to be incompatible, or have not been tested together.
+---------------+-----+-----+-----+
| | 0.7 | Y | Y |
+---------------+-----+-----+-----+
+| | 1.0 | Y | Y |
++---------------+-----+-----+-----+
+| | 1.1 | Y | Y |
++---------------+-----+-----+-----+
Motor and Python
````````````````
@@ -134,29 +145,45 @@ Beginning in version 0.5, Motor integrates with asyncio or Tornado.
For asyncio support specifically, Motor requires Python 3.4+, or Python 3.3
with the `asyncio package from PyPI`_.
-+----------------------------------------------------------------+
-| Python Version |
-+=====================+=====+=====+=====+======+=====+=====+=====+
-| | 2.5 | 2.6 | 2.7 | 3.3 | 3.4 | 3.5 | 3.6 |
-+---------------+-----+-----+-----+-----+------+-----+-----+-----+
-| Motor Version | 0.1 | Y | Y | Y | Y |**N**|**N**|**N**|
-+---------------+-----+-----+-----+-----+------+-----+-----+-----+
-| | 0.2 |**N**| Y | Y | Y |**N**|**N**|**N**|
-+---------------+-----+-----+-----+-----+------+-----+-----+-----+
-| | 0.3 |**N**| Y | Y | Y | Y |**N**|**N**|
-+---------------+-----+-----+-----+-----+------+-----+-----+-----+
-| | 0.4 |**N**| Y | Y | Y | Y |**N**|**N**|
-+---------------+-----+-----+-----+-----+------+-----+-----+-----+
-| | 0.5 |**N**| Y | Y | Y | Y | Y | Y |
-+---------------+-----+-----+-----+-----+------+-----+-----+-----+
-| | 0.6 |**N**| Y | Y | Y | Y | Y | Y |
-+---------------+-----+-----+-----+-----+------+-----+-----+-----+
-| | 0.7 |**N**| Y | Y | Y | Y | Y | Y |
-+---------------+-----+-----+-----+-----+------+-----+-----+-----+
++----------------------------------------------------------+
+| Python Version |
++=====================+=====+=====+=====+======+=====+=====+
+| | 2.5 | 2.6 | 2.7 | 3.3 | 3.4 | 3.5 |
++---------------+-----+-----+-----+-----+------+-----+-----+
+| Motor Version | 0.1 | Y | Y | Y | Y |**N**|**N**|
++---------------+-----+-----+-----+-----+------+-----+-----+
+| | 0.2 |**N**| Y | Y | Y |**N**|**N**|
++---------------+-----+-----+-----+-----+------+-----+-----+
+| | 0.3 |**N**| Y | Y | Y | Y |**N**|
++---------------+-----+-----+-----+-----+------+-----+-----+
+| | 0.4 |**N**| Y | Y | Y | Y |**N**|
++---------------+-----+-----+-----+-----+------+-----+-----+
+| | 0.5 |**N**| Y | Y | Y | Y | Y |
++---------------+-----+-----+-----+-----+------+-----+-----+
+| | 0.6 |**N**| Y | Y | Y | Y | Y |
++---------------+-----+-----+-----+-----+------+-----+-----+
+| | 0.7 |**N**| Y | Y | Y | Y | Y |
++---------------+-----+-----+-----+-----+------+-----+-----+
+| | 1.0 |**N**| Y | Y | Y | Y | Y |
++---------------+-----+-----+-----+-----+------+-----+-----+
+| | 1.1 |**N**| Y | Y | Y | Y | Y |
++---------------+-----+-----+-----+-----+------+-----+-----+
+
+Motor 1.0 and 1.1 have been tested with recent Python 3.6 betas. I plan to
+support Python 3.6 as soon as it is released.
.. _asyncio package from PyPI: https://pypi.python.org/pypi/asyncio
Not Supported
-------------
-Motor does not support Jython or Windows.
+Motor does not support Windows:
+
+* The author does not test Motor on Windows to ensure it is correct or fast.
+* Tornado `is not officially supported on Windows
+ <http://www.tornadoweb.org/en/stable/index.html#installation>`_,
+ so Motor's Tornado integration on Windows is doubly-unsupported.
+* Since asyncio *does* officially support Windows, Motor's asyncio integration
+ is more likely to work there, but it is untested.
+
+Motor also does not support Jython.
diff --git a/motor/__init__.py b/motor/__init__.py
index 8a0bc64..b24610a 100644
--- a/motor/__init__.py
+++ b/motor/__init__.py
@@ -20,7 +20,7 @@ import pymongo
from motor.motor_py3_compat import text_type
-version_tuple = (1, 0)
+version_tuple = (1, 1)
def get_version_string():
@@ -31,12 +31,17 @@ def get_version_string():
version = get_version_string()
"""Current version of Motor."""
-if pymongo.version_tuple[:2] < (3, 3):
+pymongo_required = 3, 4
+if pymongo.version_tuple[:2] < pymongo_required:
+ major, minor = pymongo_required
msg = (
- "Motor %s requires PyMongo 3.3 or later. "
+ "Motor %s requires PyMongo %s.%s or later. "
"You have PyMongo %s. "
- "Do python -m pip install \"pymongo>=3.3,<4\""
- ) % (version, pymongo.version)
+ "Do python -m pip install \"pymongo>=%s.%s,<4\""
+ ) % (version,
+ major, minor,
+ pymongo.version,
+ major, minor)
raise ImportError(msg)
diff --git a/motor/core.py b/motor/core.py
index 44e5401..3668cc5 100644
--- a/motor/core.py
+++ b/motor/core.py
@@ -928,6 +928,7 @@ class AgnosticCursor(AgnosticBaseCursor):
__delegate_class__ = Cursor
address = ReadOnlyProperty()
count = AsyncRead()
+ collation = ReadOnlyProperty()
distinct = AsyncRead()
explain = AsyncRead()
add_option = MotorCursorChainingMethod()
diff --git a/motor/motor_gridfs.py b/motor/motor_gridfs.py
index bb0d2ad..5ad3dd2 100644
--- a/motor/motor_gridfs.py
+++ b/motor/motor_gridfs.py
@@ -44,6 +44,7 @@ class AgnosticGridOutCursor(AgnosticBaseCursor):
add_option = MotorCursorChainingMethod()
address = ReadOnlyProperty()
+ collation = ReadOnlyProperty()
comment = MotorCursorChainingMethod()
count = AsyncRead()
distinct = AsyncRead()
diff --git a/setup.py b/setup.py
index 3477602..9e7e8d2 100644
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@ description = 'Non-blocking MongoDB driver for Tornado or asyncio'
long_description = open("README.rst").read()
-install_requires = ['pymongo>=3.3,<4']
+install_requires = ['pymongo>=3.4,<4']
tests_require = ['mockupdb']
@@ -150,7 +150,7 @@ if sys.version_info[0] >= 3:
packages.append('motor.frameworks.asyncio')
setup(name='motor',
- version='1.0',
+ version='1.1',
packages=packages,
description=description,
long_description=long_description,
diff --git a/synchro/__init__.py b/synchro/__init__.py
index 0570d1f..90333bb 100644
--- a/synchro/__init__.py
+++ b/synchro/__init__.py
@@ -34,7 +34,8 @@ from motor.metaprogramming import MotorAttributeFactory
# importing * won't pick up underscore-prefixed attrs.
from gridfs.errors import *
from pymongo import *
-from pymongo import (operations,
+from pymongo import (collation,
+ operations,
server_selectors,
server_type,
son_manipulator,
@@ -43,7 +44,9 @@ from pymongo import (operations,
write_concern)
from pymongo.auth import _build_credentials_tuple
from pymongo.helpers import _unpack_response, _check_command_response
+from pymongo.collation import *
from pymongo.common import *
+from pymongo.common import _UUID_REPRESENTATIONS
from pymongo.cursor import *
from pymongo.cursor import _QUERY_OPTIONS
from pymongo.errors import *
@@ -56,6 +59,7 @@ from pymongo.monitoring import *
from pymongo.monitoring import _LISTENERS, _Listeners
from pymongo.operations import *
from pymongo.pool import *
+from pymongo.pool import _METADATA
from pymongo.periodic_executor import *
from pymongo.periodic_executor import _EXECUTORS
from pymongo.read_preferences import *
diff --git a/synchro/synchrotest.py b/synchro/synchrotest.py
index 6c108d8..b6dbc98 100644
--- a/synchro/synchrotest.py
+++ b/synchro/synchrotest.py
@@ -54,6 +54,7 @@ excluded_tests = [
# Motor's reprs aren't the same as PyMongo's.
'*.test_repr',
'*.test_repr_replica_set',
+ 'TestClient.test_unix_socket',
# Lazy-connection tests require multithreading; we test concurrent
# lazy connection directly.
@@ -138,10 +139,13 @@ excluded_tests = [
'TestCommandAndReadPreference.*',
'TestCommandMonitoring.test_get_more_failure',
'TestCommandMonitoring.test_sensitive_commands',
+ 'TestGridFile.test_grid_out_cursor_options',
'TestGridfsReplicaSet.test_gridfs_replica_set',
+ 'TestMaxStaleness.test_last_write_date_absent',
'TestMonitor.test_atexit_hook',
'TestReplicaSetClient.test_kill_cursor_explicit_primary',
'TestReplicaSetClient.test_kill_cursor_explicit_secondary',
+ 'TestSelections.test_bool',
]
@@ -176,8 +180,11 @@ class SynchroNosePlugin(Plugin):
return True
def wantFunction(self, fn):
- # PyMongo test generators work with unittest.TestLoader, not nose.
- if fn.__name__ in ('test_cases', 'create_test'):
+ # PyMongo's test generators run at import time; tell Nose not to run
+ # them as unittests.
+ if fn.__name__ in ('test_cases',
+ 'create_test',
+ 'create_selection_tests'):
return False
def wantMethod(self, method):
diff --git a/tox.ini b/tox.ini
index 5b0e246..8b1dc40 100644
--- a/tox.ini
+++ b/tox.ini
@@ -29,6 +29,9 @@ envlist =
# asyncio backport to Python 3.3, and Tornado.
asyncio-tornado4-py33,
+ # Test PyMongo HEAD, not the latest release.
+ py3-pymongo-master,
+
# Apply PyMongo's test suite to Motor via Synchro.
synchro
@@ -76,6 +79,9 @@ deps =
sphinx: aiohttp
sphinx: git+https://github.com/tornadoweb/tornado.git
+ py3-pymongo-master: git+https://github.com/mongodb/mongo-python-driver.git
+ py3-pymongo-master: tornado>=4,<5
+
synchro: tornado>=4,<5
synchro: nose
synchro: futures
@@ -98,5 +104,5 @@ commands =
whitelist_externals = git
commands =
# git accepts a PyMongo release tag as the "--branch" argument.
- git clone --depth 1 --branch 3.3.0 https://github.com/mongodb/mongo-python-driver.git {envtmpdir}/mongo-python-driver
+ git clone --depth 1 --branch 3.4.0 https://github.com/mongodb/mongo-python-driver.git {envtmpdir}/mongo-python-driver
python -m synchro.synchrotest -v -w {envtmpdir}/mongo-python-driver {posargs}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-motor.git
More information about the Python-modules-commits
mailing list