Skip to content

Commit

Permalink
autoupdate pc hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
bagerard committed Mar 10, 2024
1 parent d4df743 commit 82cbd97
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/ambv/black
rev: 23.9.1
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- importlib_metadata<5
- repo: https://github.com/asottile/pyupgrade
rev: v3.14.0
rev: v3.15.1
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
14 changes: 4 additions & 10 deletions benchmarks/test_basic_doc_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,9 @@ def save_book():
print("Save to database: %.3fus" % (timeit(save_book, 100) * 10**6))

son = b.to_mongo()
print(
"Load from SON: %.3fus" % (timeit(lambda: Book._from_son(son), 1000) * 10**6)
)
print("Load from SON: %.3fus" % (timeit(lambda: Book._from_son(son), 1000) * 10**6))

print(
"Load from database: %.3fus" % (timeit(lambda: Book.objects[0], 100) * 10**6)
)
print("Load from database: %.3fus" % (timeit(lambda: Book.objects[0], 100) * 10**6))

def create_and_delete_book():
b = init_book()
Expand Down Expand Up @@ -116,13 +112,11 @@ def save_company():

son = company.to_mongo()
print(
"Load from SON: %.3fms"
% (timeit(lambda: Company._from_son(son), 100) * 10**3)
"Load from SON: %.3fms" % (timeit(lambda: Company._from_son(son), 100) * 10**3)
)

print(
"Load from database: %.3fms"
% (timeit(lambda: Company.objects[0], 100) * 10**3)
"Load from database: %.3fms" % (timeit(lambda: Company.objects[0], 100) * 10**3)
)

def create_and_delete_company():
Expand Down
1 change: 1 addition & 0 deletions mongoengine/mongodb_support.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Helper functions, constants, and types to aid with MongoDB version support
"""

from mongoengine.connection import get_connection

# Constant that can be used to compare the version retrieved with
Expand Down
1 change: 1 addition & 0 deletions mongoengine/pymongo_support.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Helper functions, constants, and types to aid with PyMongo support.
"""

import pymongo
from bson import binary, json_util
from pymongo.errors import OperationFailure
Expand Down
6 changes: 3 additions & 3 deletions mongoengine/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def _fail(self, *args, **kwargs):
)

send = lambda *a, **kw: None # noqa
connect = (
disconnect
) = has_receivers_for = receivers_for = temporarily_connected_to = _fail
connect = disconnect = has_receivers_for = receivers_for = (
temporarily_connected_to
) = _fail
del _fail


Expand Down
1 change: 1 addition & 0 deletions tests/all_warnings/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
only get triggered on first hit. This way we can ensure its imported into the
top level and called first by the test suite.
"""

import unittest
import warnings

Expand Down

0 comments on commit 82cbd97

Please sign in to comment.