Skip to content

Commit dea4b90

Browse files
committed
PYTHON-2133 Drop install support for Python 2
1 parent fb4c20a commit dea4b90

File tree

11 files changed

+77
-739
lines changed

11 files changed

+77
-739
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,6 @@ functions:
349349
${PREPARE_SHELL}
350350
PYTHON_BINARY=${PYTHON_BINARY} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} sh ${PROJECT_DIRECTORY}/.evergreen/run-mockupdb-tests.sh
351351
352-
"run cdecimal tests":
353-
- command: shell.exec
354-
type: test
355-
params:
356-
working_dir: "src"
357-
script: |
358-
set -o xtrace
359-
${PREPARE_SHELL}
360-
PYTHON_BINARY=${PYTHON_BINARY} sh ${PROJECT_DIRECTORY}/.evergreen/run-cdecimal-tests.sh
361-
362352
"run doctests":
363353
- command: shell.exec
364354
type: test
@@ -1179,15 +1169,6 @@ tasks:
11791169
TOPOLOGY: "replica_set"
11801170
- func: "run mod_wsgi tests"
11811171

1182-
- name: "cdecimal"
1183-
tags: ["cdecimal"]
1184-
commands:
1185-
- func: "bootstrap mongo-orchestration"
1186-
vars:
1187-
VERSION: "latest"
1188-
TOPOLOGY: "server"
1189-
- func: "run cdecimal tests"
1190-
11911172
- name: "no-server"
11921173
tags: ["no-server"]
11931174
commands:

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
language: python
22

33
python:
4-
- 2.7
54
- 3.4
65
- 3.5
76
- 3.6
87
- 3.7
98
- 3.8
10-
- pypy
119
- pypy3.5
1210

1311
services:

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
include README.rst
22
include LICENSE
33
include THIRD-PARTY-NOTICES
4-
include ez_setup.py
54
recursive-include doc *.rst
65
recursive-include doc *.py
76
recursive-include doc *.conf

README.rst

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ is incompatible with PyMongo.
8989
Dependencies
9090
============
9191

92-
PyMongo supports CPython 2.7, 3.4+, PyPy, and PyPy3.5+.
92+
PyMongo supports CPython 3.4+ and PyPy3.5+.
9393

9494
Optional dependencies:
9595

@@ -119,9 +119,6 @@ PyMongo::
119119

120120
$ python -m pip install pymongo[tls]
121121

122-
.. note:: Users of Python versions older than 2.7.9 will also
123-
receive the dependencies for OCSP when using the tls extra.
124-
125122
OCSP (Online Certificate Status Protocol) requires `PyOpenSSL
126123
<https://pypi.org/project/pyOpenSSL/>`_, `requests
127124
<https://pypi.org/project/requests/>`_ and `service_identity
@@ -149,16 +146,6 @@ command::
149146

150147
$ python -m pip install pymongo[gssapi,aws,ocsp,snappy,srv,tls,zstd,encryption]
151148

152-
Other optional packages:
153-
154-
- `backports.pbkdf2 <https://pypi.python.org/pypi/backports.pbkdf2/>`_,
155-
improves authentication performance with SCRAM-SHA-1 and SCRAM-SHA-256.
156-
It especially improves performance on Python versions older than 2.7.8.
157-
- `monotonic <https://pypi.python.org/pypi/monotonic>`_ adds support for
158-
a monotonic clock, which improves reliability in environments
159-
where clock adjustments are frequent. Not needed in Python 3.
160-
161-
162149
Additional dependencies are:
163150

164151
- (to generate documentation) sphinx_

RELEASE.rst

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ Doing a Release
3333

3434
1. PyMongo is tested on Evergreen. Ensure the latest commit are passing CI
3535
as expected: https://evergreen.mongodb.com/waterfall/mongo-python-driver.
36-
To test locally, ``python setup.py test`` will build the C extensions and
37-
test. ``python tools/clean.py`` will remove the extensions,
38-
and then ``python setup.py --no_ext test`` will run the tests without
39-
them. You can also run the doctests: ``python setup.py doc -t``.
36+
To test locally, ``python3 setup.py test`` will build the C extensions and
37+
test. ``python3 tools/clean.py`` will remove the extensions,
38+
and then ``python3 setup.py --no_ext test`` will run the tests without
39+
them. You can also run the doctests: ``python3 setup.py doc -t``.
4040

4141
2. Check Jira to ensure all the tickets in this version have been completed.
4242

@@ -63,17 +63,11 @@ Doing a Release
6363
the next steps let's assume we unpacked these files into the following paths::
6464

