diff --git a/.evergreen/config.yml b/.evergreen/config.yml index d8d336599..f7ca2438a 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1044,10 +1044,6 @@ axes: display_name: "PyPy" variables: PYTHON_BINARY: "/opt/python/pypy/bin/pypy" - - id: "pypy3" - display_name: "PyPy 3" - variables: - PYTHON_BINARY: "/opt/python/pypy3/bin/pypy3" - id: "pypy3.5" display_name: "PyPy 3.5" variables: @@ -1245,7 +1241,7 @@ buildvariants: matrix_spec: {"python-version": "*", "c-extensions": "without-c-extensions", auth: "noauth", ssl: "nossl", coverage: "*"} exclude_spec: # These interpreters are always tested without extensions. - - python-version: ["pypy", "pypy3", "pypy3.5", "jython2.7"] + - python-version: ["pypy", "pypy3.5", "jython2.7"] c-extensions: "without-c-extensions" auth: "*" ssl: "*" @@ -1265,7 +1261,7 @@ buildvariants: matrix_spec: {"python-version": "*", "c-extensions": "*", "compression": "*"} exclude_spec: # These interpreters are always tested without extensions. - - python-version: ["pypy", "pypy3", "pypy3.5", "jython2.7"] + - python-version: ["pypy", "pypy3.5", "jython2.7"] c-extensions: "with-c-extensions" compression: "*" - python-version: ["jython2.7"] @@ -1296,7 +1292,7 @@ buildvariants: matrix_spec: {"python-version": "*", "green-framework": "*", auth-ssl: "*"} exclude_spec: # Don't test green frameworks on these Python versions. - - python-version: ["pypy", "pypy3", "pypy3.5", "jython2.7"] + - python-version: ["pypy", "pypy3.5", "jython2.7"] green-framework: "*" auth-ssl: "*" display_name: "${green-framework} ${python-version} RHEL 6.2 (x86_64) ${auth-ssl}" diff --git a/.evergreen/run-atlas-tests.sh b/.evergreen/run-atlas-tests.sh index 7660d5349..c06d3b45b 100644 --- a/.evergreen/run-atlas-tests.sh +++ b/.evergreen/run-atlas-tests.sh @@ -6,17 +6,11 @@ set -o errexit export JAVA_HOME=/opt/java/jdk8 IMPL=$(${PYTHON_BINARY} -c "import platform, sys; sys.stdout.write(platform.python_implementation())") -PYTHON_VERSION=$(${PYTHON_BINARY} -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") if [ $IMPL = "Jython" -o $IMPL = "PyPy" ]; then $PYTHON_BINARY -m virtualenv --never-download --no-wheel atlastest . atlastest/bin/activate trap "deactivate; rm -rf atlastest" EXIT HUP pip install certifi - if [ $PYTHON_VERSION = "3.2" ]; then - # Portable pypy3.2 can't load CA certs from the system. - # https://github.com/squeaky-pl/portable-pypy/issues/15 - export SSL_CERT_FILE=$(python -c "import certifi; print(certifi.where())") - fi PYTHON=python else PYTHON=$PYTHON_BINARY diff --git a/.travis.yml b/.travis.yml index 8def32c63..9e1cc78a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: - 3.5 - 3.6 - pypy - - pypy3 + - pypy3.5 services: - mongodb diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index a65fbbd30..01857b676 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -19,7 +19,7 @@ that might not be of interest or that has already been addressed. Supported Interpreters ---------------------- -PyMongo supports CPython 2.7, 3.4+, PyPy, and PyPy3. Language +PyMongo supports CPython 2.7, 3.4+, PyPy, and PyPy3.5+. Language features not supported by all interpreters can not be used. Style Guide diff --git a/README.rst b/README.rst index 0bc02f524..25d2f20f7 100644 --- a/README.rst +++ b/README.rst @@ -88,7 +88,7 @@ is incompatible with PyMongo. Dependencies ============ -PyMongo supports CPython 2.7, 3.4+, PyPy, and PyPy3. +PyMongo supports CPython 2.7, 3.4+, PyPy, and PyPy3.5+. Optional dependencies: diff --git a/bson/py3compat.py b/bson/py3compat.py index 8e3c722a5..0b7378eec 100644 --- a/bson/py3compat.py +++ b/bson/py3compat.py @@ -20,15 +20,10 @@ PY3 = sys.version_info[0] == 3 if PY3: import codecs + import collections.abc as abc import _thread as thread from io import BytesIO as StringIO - try: - import collections.abc as abc - except ImportError: - # PyPy3 (based on CPython 3.2) - import collections as abc - MAXSIZE = sys.maxsize imap = map diff --git a/doc/changelog.rst b/doc/changelog.rst index 2bdce3591..af55be20d 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -10,6 +10,9 @@ Changes in Version 3.8.0 2.7 or newer from `SCL `_ +.. warning:: PyMongo no longer supports PyPy3 versions older than 3.5. Users + must upgrade to PyPy3.5+. + Issues Resolved ............... diff --git a/doc/examples/tls.rst b/doc/examples/tls.rst index f568c9612..4454a1e4b 100644 --- a/doc/examples/tls.rst +++ b/doc/examples/tls.rst @@ -28,10 +28,6 @@ When using CPython < 2.7.9 or PyPy < 2.5.1: - On Windows, the `wincertstore`_ module is required. - On all other platforms, the `certifi`_ module is required. -Python 3.x -`````````` -On Windows, the `wincertstore`_ module is required when using PyPy3 < 3.5. - .. _ipaddress: https://pypi.python.org/pypi/ipaddress .. _wincertstore: https://pypi.python.org/pypi/wincertstore .. _certifi: https://pypi.python.org/pypi/certifi @@ -185,7 +181,7 @@ root certificates:: open "/Applications/Python /Install Certificates.command" -Users of older PyPy and PyPy3 portable versions may have to `set an environment +Users of older PyPy portable versions may have to `set an environment variable `_ to tell OpenSSL where to find root certificates. This is easily done using the `certifi module `_ from pypi:: diff --git a/doc/faq.rst b/doc/faq.rst index 671c26d84..b27cc1427 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -128,7 +128,7 @@ they are returned to the pool. Does PyMongo support Python 3? ------------------------------ -PyMongo supports CPython 3.4+ and PyPy3. See the :doc:`python3` for details. +PyMongo supports CPython 3.4+ and PyPy3.5+. See the :doc:`python3` for details. Does PyMongo support asynchronous frameworks like Gevent, asyncio, Tornado, or Twisted? --------------------------------------------------------------------------------------- diff --git a/doc/installation.rst b/doc/installation.rst index 6f97ea42c..1e20e5b90 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -45,7 +45,7 @@ To upgrade do:: Dependencies ------------ -PyMongo supports CPython 2.7, 3.4+, PyPy, and PyPy3. +PyMongo supports CPython 2.7, 3.4+, PyPy, and PyPy3.5+. Optional dependencies: diff --git a/doc/python3.rst b/doc/python3.rst index 366a1b55d..89b0afca5 100644 --- a/doc/python3.rst +++ b/doc/python3.rst @@ -6,7 +6,7 @@ Python 3 FAQ What Python 3 versions are supported? ------------------------------------- -PyMongo supports CPython 3.4+ and PyPy3. +PyMongo supports CPython 3.4+ and PyPy3.5+. Are there any PyMongo behavior changes with Python 3? ----------------------------------------------------- diff --git a/pymongo/pool.py b/pymongo/pool.py index 66c1d0541..1a13063d0 100644 --- a/pymongo/pool.py +++ b/pymongo/pool.py @@ -272,12 +272,11 @@ def _raise_connection_failure(address, error, msg_prefix=None): if isinstance(error, socket.timeout): raise NetworkTimeout(msg) elif isinstance(error, SSLError) and 'timed out' in str(error): - # CPython 2.7, PyPy 2.x, and PyPy3 do not distinguish network + # CPython 2.7 and PyPy 2.x do not distinguish network # timeouts from other SSLErrors (https://bugs.python.org/issue10272). # Luckily, we can work around this limitation because the phrase # 'timed out' appears in all the timeout related SSLErrors raised - # on the above platforms. CPython >= 3.2 and PyPy3.3 correctly raise - # socket.timeout. + # on the above platforms. raise NetworkTimeout(msg) else: raise AutoReconnect(msg) diff --git a/pymongo/ssl_support.py b/pymongo/ssl_support.py index a8343b925..9eeeb4f7a 100644 --- a/pymongo/ssl_support.py +++ b/pymongo/ssl_support.py @@ -48,7 +48,7 @@ _PY37PLUS = sys.version_info[:2] >= (3, 7) if HAVE_SSL: try: - # Python 2.7.9+, 3.2+, PyPy 2.5.1+, etc. + # Python 2.7.9+, PyPy 2.5.1+, etc. from ssl import SSLContext except ImportError: from pymongo.ssl_context import SSLContext diff --git a/setup.py b/setup.py index 8357dd83d..203db5b3a 100755 --- a/setup.py +++ b/setup.py @@ -328,11 +328,11 @@ else: {'tls': [], 'srv': ["dnspython>=1.13.0,<2.0.0"]}) if sys.platform == 'win32': extras_require['gssapi'] = ["winkerberos>=0.5.0"] - if vi[0] == 2 and vi < (2, 7, 9) or vi[0] == 3 and vi < (3, 4): + if vi < (2, 7, 9): extras_require['tls'].append("wincertstore>=0.2") else: extras_require['gssapi'] = ["pykerberos"] - if vi[0] == 2 and vi < (2, 7, 9): + if vi < (2, 7, 9): extras_require['tls'].append("certifi") extra_opts = { diff --git a/test/test_bson_corpus.py b/test/test_bson_corpus.py index 8f56eaf75..d836724df 100644 --- a/test/test_bson_corpus.py +++ b/test/test_bson_corpus.py @@ -151,11 +151,9 @@ def create_test(case_spec): _DEPRECATED_BSON_TYPES[bson_type]) continue - # PyPy3 and Jython can't handle NaN with a payload from + # Jython can't handle NaN with a payload from # struct.(un)pack if endianness is specified in the format string. - if not ((('PyPy' in sys.version and - sys.version_info[:2] < (3, 3)) or - sys.platform.startswith("java")) and + if not (sys.platform.startswith("java") and description == 'NaN with payload'): # Test round-tripping canonical bson. self.assertEqual(encode_bson(decoded_bson), cB)