Skip to content

Commit

Permalink
Merge pull request #69 from sugat009/use_isort
Browse files Browse the repository at this point in the history
Use isort
  • Loading branch information
aj3sh authored Jun 13, 2023
2 parents cbb938f + ce12809 commit d4c7349
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 30 deletions.
2 changes: 1 addition & 1 deletion nepali/datetime/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ._datetime import nepalidate, nepalitime, nepalidatetime
from ._datetime import nepalidate, nepalidatetime, nepalitime
from ._formatter import NepaliDateTimeFormatter
from ._humanize import HumanizeDateTime, nepalihumanize
from ._nepalimonth import nepalimonth
Expand Down
2 changes: 1 addition & 1 deletion nepali/datetime/_datetime.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import datetime as pythonDateTime

from nepali.date_converter import converter as nepali_date_converter
from nepali.timezone import NepaliTimeZone, utc_now, to_nepali_timezone
from nepali.timezone import NepaliTimeZone, to_nepali_timezone, utc_now

from ._nepalimonth import nepalimonth

Expand Down
1 change: 1 addition & 0 deletions nepali/datetime/_formatter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime as pythonDateTime

from nepali import number
from nepali.exceptions import (
InvalidDateFormatException,
Expand Down
2 changes: 1 addition & 1 deletion nepali/datetime/parser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ._parser import strptime, parse
from ._parser import parse, strptime

__all__ = [
"strptime",
Expand Down
2 changes: 1 addition & 1 deletion nepali/datetime/parser/_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nepali.exceptions import InvalidDateTimeFormatException, FormatNotMatchException
from nepali.exceptions import FormatNotMatchException, InvalidDateTimeFormatException

from .validators import validate

Expand Down
1 change: 1 addition & 0 deletions nepali/datetime/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime
from typing import Any

from nepali.exceptions import InvalidNepaliDateTimeObjectException

from ._datetime import nepalidate, nepalidatetime
Expand Down
2 changes: 1 addition & 1 deletion nepali/locations/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from ._locations import provinces, districts, municipalities
from ._locations import districts, municipalities, provinces

__all__ = ["provinces", "districts", "municipalities"]
2 changes: 1 addition & 1 deletion nepali/locations/_locations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Tuple

from .models import Province, District, Municipality, MunicipalityType
from .models import District, Municipality, MunicipalityType, Province


def _loadData() -> Tuple[List[Province], List[District], List[Municipality]]:
Expand Down
3 changes: 1 addition & 2 deletions nepali/locations/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import re
from functools import partial

from ._locations import provinces, districts, municipalities

from ._locations import districts, municipalities, provinces

__all__ = [
"get_province",
Expand Down
2 changes: 1 addition & 1 deletion nepali/number/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ._number import NepaliNumber
from ._nepalinumber import nepalinumber
from ._number import NepaliNumber
from .utils import (
add_comma,
add_comma_english,
Expand Down
1 change: 1 addition & 0 deletions nepali/number/_nepalinumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

from typing import Any, Tuple, Type, Union

from .utils import NP_NUMBERS, NP_NUMBERS_SET, english_to_nepali


Expand Down
7 changes: 1 addition & 6 deletions nepali/number/_number.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import warnings

from .utils import (
add_comma,
add_comma_english,
english_to_nepali,
nepali_to_english,
)
from .utils import add_comma, add_comma_english, english_to_nepali, nepali_to_english


# Backward compatibility support for legacy NepaliNumber
Expand Down
1 change: 0 additions & 1 deletion nepali/number/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import Any


NP_NUMBERS = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"]
NP_NUMBERS_SET = set(NP_NUMBERS)

Expand Down
1 change: 0 additions & 1 deletion nepali/phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from enum import Enum
from typing import Union


_mobile_number_re = re.compile(r"^(?:\+977|977)?(?:-)?(?:98|97|96)\d{8}$")
_landline_number_re = re.compile(
r"^(?:\+977|977)?(?:-)?(?:0)?(?:[01][1-9]|2[13-9]|[3-9]\d)\d{6,7}$"
Expand Down
4 changes: 2 additions & 2 deletions nepali/tests/test_datetime.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import datetime
import unittest

from nepali.datetime import nepalidate, nepalitime, nepalidatetime
from nepali.datetime.utils import to_nepalidatetime, to_nepalidate
from nepali.datetime import nepalidate, nepalidatetime, nepalitime
from nepali.datetime.utils import to_nepalidate, to_nepalidatetime
from nepali.exceptions import InvalidNepaliDateTimeObjectException
from nepali.timezone import NepaliTimeZone

Expand Down
3 changes: 1 addition & 2 deletions nepali/tests/test_humanize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import unittest
from unittest.mock import patch

from nepali.datetime import nepalihumanize, HumanizeDateTime, nepalidate, nepalidatetime
from nepali.datetime import HumanizeDateTime, nepalidate, nepalidatetime, nepalihumanize
from nepali.exceptions import InvalidNepaliDateTimeObjectException
from nepali.timezone import NepaliTimeZone


REF_TIME = datetime.datetime(2015, 1, 1, 10, 15, tzinfo=NepaliTimeZone())


Expand Down
6 changes: 3 additions & 3 deletions nepali/tests/test_locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

from nepali import locations
from nepali.locations.models import (
District,
Location,
Municipality,
MunicipalityType,
Province,
District,
Municipality,
)
from nepali.locations.utils import (
_filter_location,
get_province,
get_district,
get_municipality,
get_province,
)


Expand Down
6 changes: 4 additions & 2 deletions nepali/tests/test_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import unittest

from nepali import number
from nepali.number import nepalinumber, NepaliNumber
from nepali.number import NepaliNumber, nepalinumber


class TestNumber(unittest.TestCase):
Expand Down Expand Up @@ -1008,7 +1008,9 @@ def test_nepalinumber_float_is_multiplicable_to_negative_float(self):
self.nepalinumber_float_4_5 * (-2.2), self.nepalinumber_negative_float_9_9
)

def test_nepalinumber_float_is_multiplicable_to_positive_nepali_number_integer(self):
def test_nepalinumber_float_is_multiplicable_to_positive_nepali_number_integer(
self,
):
self.assertEqual(
self.nepalinumber_float_10_1 * self.nepalinumber_integer_2,
self.nepalinumber_float_20_2,
Expand Down
6 changes: 3 additions & 3 deletions nepali/tests/test_phone_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
from unittest import mock

from nepali.phone_number import (
Operator,
_get_area_code,
_get_operator,
_parse_landline_number,
_parse_mobile_number,
is_mobile_number,
get_exact_number,
is_landline_number,
is_mobile_number,
is_valid,
get_exact_number,
parse,
Operator,
)


Expand Down
2 changes: 1 addition & 1 deletion nepali/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from nepali.datetime.utils import to_nepalidate, to_nepalidatetime
from nepali.timezone import to_utc_timezone, to_nepali_timezone
from nepali.timezone import to_nepali_timezone, to_utc_timezone

__all__ = [
"to_nepalidate",
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
import os
import sys

import setuptools

with open("README.md", "r") as fh:
Expand Down

0 comments on commit d4c7349

Please sign in to comment.