Skip to content

Commit

Permalink
sorted some imports
Browse files Browse the repository at this point in the history
  • Loading branch information
fcurella committed Aug 7, 2019
1 parent 93c9375 commit b1b9f88
Show file tree
Hide file tree
Showing 20 changed files with 46 additions and 45 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
test:
coverage run --source=faker --omit=faker/build_docs.py setup.py test

isort:
isort -rc --atomic .

release:
check-manifest
rm -rf build dist
Expand Down
2 changes: 1 addition & 1 deletion faker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from faker.generator import Generator # noqa F401
from faker.factory import Factory # noqa F401
from faker.generator import Generator # noqa F401

VERSION = '2.0.0'

Expand Down
4 changes: 1 addition & 3 deletions faker/build_docs.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# coding=utf-8

from __future__ import print_function
from __future__ import unicode_literals
from __future__ import print_function, unicode_literals

import os
import pprint
import sys

import six


DOCS_ROOT = os.path.abspath(os.path.join('..', 'docs'))


Expand Down
14 changes: 5 additions & 9 deletions faker/cli.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# coding=utf-8

from __future__ import unicode_literals
from __future__ import print_function
from __future__ import print_function, unicode_literals

import argparse
import logging
import os
import random
import sys
import argparse

import random
import six

from faker import Faker, documentor
from faker import VERSION
from faker import VERSION, Faker, documentor
from faker.config import AVAILABLE_LOCALES, DEFAULT_LOCALE, META_PROVIDERS_MODULES

import logging


__author__ = 'joke2k'


Expand Down
1 change: 1 addition & 0 deletions faker/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# coding=utf-8
from importlib import import_module

from faker.utils.loading import find_available_locales, find_available_providers

DEFAULT_LOCALE = 'en_US'
Expand Down
4 changes: 2 additions & 2 deletions faker/documentor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import inspect

from .compat import getargspec

from faker import utils

from .compat import getargspec


class Documentor(object):

Expand Down
10 changes: 4 additions & 6 deletions faker/factory.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# coding=utf-8

from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import absolute_import, unicode_literals

from importlib import import_module
import locale as pylocale

import logging
import sys

from importlib import import_module

from faker import Generator
from faker.config import DEFAULT_LOCALE, PROVIDERS, AVAILABLE_LOCALES
from faker.config import AVAILABLE_LOCALES, DEFAULT_LOCALE, PROVIDERS
from faker.utils.loading import list_module


logger = logging.getLogger(__name__)

# identify if python is being run in interactive mode. If so, disable logging.
Expand Down
2 changes: 1 addition & 1 deletion faker/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from __future__ import unicode_literals

import re
import random as random_module
import re

_re_token = re.compile(r'\{\{(\s?)(\w+)(\s?)\}\}')
random = random_module.Random()
Expand Down
1 change: 0 additions & 1 deletion faker/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from faker.utils.distribution import choices_distribution, choices_distribution_unique


_re_hash = re.compile(r'#')
_re_perc = re.compile(r'%')
_re_excl = re.compile(r'!')
Expand Down
3 changes: 2 additions & 1 deletion faker/utils/datasets.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# coding=utf-8

import operator

from collections import Counter
from functools import reduce
import operator


def add_dicts(*args):
Expand Down
6 changes: 4 additions & 2 deletions faker/utils/datetime_safe.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
# '1850/08/02 was a Friday'

from __future__ import unicode_literals
from datetime import date as real_date
from datetime import datetime as real_datetime

import re
import time

from datetime import date as real_date
from datetime import datetime as real_datetime


class date(real_date):
def strftime(self, fmt):
Expand Down
1 change: 1 addition & 0 deletions faker/utils/distribution.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# coding=utf-8

import bisect

from faker.generator import random as mod_random


Expand Down
3 changes: 2 additions & 1 deletion faker/utils/loading.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
import pkgutil
import sys

from importlib import import_module
import pkgutil


def get_path(module):
Expand Down
3 changes: 1 addition & 2 deletions faker/utils/text.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# coding=utf-8

import re

import six
import unicodedata

import six

_re_pattern = re.compile(r'[^\w\s-]', flags=re.U)
_re_pattern_allow_dots = re.compile(r'[^\.\w\s-]', flags=re.U)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env python
# coding=utf-8

import os
import io
import os

from setuptools import setup, find_packages
from setuptools import find_packages, setup

here = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as fp:
Expand Down
1 change: 1 addition & 0 deletions tests/mymodule/en_US/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import unicode_literals

from faker.providers import BaseProvider


Expand Down
2 changes: 1 addition & 1 deletion tests/test_base_provider.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
import string
import unittest

import six

Expand Down
8 changes: 4 additions & 4 deletions tests/test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
from __future__ import unicode_literals

import re
import unittest
import string
import sys
import unittest

from collections import OrderedDict
from ipaddress import ip_address, ip_network

import six
import pytest
import six

from faker import Generator, Faker
from faker import Faker, Generator
from faker.generator import random
from faker.utils import text, decorators
from faker.utils import decorators, text


class BarProvider(object):
Expand Down
1 change: 1 addition & 0 deletions tests/test_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unittest

from faker import Generator

try:
Expand Down
18 changes: 9 additions & 9 deletions tests/utils/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from faker.utils.loading import find_available_locales
from faker.utils.distribution import choices_distribution, choices_distribution_unique
from faker.utils.datasets import add_dicts
from faker.config import PROVIDERS
from faker.generator import random
from faker.utils.loading import find_available_providers
from faker.config import META_PROVIDERS_MODULES
from importlib import import_module
import unittest
import json
import os
import unittest

from importlib import import_module

from faker.config import META_PROVIDERS_MODULES, PROVIDERS
from faker.generator import random
from faker.utils.datasets import add_dicts
from faker.utils.distribution import choices_distribution, choices_distribution_unique
from faker.utils.loading import find_available_locales, find_available_providers

TEST_DIR = os.path.dirname(__file__)

Expand Down

0 comments on commit b1b9f88

Please sign in to comment.