Skip to content

Commit 3a49662

Browse files
authored
PYTHON-3383 [pymongoexplain] Support Python 3.7-3.12 (#55)
1 parent 03fca5c commit 3a49662

19 files changed

+80
-1265
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Global owner for repo
2-
* @blink1073 @juliusgeo @ShaneHarvey
2+
* @mongodb-labs/dbx-python

.github/workflows/test.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,31 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
runs-on: ubuntu-18.04
7+
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "pypy-3.7"]
11-
mongodb-version: ["4.4"]
12-
pymongo-version: ["3.11.0", "4.0.0"]
13-
# pymongo 4.0 does not support python 3.5
14-
exclude:
15-
- python-version: "3.5"
16-
pymongo-version: "4.0.0"
17-
10+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.7"]
11+
fail-fast: true
1812
steps:
1913
- uses: actions/checkout@v2
2014
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v4
2216
with:
2317
python-version: ${{ matrix.python-version }}
18+
allow-prereleases: true
2419
- name: Start MongoDB
25-
uses: supercharge/mongodb-github-action@1.7.0
20+
uses: supercharge/mongodb-github-action@1.8.0
2621
with:
27-
mongodb-version: ${{ matrix.mongodb-version }}
22+
mongodb-version: "4.4"
2823
mongodb-replica-set: test-rs
2924
# add caching to reduce bandwidth and save time
30-
- uses: actions/cache@v2
25+
- uses: actions/cache@v3
3126
with:
3227
path: ~/.cache/pip
3328
key: ${{ runner.os }}-${{ matrix.python-version}}-pip-${{ hashFiles('**/setup.py') }}
3429
restore-keys: |
3530
${{ runner.os }}-${{ matrix.python-version}}-pip-
3631
- name: Test with python
3732
run: |
38-
python -m pip install pymongo==${{ matrix.pymongo-version }}
39-
python -m pip install -e .
40-
python setup.py test
33+
python -m pip install -e ".[test]"
34+
python -m unittest discover .

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ Please include all of the following information when opening an issue:
6969
Dependencies
7070
============
7171

72-
PyMongoExplain requires CPython 3.5+, and PyPy3.5+.
72+
PyMongoExplain requires CPython 3.7+, and PyPy3.7+.
7373

74-
PyMongoExplain requires `PyMongo>=3.10,<4 <https://github.com/mongodb/mongo-python-driver/>`_
74+
PyMongoExplain requires `PyMongo>=4.4 <https://github.com/mongodb/mongo-python-driver/>`_
7575

7676
Testing
7777
=======
7878

79-
The easiest way to run the tests is to run **python setup.py test** in
79+
The easiest way to run the tests is to run **pip install -e ".[test]"; python -m pytest** in
8080
the root of the distribution.
8181

8282
Tutorial

changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
Changelog
33
=========
44

5+
Changes in version 1.3.0
6+
------------------------
7+
- Added support for Python 3.11 and 3.12. Dropped support for Python versions
8+
less than 3.7.
9+
- Dropped support for PyMongo versions less than 4.0.
10+
511
Changes in version 1.2.0
612
------------------------
713
- Added ability to configure explain command options using constructor

pymongoexplain/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = '1.2.0'
15+
__version__ = '1.3.0'

pyproject.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "pymongoexplain"
7+
dynamic = ["version"]
8+
description = "Explainable CRUD API for PyMongo"
9+
readme = "README.rst"
10+
license = { file = "LICENSE" }
11+
requires-python = ">=3.7"
12+
authors = [
13+
{ name = "Julius Park" },
14+
]
15+
keywords = [
16+
"mongo",
17+
"mongodb",
18+
"pymongo",
19+
]
20+
classifiers = [
21+
"Development Status :: 4 - Beta",
22+
"Intended Audience :: Developers",
23+
"License :: OSI Approved :: Apache Software License",
24+
"Operating System :: MacOS :: MacOS X",
25+
"Operating System :: Microsoft :: Windows",
26+
"Operating System :: POSIX",
27+
"Programming Language :: Python :: 3",
28+
"Programming Language :: Python :: 3.7",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: Implementation :: CPython",
35+
"Programming Language :: Python :: Implementation :: PyPy",
36+
"Topic :: Database",
37+
]
38+
dependencies = [
39+
"pymongo>=4.4",
40+
]
41+
42+
[project.scripts]
43+
pymongoexplain = "pymongoexplain.cli_explain:cli_explain"
44+
45+
[project.urls]
46+
Homepage = "https://github.com/mongodb-labs/pymongoexplain"
47+
48+
[project.optional-dependencies]
49+
test = ["pytest"]
50+
51+
[tool.setuptools.dynamic]
52+
version = {attr = "pymongoexplain.version.__version__"}
53+
54+
[tool.setuptools.packages.find]
55+
include = ["pymongoexplain"]

setup.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,2 @@
1-
import os
21

3-
from setuptools import setup, find_packages
4-
5-
with open('README.rst', 'rb') as f:
6-
LONG_DESCRIPTION = f.read().decode('utf8')
7-
8-
# Single source the version.
9-
version_file = os.path.realpath(os.path.join(
10-
os.path.dirname(__file__), 'pymongoexplain', 'version.py'))
11-
version = {}
12-
with open(version_file) as fp:
13-
exec(fp.read(), version)
14-
15-
setup(
16-
name="pymongoexplain",
17-
version=version['__version__'],
18-
description="Explainable CRUD API for PyMongo",
19-
long_description=LONG_DESCRIPTION,
20-
packages=find_packages(exclude=['test']),
21-
author="Julius Park",
22-
url="https://github.com/mongodb-labs/pymongoexplain",
23-
keywords=["mongo", "mongodb", "pymongo"],
24-
test_suite="test",
25-
entry_points={
26-
'console_scripts': [
27-
'pymongoexplain=pymongoexplain.cli_explain:cli_explain'],
28-
},
29-
tests_require=["pymongo>=3.10"],
30-
install_requires=['pymongo>=3.10'],
31-
python_requires='>=3.5',
32-
license="Apache License, Version 2.0",
33-
classifiers=[
34-
"Development Status :: 4 - Beta",
35-
"Intended Audience :: Developers",
36-
"License :: OSI Approved :: Apache Software License",
37-
"Operating System :: MacOS :: MacOS X",
38-
"Operating System :: Microsoft :: Windows",
39-
"Operating System :: POSIX",
40-
"Programming Language :: Python :: 3",
41-
"Programming Language :: Python :: 3.5",
42-
"Programming Language :: Python :: 3.6",
43-
"Programming Language :: Python :: 3.7",
44-
"Programming Language :: Python :: 3.8",
45-
"Programming Language :: Python :: Implementation :: CPython",
46-
"Programming Language :: Python :: Implementation :: PyPy",
47-
"Topic :: Database"]
48-
)
2+
from setuptools import setup; setup()

test/crud/v2/unacknowledged-bulkWrite-delete-hint-clientError.json

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

0 commit comments

Comments
 (0)