6565
$ ls path/to/manylinux
66-
pymongo-<version>-cp27-cp27m-manylinux1_i686.whl
67-
...
6866
pymongo-<version>-cp38-cp38-manylinux2014_x86_64.whl
69-
$ ls path/to/mac/
70-
pymongo-<version>-cp27-cp27m-macosx_10_14_intel.whl
7167
...
72-
pymongo-<version>-py2.7-macosx-10.14-intel.egg
7368
$ ls path/to/windows/
74-
pymongo-<version>-cp27-cp27m-win32.whl
75-
...
7669
pymongo-<version>-cp38-cp38-win_amd64.whl
70+
...
7771

7872
10. Build the source distribution::
7973

cdecimal_test.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

doc/atlas.rst

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,7 @@ Atlas to :class:`~pymongo.mongo_client.MongoClient`::
77

88
client = pymongo.MongoClient(<Atlas connection string>)
99

10-
Connections to Atlas require TLS/SSL. For connections using TLS/SSL, PyMongo
11-
may require third party dependencies as determined by your version of Python.
12-
With PyMongo 3.3+, you can install PyMongo 3.3+ and any TLS/SSL-related
13-
dependencies using the following pip command::
14-
15-
$ python -m pip install pymongo[tls]
16-
17-
Starting with PyMongo 3.11 this installs `PyOpenSSL
18-
<https://pypi.org/project/pyOpenSSL/>`_, `requests`_
19-
and `service_identity
20-
<https://pypi.org/project/service_identity/>`_
21-
for users of Python versions older than 2.7.9. PyOpenSSL supports SNI for these
22-
old Python versions, allowing applictions to connect to Altas free and shared
23-
tier instances.
24-
25-
Earlier versions of PyMongo require you to manually install the dependencies.
26-
For a list of TLS/SSL-related dependencies, see :doc:`examples/tls`.
27-
28-
.. note:: Connecting to Atlas "Free Tier" or "Shared Cluster" instances
29-
requires Server Name Indication (SNI) support. SNI support requires CPython
30-
2.7.9 / PyPy 2.5.1 or newer or PyMongo 3.11+ with PyOpenSSL.
31-
To check if your version of Python supports SNI run the following command::
32-
33-
$ python -c "import ssl; print(getattr(ssl, 'HAS_SNI', False))"
34-
35-
You should see "True".
10+
Connections to Atlas require TLS/SSL.
3611

3712
.. warning:: Industry best practices recommend, and some regulations require,
3813
the use of TLS 1.1 or newer. Though no application changes are required for

doc/compatibility-policy.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ effort to release at least one minor version that *deprecates* it. We add
1818
`DeprecationWarning`_. You can ensure your code is future-proof by running
1919
your code with the latest PyMongo release and looking for DeprecationWarnings.
2020

21-
Starting with Python 2.7, the interpreter silences DeprecationWarnings by
22-
default. For example, the following code uses the deprecated ``insert``
23-
method but does not raise any warning:
21+
The interpreter silences DeprecationWarnings by default. For example, the
22+
following code uses the deprecated ``insert`` method but does not raise any
23+
warning:
2424

2525
.. code-block:: python
2626
@@ -32,13 +32,13 @@ method but does not raise any warning:
3232
3333
To print deprecation warnings to stderr, run python with "-Wd"::
3434

35-
$ python -Wd insert.py
35+
$ python3 -Wd insert.py
3636
insert.py:4: DeprecationWarning: insert is deprecated. Use insert_one or insert_many instead.
3737
client.test.test.insert({})
3838

3939
You can turn warnings into exceptions with "python -We"::
4040

41-
$ python -We insert.py
41+
$ python3 -We insert.py
4242
Traceback (most recent call last):
4343
File "insert.py", line 4, in <module>
4444
client.test.test.insert({})
@@ -55,8 +55,8 @@ deprecated PyMongo features.
5555
.. _semantic versioning: http://semver.org/
5656

5757
.. _DeprecationWarning:
58-
https://docs.python.org/2/library/exceptions.html#exceptions.DeprecationWarning
58+
https://docs.python.org/3/library/exceptions.html#DeprecationWarning
5959

60-
.. _the warnings module: https://docs.python.org/2/library/warnings.html
60+
.. _the warnings module: https://docs.python.org/3/library/warnings.html
6161

62-
.. _the -W command line option: https://docs.python.org/2/using/cmdline.html#cmdoption-W
62+
.. _the -W command line option: https://docs.python.org/3/using/cmdline.html#cmdoption-w

0 commit comments

Comments
 (0)