Skip to content

Commit

Permalink
Add isort for cleaner imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbarrois committed Mar 5, 2018
1 parent 31228d5 commit 5304de6
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 27 deletions.
7 changes: 5 additions & 2 deletions Makefile
Expand Up @@ -26,12 +26,15 @@ test:

.PHONY: test testall

lint: flake8 check-manifest
lint: flake8 isort check-manifest

flake8:
flake8 --config .flake8 $(PACKAGE) $(TESTS_DIR)

isort:
isort $(PACKAGE) $(TESTS_DIR) --recursive --check-only --diff

check-manifest:
check-manifest

.PHONY: lint flake8 check-manifest
.PHONY: isort lint flake8 check-manifest
1 change: 1 addition & 0 deletions examples/admin.py
Expand Up @@ -4,6 +4,7 @@


from django.contrib import admin

from examples.models import LdapGroup, LdapUser


Expand Down
3 changes: 1 addition & 2 deletions examples/models.py
Expand Up @@ -4,9 +4,8 @@

from __future__ import unicode_literals

from ldapdb.models.fields import (CharField, ImageField, ListField,
IntegerField)
import ldapdb.models
from ldapdb.models.fields import CharField, ImageField, IntegerField, ListField


class LdapUser(ldapdb.models.Model):
Expand Down
10 changes: 4 additions & 6 deletions examples/tests.py
Expand Up @@ -8,18 +8,16 @@
import factory.django
import factory.fuzzy
import volatildap

from django.conf import settings
from django.contrib.auth import models as auth_models
from django.contrib.auth import hashers as auth_hashers
from django.contrib.auth import models as auth_models
from django.core import management
from django.db import connections
from django.db.models import Q, Count
from django.db.models import Count, Q
from django.test import TestCase

from ldapdb.backends.ldap.compiler import query_as_ldap, SQLCompiler
from examples.models import LdapUser, LdapGroup

from examples.models import LdapGroup, LdapUser
from ldapdb.backends.ldap.compiler import SQLCompiler, query_as_ldap

groups = ('ou=groups,dc=example,dc=org', {
'objectClass': ['top', 'organizationalUnit'], 'ou': ['groups']})
Expand Down
8 changes: 3 additions & 5 deletions ldapdb/backends/ldap/base.py
Expand Up @@ -6,16 +6,14 @@

import ldap
import ldap.controls

import django
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.backends.base.client import BaseDatabaseClient
from django.db.backends.base.creation import BaseDatabaseCreation
from django.db.backends.base.features import BaseDatabaseFeatures
from django.db.backends.base.introspection import BaseDatabaseIntrospection
from django.db.backends.base.operations import BaseDatabaseOperations
from django.db.backends.base.base import BaseDatabaseWrapper
from django.db.backends.base.creation import BaseDatabaseCreation
from django.db.backends.base.validation import BaseDatabaseValidation
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.backends.base.validation import BaseDatabaseValidation


class DatabaseCreation(BaseDatabaseCreation):
Expand Down
3 changes: 1 addition & 2 deletions ldapdb/backends/ldap/compiler.py
Expand Up @@ -5,10 +5,10 @@
from __future__ import unicode_literals

import collections
import ldap
import re
import sys

import ldap
from django.db.models import aggregates
from django.db.models.sql import compiler
from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE
Expand All @@ -17,7 +17,6 @@
from ldapdb import escape_ldap_filter
from ldapdb.models.fields import ListField


if sys.version_info[0] < 3:
integer_types = (int, long) # noqa: F821
else:
Expand Down
3 changes: 1 addition & 2 deletions ldapdb/models/base.py
Expand Up @@ -4,16 +4,15 @@

from __future__ import unicode_literals

import ldap
import logging

import django.db.models
import ldap
from django.db import connections, router
from django.db.models import signals

import ldapdb # noqa


logger = logging.getLogger('ldapdb')


Expand Down
3 changes: 1 addition & 2 deletions ldapdb/models/fields.py
Expand Up @@ -6,8 +6,7 @@

import datetime

from django.db.models import fields
from django.db.models import lookups
from django.db.models import fields, lookups


class LdapLookup(lookups.Lookup):
Expand Down
11 changes: 5 additions & 6 deletions ldapdb/tests.py
Expand Up @@ -6,16 +6,15 @@
from __future__ import unicode_literals

from django.db import connections
from django.db.models.sql.where import AND, OR, WhereNode
from django.db.models.sql import query as django_query
from django.db.models import expressions
from django.db.models.sql import query as django_query
from django.db.models.sql.where import AND, OR, WhereNode
from django.test import TestCase

from ldapdb import escape_ldap_filter
from ldapdb import models
from ldapdb import escape_ldap_filter, models
from ldapdb.backends.ldap import compiler as ldapdb_compiler
from ldapdb.models.fields import (CharField, IntegerField, FloatField,
ListField, DateField)
from ldapdb.models.fields import (CharField, DateField, FloatField,
IntegerField, ListField)


class FakeModel(models.Model):
Expand Down
1 change: 1 addition & 0 deletions requirements_test.txt
Expand Up @@ -2,4 +2,5 @@
check-manifest
flake8
factory_boy
isort
volatildap>=1.1.0

0 comments on commit 5304de6

Please sign in to comment.