-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2637 from bagerard/prepare_0_24_1
Prepare release 0 24 1
- Loading branch information
Showing
7 changed files
with
30 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
fail_fast: false | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
rev: v4.1.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- repo: https://github.com/ambv/black | ||
rev: 21.5b2 | ||
rev: 22.1.0 | ||
hooks: | ||
- id: black | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.19.1 | ||
rev: v2.31.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py36-plus] | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.8.0 | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,34 +38,34 @@ def init_book(): | |
author_email="[email protected]", | ||
) | ||
|
||
print("Doc initialization: %.3fus" % (timeit(init_book, 1000) * 10 ** 6)) | ||
print("Doc initialization: %.3fus" % (timeit(init_book, 1000) * 10**6)) | ||
|
||
b = init_book() | ||
print("Doc getattr: %.3fus" % (timeit(lambda: b.name, 10000) * 10 ** 6)) | ||
print("Doc getattr: %.3fus" % (timeit(lambda: b.name, 10000) * 10**6)) | ||
|
||
print( | ||
"Doc setattr: %.3fus" | ||
% (timeit(lambda: setattr(b, "name", "New name"), 10000) * 10 ** 6) # noqa B010 | ||
% (timeit(lambda: setattr(b, "name", "New name"), 10000) * 10**6) # noqa B010 | ||
) | ||
|
||
print("Doc to mongo: %.3fus" % (timeit(b.to_mongo, 1000) * 10 ** 6)) | ||
print("Doc to mongo: %.3fus" % (timeit(b.to_mongo, 1000) * 10**6)) | ||
|
||
print("Doc validation: %.3fus" % (timeit(b.validate, 1000) * 10 ** 6)) | ||
print("Doc validation: %.3fus" % (timeit(b.validate, 1000) * 10**6)) | ||
|
||
def save_book(): | ||
b._mark_as_changed("name") | ||
b._mark_as_changed("tags") | ||
b.save() | ||
|
||
print("Save to database: %.3fus" % (timeit(save_book, 100) * 10 ** 6)) | ||
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) | ||
"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) | ||
"Load from database: %.3fus" % (timeit(lambda: Book.objects[0], 100) * 10**6) | ||
) | ||
|
||
def create_and_delete_book(): | ||
|
@@ -75,7 +75,7 @@ def create_and_delete_book(): | |
|
||
print( | ||
"Init + save to database + delete: %.3fms" | ||
% (timeit(create_and_delete_book, 10) * 10 ** 3) | ||
% (timeit(create_and_delete_book, 10) * 10**3) | ||
) | ||
|
||
|
||
|
@@ -101,9 +101,9 @@ def init_company(): | |
) | ||
|
||
company = init_company() | ||
print("Big doc to mongo: %.3fms" % (timeit(company.to_mongo, 100) * 10 ** 3)) | ||
print("Big doc to mongo: %.3fms" % (timeit(company.to_mongo, 100) * 10**3)) | ||
|
||
print("Big doc validation: %.3fms" % (timeit(company.validate, 1000) * 10 ** 3)) | ||
print("Big doc validation: %.3fms" % (timeit(company.validate, 1000) * 10**3)) | ||
|
||
company.save() | ||
|
||
|
@@ -112,17 +112,17 @@ def save_company(): | |
company._mark_as_changed("contacts") | ||
company.save() | ||
|
||
print("Save to database: %.3fms" % (timeit(save_company, 100) * 10 ** 3)) | ||
print("Save to database: %.3fms" % (timeit(save_company, 100) * 10**3)) | ||
|
||
son = company.to_mongo() | ||
print( | ||
"Load from SON: %.3fms" | ||
% (timeit(lambda: Company._from_son(son), 100) * 10 ** 3) | ||
% (timeit(lambda: Company._from_son(son), 100) * 10**3) | ||
) | ||
|
||
print( | ||
"Load from database: %.3fms" | ||
% (timeit(lambda: Company.objects[0], 100) * 10 ** 3) | ||
% (timeit(lambda: Company.objects[0], 100) * 10**3) | ||
) | ||
|
||
def create_and_delete_company(): | ||
|
@@ -132,7 +132,7 @@ def create_and_delete_company(): | |
|
||
print( | ||
"Init + save to database + delete: %.3fms" | ||
% (timeit(create_and_delete_company, 10) * 10 ** 3) | ||
% (timeit(create_and_delete_company, 10) * 10**3) | ||
) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
) | ||
|
||
|
||
VERSION = (0, 24, 0) | ||
VERSION = (0, 24, 1) | ||
|
||
|
||
def get_version(): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters