Skip to content

Commit

Permalink
Merge pull request #463 from MongoEngine/isort
Browse files Browse the repository at this point in the history
Added: Isort CI/CD helper and configuration
  • Loading branch information
insspb committed Jul 1, 2022
2 parents 83abc9c + d567e0d commit 7c39717
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ repos:
- id: markdownlint
args: [-f]
exclude: ^(.github|tests)
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import sys

import flask_mongoengine

# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
3 changes: 2 additions & 1 deletion examples/simpleapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), "../../")))

from flask_mongoengine import MongoEngine
from flask_debugtoolbar import DebugToolbarExtension

from flask_mongoengine import MongoEngine

app = flask.Flask(__name__)
app.config.from_object(__name__)
app.config["MONGODB_SETTINGS"] = {"DB": "testing"}
Expand Down
1 change: 0 additions & 1 deletion flask_mongoengine/connection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import mongoengine
from pymongo import ReadPreference, uri_parser


__all__ = (
"create_connections",
"get_connection_settings",
Expand Down
2 changes: 1 addition & 1 deletion flask_mongoengine/sessions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import timedelta, datetime
import uuid
from datetime import datetime, timedelta

from bson.tz_util import utc
from flask.sessions import SessionInterface, SessionMixin
Expand Down
3 changes: 2 additions & 1 deletion flask_mongoengine/wtf/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

from bson import ObjectId
from mongoengine import ReferenceField
from wtforms import fields as f, validators
from wtforms import fields as f
from wtforms import validators

from flask_mongoengine.wtf.fields import (
BinaryField,
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ exclude = '''
| dist
)/
'''

[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from setuptools import setup

from setuptools import setup

description = (
"Flask-MongoEngine is a Flask extension "
Expand Down
3 changes: 2 additions & 1 deletion tests/test_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Tests for base MongoEngine class."""
from flask_mongoengine import MongoEngine
import pytest

from flask_mongoengine import MongoEngine


def test_mongoengine_class__should_raise_type_error__if_config_not_dict():
"""MongoEngine will handle None values, but will pass anything else as app."""
Expand Down

0 comments on commit 7c39717

Please sign in to comment.