Skip to content

Commit e9a12ef

Browse files
authored
Merge pull request #2826 from vtomasr5/support-pymongo-4.7-and-4.8
Add pymongo 4.7 and pymongo 4.8 to the CI
2 parents 9e3f1d9 + 04f7f88 commit e9a12ef

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

.github/workflows/github-actions.yml

+11
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ env:
2929
PYMONGO_4_3: 4.3.3
3030
PYMONGO_4_4: 4.4.1
3131
PYMONGO_4_6: 4.6.2
32+
PYMONGO_4_7: 4.7.3
33+
PYMONGO_4_8: 4.8.0
3234

3335
MAIN_PYTHON_VERSION: 3.9
3436

37+
MONGOSH: 2.2.15 # Needed for MongoDB 6.0+
38+
3539
jobs:
3640
linting:
3741
# Run pre-commit (https://pre-commit.com/)
@@ -78,6 +82,12 @@ jobs:
7882
- python-version: "3.11"
7983
MONGODB: $MONGODB_7_0
8084
PYMONGO: $PYMONGO_4_6
85+
- python-version: "3.11"
86+
MONGODB: $MONGODB_7_0
87+
PYMONGO: $PYMONGO_4_7
88+
- python-version: "3.11"
89+
MONGODB: $MONGODB_7_0
90+
PYMONGO: $PYMONGO_4_8
8191
steps:
8292
- uses: actions/checkout@v3
8393
- name: Set up Python ${{ matrix.python-version }}
@@ -88,6 +98,7 @@ jobs:
8898
- name: install mongo and ci dependencies
8999
run: |
90100
bash .github/workflows/install_mongo.sh ${{ matrix.MONGODB }}
101+
bash .github/workflows/install_mongosh.sh ${{ matrix.MONGODB }} ${{ env.MONGOSH }}
91102
bash .github/workflows/install_ci_python_dep.sh
92103
bash .github/workflows/start_mongo.sh ${{ matrix.MONGODB }}
93104
- name: tox dry-run (to pre-install venv)

.github/workflows/install_mongosh.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
MONGODB=$1
4+
MONGOSH=$2
5+
6+
if (( $(echo "$MONGODB < 6.0" | bc -l) )); then
7+
echo "mongosh is not needed for MongoDB versions less than 6.0"
8+
exit 0
9+
fi
10+
11+
wget https://downloads.mongodb.com/compass/mongosh-${MONGOSH}-linux-x64.tgz
12+
tar xzf mongosh-${MONGOSH}-linux-x64.tgz
13+
14+
mongosh_dir=$(find ${PWD}/ -type d -name "mongosh-${MONGOSH}-linux-x64")
15+
$mongosh_dir/bin/mongosh --version

.github/workflows/start_mongo.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ mongodb_dir=$(find ${PWD}/ -type d -name "mongodb-linux-x86_64*")
66

77
mkdir $mongodb_dir/data
88
$mongodb_dir/bin/mongod --dbpath $mongodb_dir/data --logpath $mongodb_dir/mongodb.log --fork
9-
mongo --eval 'db.version();' # Make sure mongo is awake
9+
10+
if (( $(echo "$MONGODB < 6.0" | bc -l) )); then
11+
mongo --quiet --eval 'db.runCommand("ping").ok' # Make sure mongo is awake
12+
else
13+
mongosh --quiet --eval 'db.runCommand("ping").ok' # Make sure mongo is awake
14+
fi

tox.ini

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = pypy3-{mg34,mg36,mg39,mg311,mg312,mg4,mg432,mg441,mg460}
2+
envlist = pypy3-{mg34,mg36,mg39,mg311,mg312,mg4,mg432,mg441,mg462,mg473,mg480}
33
skipsdist = True
44

55
[testenv]
@@ -14,5 +14,7 @@ deps =
1414
mg433: pymongo>=4.3,<4.4
1515
mg441: pymongo>=4.4,<4.5
1616
mg462: pymongo>=4.6,<4.7
17+
mg473: pymongo>=4.7,<4.8
18+
mg480: pymongo>=4.8,<4.9
1719
setenv =
1820
PYTHON_EGG_CACHE = {envdir}/python-eggs

0 commit comments

Comments
 (0)