Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.8']
python-version: ['3.11', '3.12']
toxenv: [testenv]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:

steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: setup python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Install pip
run: pip install -r requirements/pip.txt
Expand Down
4 changes: 3 additions & 1 deletion mongodb_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import pymongo.collection
import time

from pymongo.database import Database

log = logging.getLogger(__name__)

MONGO_METHODS_NEEDING_RETRY = {
Expand Down Expand Up @@ -104,7 +106,7 @@ def __getattr__(self, key):
that handles AutoReconnect exceptions. Otherwise wrap it in a MongoProxy object.
"""
attr = getattr(self.proxied_object, key)
if hasattr(attr, '__call__') or isinstance(attr, pymongo.database.Database):
if hasattr(attr, '__call__') or isinstance(attr, Database):
attributes_for_class = self.methods_needing_retry.get(self.proxied_object.__class__, [])
if key in attributes_for_class:
return autoretry_read(self.wait_time)(attr)
Expand Down
8 changes: 5 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
#
pymongo==4.1.1
dnspython==2.7.0
# via pymongo
pymongo==4.12.0
# via -r requirements/base.in
57 changes: 29 additions & 28 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
#
distlib==0.3.4
cachetools==5.5.2
# via
# -r requirements/tox.txt
# virtualenv
filelock==3.7.1
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# tox
chardet==5.2.0
# via
# -r requirements/tox.txt
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# tox
# virtualenv
packaging==21.3
colorama==0.4.6
# via
# -r requirements/tox.txt
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# tox
platformdirs==2.5.2
distlib==0.3.9
# via
# -r requirements/tox.txt
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# virtualenv
pluggy==1.0.0
filelock==3.18.0
# via
# -r requirements/tox.txt
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# tox
py==1.11.0
# virtualenv
packaging==25.0
# via
# -r requirements/tox.txt
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# pyproject-api
# tox
pyparsing==3.0.9
platformdirs==4.3.7
# via
# -r requirements/tox.txt
# packaging
six==1.16.0
# via
# -r requirements/tox.txt
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# tox
# virtualenv
toml==0.10.2
pluggy==1.5.0
# via
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# tox
pyproject-api==1.9.0
# via
# -r requirements/tox.txt
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# tox
tox==3.25.0
# via -r requirements/tox.txt
virtualenv==20.14.1
tox==4.25.0
# via -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
virtualenv==20.30.0
# via
# -r requirements/tox.txt
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/tox.txt
# tox
10 changes: 5 additions & 5 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#
# This file is autogenerated by pip-compile
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
#
wheel==0.37.1
wheel==0.45.1
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==22.1.2
pip==25.0.1
# via -r requirements/pip.in
setuptools==62.3.2
setuptools==79.0.0
# via -r requirements/pip.in
20 changes: 12 additions & 8 deletions requirements/pip_tools.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
#
# This file is autogenerated by pip-compile
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
#
click==8.1.3
build==1.2.2.post1
# via pip-tools
pep517==0.12.0
click==8.1.8
# via pip-tools
pip-tools==6.6.2
packaging==25.0
# via build
pip-tools==7.4.1
# via -r requirements/pip_tools.in
tomli==2.0.1
# via pep517
wheel==0.37.1
pyproject-hooks==1.2.0
# via
# build
# pip-tools
wheel==0.45.1
# via pip-tools

# The following packages are considered to be unsafe in a requirements file:
Expand Down
28 changes: 12 additions & 16 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
#
attrs==21.4.0
dnspython==2.7.0
# via
# -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/base.txt
# pymongo
iniconfig==2.1.0
# via pytest
iniconfig==1.1.1
packaging==25.0
# via pytest
packaging==21.3
pluggy==1.5.0
# via pytest
pluggy==1.0.0
# via pytest
py==1.11.0
# via pytest
pymongo==4.1.1
# via -r requirements/base.txt
pyparsing==3.0.9
# via packaging
pytest==7.1.2
pymongo==4.12.0
# via -r /Users/tayyab.tahir/Documents/Axim/openedx_repos/MongoDBProxy/requirements/base.txt
pytest==8.3.5
# via -r requirements/test.in
tomli==2.0.1
# via pytest
38 changes: 20 additions & 18 deletions requirements/tox.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
#
distlib==0.3.4
cachetools==5.5.2
# via tox
chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
distlib==0.3.9
# via virtualenv
filelock==3.7.1
filelock==3.18.0
# via
# tox
# virtualenv
packaging==21.3
# via tox
platformdirs==2.5.2
# via virtualenv
pluggy==1.0.0
# via tox
py==1.11.0
# via tox
pyparsing==3.0.9
# via packaging
six==1.16.0
packaging==25.0
# via
# pyproject-api
# tox
platformdirs==4.3.7
# via
# tox
# virtualenv
toml==0.10.2
pluggy==1.5.0
# via tox
pyproject-api==1.9.0
# via tox
tox==3.25.0
tox==4.25.0
# via -r requirements/tox.in
virtualenv==20.14.1
virtualenv==20.30.0
# via tox
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def is_requirement(line):
setup(
name='openedx-mongodbproxy',
py_modules=['mongodb_proxy'],
version='0.2.2',
version='0.3.0',
description='Proxy around MongoDB connection that automatically handles AutoReconnect exceptions.',
author='Gustav Arngarden',
long_description=README_MARKDOWN,
Expand All @@ -55,8 +55,8 @@ def is_requirement(line):
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
install_requires=load_requirements('requirements/base.in'),
url="https://github.com/arngarden/MongoDBProxy"
Expand Down