diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..facde560 --- /dev/null +++ b/.flake8 @@ -0,0 +1,20 @@ +[flake8] +max-line-length = 88 +ignore = E501, E203, W503 +per-file-ignores = + __init__.py:F401 + pendulum/tz/timezone.py:F811 +exclude = + .git + __pycache__ + setup.py + build + dist + releases + .idea + .venv + .tox + .mypy_cache + .pytest_cache + .vscode + .github diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6b719683..42669213 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,26 @@ repos: -- repo: https://github.com/ambv/black + - repo: https://github.com/psf/black rev: stable hooks: - - id: black - python_version: python3.6 + - id: black + + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.8 + hooks: + - id: flake8 + + - repo: https://github.com/timothycrosley/isort + rev: 4.3.21 + hooks: + - id: isort + additional_dependencies: [toml] + exclude: ^.*/?setup\.py$ + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: trailing-whitespace + exclude: ^tests/.*/fixtures/.* + - id: end-of-file-fixer + exclude: ^tests/.*/fixtures/.* + - id: debug-statements diff --git a/build.py b/build.py index 299d76ba..cf561260 100644 --- a/build.py +++ b/build.py @@ -1,11 +1,11 @@ import os import sys - -from distutils.core import Extension - -from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError from distutils.command.build_ext import build_ext +from distutils.core import Extension +from distutils.errors import CCompilerError +from distutils.errors import DistutilsExecError +from distutils.errors import DistutilsPlatformError # C Extensions diff --git a/clock b/clock index e562176c..96e226d2 100755 --- a/clock +++ b/clock @@ -6,18 +6,20 @@ import json import os from babel.core import get_global -from babel.plural import ( - PluralRule, - compile_zero, - _GettextCompiler, - _binary_compiler, - _unary_compiler, -) -from babel.dates import tokenize_pattern, PATTERN_CHARS -from babel.localedata import load, normalize_locale, LocaleDataDict - -from cleo import Application, Command +from babel.dates import PATTERN_CHARS +from babel.dates import tokenize_pattern +from babel.localedata import LocaleDataDict +from babel.localedata import load +from babel.localedata import normalize_locale +from babel.plural import PluralRule +from babel.plural import _binary_compiler +from babel.plural import _GettextCompiler +from babel.plural import _unary_compiler +from babel.plural import compile_zero +from cleo import Application +from cleo import Command from cleo import argument + from pendulum import __version__ @@ -52,14 +54,16 @@ class LocaleCreate(Command): TEMPLATE = """# -*- coding: utf-8 -*- from __future__ import unicode_literals + +from .custom import translations as custom_translations + + \"\"\" {locale} locale file. It has been generated automatically and must not be modified directly. \"\"\" -from .custom import translations as custom_translations - locale = {{ 'plural': {plural}, @@ -71,6 +75,8 @@ locale = {{ CUSTOM_TEMPLATE = """# -*- coding: utf-8 -*- from __future__ import unicode_literals + + \"\"\" {locale} custom locale file. \"\"\" diff --git a/docs/docs/index.md b/docs/docs/index.md index 1d57f7b6..daca205e 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -1,17 +1,17 @@ -{!installation.md!} -{!introduction.md!} -{!instantiation.md!} -{!parsing.md!} -{!localization.md!} -{!attributes_properties.md!} -{!fluent_helpers.md!} -{!string_formatting.md!} -{!comparison.md!} -{!addition_subtraction.md!} -{!difference.md!} -{!modifiers.md!} -{!timezones.md!} -{!duration.md!} -{!period.md!} -{!testing.md!} -{!limitations.md!} +{!docs/installation.md!} +{!docs/introduction.md!} +{!docs/instantiation.md!} +{!docs/parsing.md!} +{!docs/localization.md!} +{!docs/attributes_properties.md!} +{!docs/fluent_helpers.md!} +{!docs/string_formatting.md!} +{!docs/comparison.md!} +{!docs/addition_subtraction.md!} +{!docs/difference.md!} +{!docs/modifiers.md!} +{!docs/timezones.md!} +{!docs/duration.md!} +{!docs/period.md!} +{!docs/testing.md!} +{!docs/limitations.md!} diff --git a/docs/docs/installation.md b/docs/docs/installation.md index ea4a9afa..bfa9641f 100644 --- a/docs/docs/installation.md +++ b/docs/docs/installation.md @@ -6,7 +6,7 @@ Installing `pendulum` is quite simple: $ pip install pendulum ``` -or, if you are using [poetry](https://poetry.eustace.io): +or, if you are using [poetry](https://python-poetry.org): ```bash $ poetry add pendulum diff --git a/docs/docs/testing.md b/docs/docs/testing.md index 3ba54269..84b137e5 100644 --- a/docs/docs/testing.md +++ b/docs/docs/testing.md @@ -30,7 +30,6 @@ The provided instance will be returned specifically under the following conditio Related methods will also return values mocked according to the **now** instance. -```python >>> print(pendulum.today()) '2001-05-21T00:00:00+00:00' diff --git a/docs/docs/timezones.md b/docs/docs/timezones.md index 577198f6..85ff1477 100644 --- a/docs/docs/timezones.md +++ b/docs/docs/timezones.md @@ -102,10 +102,10 @@ with the `in_timezone()` method. !!!warning **You should avoid using the timezone library in Python < 3.6.** - + This is due to the fact that Pendulum relies heavily on the presence of the `fold` attribute which was introduced in Python 3.6. - + The reason it works inside the Pendulum ecosystem is that it backports the `fold` attribute in the `DateTime` class. diff --git a/pendulum/__init__.py b/pendulum/__init__.py index d38b69bc..bc248a23 100644 --- a/pendulum/__init__.py +++ b/pendulum/__init__.py @@ -1,63 +1,57 @@ from __future__ import absolute_import import datetime as _datetime -from typing import Union, Optional -from .__version__ import __version__ +from typing import Optional +from typing import Union -# Types -from .datetime import DateTime +from .__version__ import __version__ +from .constants import DAYS_PER_WEEK +from .constants import FRIDAY +from .constants import HOURS_PER_DAY +from .constants import MINUTES_PER_HOUR +from .constants import MONDAY +from .constants import MONTHS_PER_YEAR +from .constants import SATURDAY +from .constants import SECONDS_PER_DAY +from .constants import SECONDS_PER_HOUR +from .constants import SECONDS_PER_MINUTE +from .constants import SUNDAY +from .constants import THURSDAY +from .constants import TUESDAY +from .constants import WEDNESDAY +from .constants import WEEKS_PER_YEAR +from .constants import YEARS_PER_CENTURY +from .constants import YEARS_PER_DECADE from .date import Date -from .time import Time +from .datetime import DateTime from .duration import Duration +from .formatting import Formatter +from .helpers import format_diff +from .helpers import get_locale +from .helpers import get_test_now +from .helpers import has_test_now +from .helpers import locale +from .helpers import set_locale +from .helpers import set_test_now +from .helpers import test +from .helpers import week_ends_at +from .helpers import week_starts_at +from .parser import parse from .period import Period - +from .time import Time +from .tz import POST_TRANSITION +from .tz import PRE_TRANSITION +from .tz import TRANSITION_ERROR +from .tz import UTC +from .tz import local_timezone +from .tz import set_local_timezone +from .tz import test_local_timezone from .tz import timezone -from .tz import PRE_TRANSITION, POST_TRANSITION, TRANSITION_ERROR +from .tz import timezones from .tz.timezone import Timezone as _Timezone - -from .formatting import Formatter - -# Helpers -from .helpers import ( - test, - set_test_now, - has_test_now, - get_test_now, - set_locale, - get_locale, - locale, - format_diff, - week_starts_at, - week_ends_at, -) - from .utils._compat import _HAS_FOLD -from .tz import timezones, local_timezone, test_local_timezone, set_local_timezone, UTC - -from .parser import parse - -# Constants -from .constants import ( - MONDAY, - TUESDAY, - WEDNESDAY, - THURSDAY, - FRIDAY, - SATURDAY, - SUNDAY, - YEARS_PER_CENTURY, - YEARS_PER_DECADE, - MONTHS_PER_YEAR, - WEEKS_PER_YEAR, - DAYS_PER_WEEK, - HOURS_PER_DAY, - MINUTES_PER_HOUR, - SECONDS_PER_MINUTE, - SECONDS_PER_HOUR, - SECONDS_PER_DAY, -) _TEST_NOW = None # type: Optional[DateTime] _LOCALE = "en" @@ -245,11 +239,8 @@ def yesterday(tz="local"): # type: (Union[str, _Timezone]) -> DateTime def from_format( - string, # type: str - fmt, # type: str - tz=UTC, # type: Union[str, _Timezone] - locale=None, # type: Optional[str] -): # type: (...) -> DateTime + string, fmt, tz=UTC, locale=None, # noqa +): # type: (str, str, Union[str, _Timezone], Optional[str]) -> DateTime """ Creates a DateTime instance from a specific format. """ diff --git a/pendulum/_extensions/_helpers.c b/pendulum/_extensions/_helpers.c index 57ad96bb..e6b926b7 100644 --- a/pendulum/_extensions/_helpers.c +++ b/pendulum/_extensions/_helpers.c @@ -609,7 +609,7 @@ PyObject* precise_diff(PyObject *self, PyObject *args) { dt1_minute -= dt1_offset / SECS_PER_MIN; dt1_offset %= SECS_PER_MIN; dt1_second -= dt1_offset; - + if (dt1_second < 0) { dt1_second += 60; dt1_minute -= 1; @@ -634,7 +634,7 @@ PyObject* precise_diff(PyObject *self, PyObject *args) { dt1_day += 1; } } - + dt1_total_seconds = ( dt1_hour * SECS_PER_HOUR + dt1_minute * SECS_PER_MIN @@ -713,7 +713,7 @@ PyObject* precise_diff(PyObject *self, PyObject *args) { ); if (dt1_gt_dt2) { - PyObject* temp; + PyObject* temp; temp = dt1; dt1 = dt2; dt2 = temp; diff --git a/pendulum/_extensions/helpers.py b/pendulum/_extensions/helpers.py index 1578f97e..0132c0c9 100644 --- a/pendulum/_extensions/helpers.py +++ b/pendulum/_extensions/helpers.py @@ -1,26 +1,24 @@ -import math -from collections import namedtuple - import datetime +import math import typing -from ..constants import ( - EPOCH_YEAR, - SECS_PER_DAY, - SECS_PER_400_YEARS, - SECS_PER_100_YEARS, - SECS_PER_4_YEARS, - SECS_PER_YEAR, - SECS_PER_HOUR, - SECS_PER_MIN, - DAYS_PER_MONTHS, - MONTHS_OFFSETS, - TM_DECEMBER, - TM_JANUARY, - DAY_OF_WEEK_TABLE, - DAYS_PER_L_YEAR, - DAYS_PER_N_YEAR, -) +from collections import namedtuple + +from ..constants import DAY_OF_WEEK_TABLE +from ..constants import DAYS_PER_L_YEAR +from ..constants import DAYS_PER_MONTHS +from ..constants import DAYS_PER_N_YEAR +from ..constants import EPOCH_YEAR +from ..constants import MONTHS_OFFSETS +from ..constants import SECS_PER_4_YEARS +from ..constants import SECS_PER_100_YEARS +from ..constants import SECS_PER_400_YEARS +from ..constants import SECS_PER_DAY +from ..constants import SECS_PER_HOUR +from ..constants import SECS_PER_MIN +from ..constants import SECS_PER_YEAR +from ..constants import TM_DECEMBER +from ..constants import TM_JANUARY class PreciseDiff( diff --git a/pendulum/date.py b/pendulum/date.py index 9111db75..f11164ee 100644 --- a/pendulum/date.py +++ b/pendulum/date.py @@ -3,27 +3,26 @@ import calendar import math -import pendulum -from datetime import date, timedelta +from datetime import date +from datetime import timedelta + +import pendulum +from .constants import FRIDAY +from .constants import MONDAY +from .constants import MONTHS_PER_YEAR +from .constants import SATURDAY +from .constants import SUNDAY +from .constants import THURSDAY +from .constants import TUESDAY +from .constants import WEDNESDAY +from .constants import YEARS_PER_CENTURY +from .constants import YEARS_PER_DECADE +from .exceptions import PendulumException from .helpers import add_duration -from .period import Period from .mixins.default import FormattableMixin -from .constants import ( - DAYS_PER_WEEK, - YEARS_PER_DECADE, - YEARS_PER_CENTURY, - MONTHS_PER_YEAR, - MONDAY, - TUESDAY, - WEDNESDAY, - THURSDAY, - FRIDAY, - SATURDAY, - SUNDAY, -) -from .exceptions import PendulumException +from .period import Period class Date(FormattableMixin, date): diff --git a/pendulum/datetime.py b/pendulum/datetime.py index d56f0508..4e2762d3 100644 --- a/pendulum/datetime.py +++ b/pendulum/datetime.py @@ -4,38 +4,40 @@ import calendar import datetime -import pendulum -from typing import Union, Optional, TypeVar +from typing import Optional +from typing import TypeVar +from typing import Union + +import pendulum +from .constants import ATOM +from .constants import COOKIE +from .constants import MINUTES_PER_HOUR +from .constants import MONTHS_PER_YEAR +from .constants import RFC822 +from .constants import RFC850 +from .constants import RFC1036 +from .constants import RFC1123 +from .constants import RFC2822 +from .constants import RSS +from .constants import SATURDAY +from .constants import SECONDS_PER_DAY +from .constants import SECONDS_PER_MINUTE +from .constants import SUNDAY +from .constants import W3C +from .constants import YEARS_PER_CENTURY +from .constants import YEARS_PER_DECADE from .date import Date -from .time import Time -from .period import Period from .exceptions import PendulumException -from .utils._compat import _HAS_FOLD -from .tz import UTC -from .tz.timezone import Timezone from .helpers import add_duration from .helpers import timestamp -from .constants import ( - YEARS_PER_CENTURY, - YEARS_PER_DECADE, - MONTHS_PER_YEAR, - MINUTES_PER_HOUR, - SECONDS_PER_MINUTE, - SECONDS_PER_DAY, - SUNDAY, - SATURDAY, - ATOM, - COOKIE, - RFC822, - RFC850, - RFC1036, - RFC1123, - RFC2822, - RSS, - W3C, -) +from .period import Period +from .time import Time +from .tz import UTC +from .tz.timezone import Timezone +from .utils._compat import _HAS_FOLD + _D = TypeVar("_D", bound="DateTime") @@ -495,8 +497,6 @@ def __repr__(self): # Comparisons def closest(self, dt1, dt2, *dts): - from functools import reduce - """ Get the farthest date from the instance. @@ -514,8 +514,6 @@ def closest(self, dt1, dt2, *dts): return min(dts)[1] def farthest(self, dt1, dt2, *dts): - from functools import reduce - """ Get the farthest date from the instance. diff --git a/pendulum/duration.py b/pendulum/duration.py index 47af205b..ff1a91b5 100644 --- a/pendulum/duration.py +++ b/pendulum/duration.py @@ -1,19 +1,17 @@ from __future__ import absolute_import from __future__ import division -import pendulum - from datetime import timedelta +import pendulum + from pendulum.utils._compat import PYPY from pendulum.utils._compat import decode -from .constants import ( - SECONDS_PER_DAY, - SECONDS_PER_HOUR, - SECONDS_PER_MINUTE, - US_PER_SECOND, -) +from .constants import SECONDS_PER_DAY +from .constants import SECONDS_PER_HOUR +from .constants import SECONDS_PER_MINUTE +from .constants import US_PER_SECOND def _divide_and_round(a, b): diff --git a/pendulum/exceptions.py b/pendulum/exceptions.py index 02a89f3f..4c6448a6 100644 --- a/pendulum/exceptions.py +++ b/pendulum/exceptions.py @@ -1,4 +1,4 @@ -from .parsing.exceptions import ParserError +from .parsing.exceptions import ParserError # noqa class PendulumException(Exception): diff --git a/pendulum/formatting/difference_formatter.py b/pendulum/formatting/difference_formatter.py index 7ab6a73d..9be4b962 100644 --- a/pendulum/formatting/difference_formatter.py +++ b/pendulum/formatting/difference_formatter.py @@ -1,9 +1,10 @@ +import typing + +import pendulum + from pendulum.utils._compat import decode from ..locales.locale import Locale -from ..period import Period - -import typing class DifferenceFormatter(object): @@ -16,7 +17,7 @@ def __init__(self, locale="en"): def format( self, diff, is_now=True, absolute=False, locale=None - ): # type: (Period, bool, bool, typing.Optional[str]) -> str + ): # type: (pendulum.Period, bool, bool, typing.Optional[str]) -> str """ Formats a difference. diff --git a/pendulum/formatting/formatter.py b/pendulum/formatting/formatter.py index 5678a422..9c9b3404 100644 --- a/pendulum/formatting/formatter.py +++ b/pendulum/formatting/formatter.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -import re import datetime -import pendulum +import re import typing -from pendulum.helpers import local_time +import pendulum + from pendulum.locales.locale import Locale from pendulum.utils._compat import decode @@ -446,6 +446,8 @@ def _check_parsed( else: microseconds = 0 + from pendulum.helpers import local_time + time = local_time(parsed["timestamp"], 0, microseconds) validated["year"] = time[0] validated["month"] = time[1] diff --git a/pendulum/helpers.py b/pendulum/helpers.py index c030a242..6e51a731 100644 --- a/pendulum/helpers.py +++ b/pendulum/helpers.py @@ -1,13 +1,25 @@ from __future__ import absolute_import -import pendulum import os import struct -from math import copysign -from datetime import datetime, date, timedelta from contextlib import contextmanager -from typing import TYPE_CHECKING, Union, Optional, TypeVar, Iterator, overload +from datetime import date +from datetime import datetime +from datetime import timedelta +from math import copysign +from typing import TYPE_CHECKING +from typing import Iterator +from typing import Optional +from typing import TypeVar +from typing import overload + +import pendulum + +from .constants import DAYS_PER_MONTHS +from .formatting.difference_formatter import DifferenceFormatter +from .locales.locale import Locale + if TYPE_CHECKING: # Prevent import cycles @@ -22,29 +34,21 @@ if not with_extensions or struct.calcsize("P") == 4: raise ImportError() - from ._extensions._helpers import ( - local_time, - precise_diff, - is_leap, - is_long_year, - week_day, - days_in_year, - timestamp, - ) + from ._extensions._helpers import local_time + from ._extensions._helpers import precise_diff + from ._extensions._helpers import is_leap + from ._extensions._helpers import is_long_year + from ._extensions._helpers import week_day + from ._extensions._helpers import days_in_year + from ._extensions._helpers import timestamp except ImportError: - from ._extensions.helpers import ( - local_time, - precise_diff, - is_leap, - is_long_year, - week_day, - days_in_year, - timestamp, - ) - -from .constants import DAYS_PER_MONTHS -from .formatting.difference_formatter import DifferenceFormatter -from .locales.locale import Locale + from ._extensions.helpers import local_time # noqa + from ._extensions.helpers import precise_diff # noqa + from ._extensions.helpers import is_leap # noqa + from ._extensions.helpers import is_long_year # noqa + from ._extensions.helpers import week_day # noqa + from ._extensions.helpers import days_in_year # noqa + from ._extensions.helpers import timestamp # noqa difference_formatter = DifferenceFormatter() diff --git a/pendulum/locales/da/custom.py b/pendulum/locales/da/custom.py index 3d02f860..eaf36552 100644 --- a/pendulum/locales/da/custom.py +++ b/pendulum/locales/da/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ da custom locale file. """ diff --git a/pendulum/locales/da/locale.py b/pendulum/locales/da/locale.py index 3e290310..addee68a 100644 --- a/pendulum/locales/da/locale.py +++ b/pendulum/locales/da/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ da locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" diff --git a/pendulum/locales/de/custom.py b/pendulum/locales/de/custom.py index 016578dc..45fd591c 100644 --- a/pendulum/locales/de/custom.py +++ b/pendulum/locales/de/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ de custom locale file. """ diff --git a/pendulum/locales/de/locale.py b/pendulum/locales/de/locale.py index 5259a529..9a9ec9f3 100644 --- a/pendulum/locales/de/locale.py +++ b/pendulum/locales/de/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ de locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" diff --git a/pendulum/locales/en/custom.py b/pendulum/locales/en/custom.py index 9c505327..9e631a2b 100644 --- a/pendulum/locales/en/custom.py +++ b/pendulum/locales/en/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ en custom locale file. """ diff --git a/pendulum/locales/en/locale.py b/pendulum/locales/en/locale.py index f7673e8c..917a4ce2 100644 --- a/pendulum/locales/en/locale.py +++ b/pendulum/locales/en/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ en locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" diff --git a/pendulum/locales/es/custom.py b/pendulum/locales/es/custom.py index 115e7ad9..18585e07 100644 --- a/pendulum/locales/es/custom.py +++ b/pendulum/locales/es/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ es custom locale file. """ diff --git a/pendulum/locales/es/locale.py b/pendulum/locales/es/locale.py index 086e0b5b..2f6266b6 100644 --- a/pendulum/locales/es/locale.py +++ b/pendulum/locales/es/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ es locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" if (n == n and ((n == 1))) else "other", diff --git a/pendulum/locales/fa/custom.py b/pendulum/locales/fa/custom.py index 5971e85f..9cc84d3a 100644 --- a/pendulum/locales/fa/custom.py +++ b/pendulum/locales/fa/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ fa custom locale file. """ diff --git a/pendulum/locales/fa/locale.py b/pendulum/locales/fa/locale.py index 28eab5f6..4c5719d3 100644 --- a/pendulum/locales/fa/locale.py +++ b/pendulum/locales/fa/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ fa locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" diff --git a/pendulum/locales/fo/custom.py b/pendulum/locales/fo/custom.py index 7749af1a..31f7f45e 100644 --- a/pendulum/locales/fo/custom.py +++ b/pendulum/locales/fo/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ fo custom locale file. """ diff --git a/pendulum/locales/fo/locale.py b/pendulum/locales/fo/locale.py index b1499325..8c87580c 100644 --- a/pendulum/locales/fo/locale.py +++ b/pendulum/locales/fo/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ fo locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" if (n == n and ((n == 1))) else "other", diff --git a/pendulum/locales/fr/custom.py b/pendulum/locales/fr/custom.py index 1bdbe3d8..14d480f7 100644 --- a/pendulum/locales/fr/custom.py +++ b/pendulum/locales/fr/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ fr custom locale file. """ diff --git a/pendulum/locales/fr/locale.py b/pendulum/locales/fr/locale.py index 066fb7da..c884ce9a 100644 --- a/pendulum/locales/fr/locale.py +++ b/pendulum/locales/fr/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ fr locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" if (n == n and ((n == 0) or (n == 1))) else "other", diff --git a/pendulum/locales/id/custom.py b/pendulum/locales/id/custom.py index 8fbeeb37..8abd4747 100644 --- a/pendulum/locales/id/custom.py +++ b/pendulum/locales/id/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ id custom locale file. """ diff --git a/pendulum/locales/id/locale.py b/pendulum/locales/id/locale.py index cb8c4b84..44ee697d 100644 --- a/pendulum/locales/id/locale.py +++ b/pendulum/locales/id/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ id locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "other", diff --git a/pendulum/locales/it/locale.py b/pendulum/locales/it/locale.py index 5f31c209..920a778b 100644 --- a/pendulum/locales/it/locale.py +++ b/pendulum/locales/it/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ it locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" diff --git a/pendulum/locales/ko/custom.py b/pendulum/locales/ko/custom.py index 63077536..0dd6a11a 100644 --- a/pendulum/locales/ko/custom.py +++ b/pendulum/locales/ko/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ ko custom locale file. """ diff --git a/pendulum/locales/ko/locale.py b/pendulum/locales/ko/locale.py index 4e255550..dfdb35a6 100644 --- a/pendulum/locales/ko/locale.py +++ b/pendulum/locales/ko/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ ko locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "other", diff --git a/pendulum/locales/locale.py b/pendulum/locales/locale.py index 0a0a7f39..de4cd82e 100644 --- a/pendulum/locales/locale.py +++ b/pendulum/locales/locale.py @@ -4,8 +4,10 @@ import os import re -from typing import Union, Optional, Any from importlib import import_module +from typing import Any +from typing import Optional +from typing import Union from pendulum.utils._compat import basestring from pendulum.utils._compat import decode diff --git a/pendulum/locales/lt/custom.py b/pendulum/locales/lt/custom.py index 4cdaf104..11c99805 100644 --- a/pendulum/locales/lt/custom.py +++ b/pendulum/locales/lt/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ lt custom locale file. """ diff --git a/pendulum/locales/lt/locale.py b/pendulum/locales/lt/locale.py index caad26f8..12f13359 100644 --- a/pendulum/locales/lt/locale.py +++ b/pendulum/locales/lt/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ lt locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "few" diff --git a/pendulum/locales/nb/custom.py b/pendulum/locales/nb/custom.py index 7f588ef2..216dd046 100644 --- a/pendulum/locales/nb/custom.py +++ b/pendulum/locales/nb/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ nn custom locale file. """ diff --git a/pendulum/locales/nb/locale.py b/pendulum/locales/nb/locale.py index 1e55ac03..0ad08d18 100644 --- a/pendulum/locales/nb/locale.py +++ b/pendulum/locales/nb/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ nb locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" if (n == n and ((n == 1))) else "other", diff --git a/pendulum/locales/nl/custom.py b/pendulum/locales/nl/custom.py index e1123728..2b8790ec 100644 --- a/pendulum/locales/nl/custom.py +++ b/pendulum/locales/nl/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ nl custom locale file. """ diff --git a/pendulum/locales/nl/locale.py b/pendulum/locales/nl/locale.py index d0a6324a..1e4d67ed 100644 --- a/pendulum/locales/nl/locale.py +++ b/pendulum/locales/nl/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ nl locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" diff --git a/pendulum/locales/nn/custom.py b/pendulum/locales/nn/custom.py index 7f588ef2..216dd046 100644 --- a/pendulum/locales/nn/custom.py +++ b/pendulum/locales/nn/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ nn custom locale file. """ diff --git a/pendulum/locales/nn/locale.py b/pendulum/locales/nn/locale.py index 172ad197..d7ad7909 100644 --- a/pendulum/locales/nn/locale.py +++ b/pendulum/locales/nn/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ nn locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" if (n == n and ((n == 1))) else "other", diff --git a/pendulum/locales/pt_br/custom.py b/pendulum/locales/pt_br/custom.py index e785c05a..065a1401 100644 --- a/pendulum/locales/pt_br/custom.py +++ b/pendulum/locales/pt_br/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ pt-br custom locale file. """ diff --git a/pendulum/locales/pt_br/locale.py b/pendulum/locales/pt_br/locale.py index 8e7cde34..307f34f6 100644 --- a/pendulum/locales/pt_br/locale.py +++ b/pendulum/locales/pt_br/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ pt_br locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "one" diff --git a/pendulum/locales/ru/custom.py b/pendulum/locales/ru/custom.py index a9fe40e3..38f86efa 100644 --- a/pendulum/locales/ru/custom.py +++ b/pendulum/locales/ru/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ ru custom locale file. """ diff --git a/pendulum/locales/ru/locale.py b/pendulum/locales/ru/locale.py index 4ad89478..a0800357 100644 --- a/pendulum/locales/ru/locale.py +++ b/pendulum/locales/ru/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ ru locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "few" diff --git a/pendulum/locales/zh/custom.py b/pendulum/locales/zh/custom.py index e58cba6d..eb9bb810 100644 --- a/pendulum/locales/zh/custom.py +++ b/pendulum/locales/zh/custom.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + """ zh custom locale file. """ diff --git a/pendulum/locales/zh/locale.py b/pendulum/locales/zh/locale.py index 44e2f0f5..f292924e 100644 --- a/pendulum/locales/zh/locale.py +++ b/pendulum/locales/zh/locale.py @@ -1,14 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +from .custom import translations as custom_translations + + """ zh locale file. It has been generated automatically and must not be modified directly. """ -from .custom import translations as custom_translations - locale = { "plural": lambda n: "other", diff --git a/pendulum/mixins/default.py b/pendulum/mixins/default.py index e2ad8135..fdb05b0f 100644 --- a/pendulum/mixins/default.py +++ b/pendulum/mixins/default.py @@ -1,5 +1,6 @@ from ..formatting import Formatter + _formatter = Formatter() diff --git a/pendulum/parser.py b/pendulum/parser.py index 624ee577..3d2cc841 100644 --- a/pendulum/parser.py +++ b/pendulum/parser.py @@ -1,18 +1,20 @@ from __future__ import absolute_import -import pendulum import datetime import typing -from .parsing import parse as base_parse, _Interval +import pendulum + +from .parsing import _Interval +from .parsing import parse as base_parse +from .tz import UTC + try: from .parsing._iso8601 import Duration as CDuration except ImportError: CDuration = None -from .tz import UTC - def parse(text, **options): # type: (str, **typing.Any) -> str # Use the mock now value if it exists diff --git a/pendulum/parsing/__init__.py b/pendulum/parsing/__init__.py index 103fce18..1b5c8b91 100644 --- a/pendulum/parsing/__init__.py +++ b/pendulum/parsing/__init__.py @@ -3,11 +3,15 @@ import re import struct -from datetime import datetime, date, time +from datetime import date +from datetime import datetime +from datetime import time + from dateutil import parser from .exceptions import ParserError + with_extensions = os.getenv("PENDULUM_EXTENSIONS", "1") == "1" try: diff --git a/pendulum/parsing/iso8601.py b/pendulum/parsing/iso8601.py index ab4c24aa..ad14cc94 100644 --- a/pendulum/parsing/iso8601.py +++ b/pendulum/parsing/iso8601.py @@ -1,17 +1,18 @@ from __future__ import division -import re import datetime +import re -from ..constants import ( - HOURS_PER_DAY, - MINUTES_PER_HOUR, - SECONDS_PER_MINUTE, - MONTHS_OFFSETS, -) -from ..helpers import week_day, days_in_year, is_leap, is_long_year -from ..tz.timezone import FixedTimezone +from ..constants import HOURS_PER_DAY +from ..constants import MINUTES_PER_HOUR +from ..constants import MONTHS_OFFSETS +from ..constants import SECONDS_PER_MINUTE from ..duration import Duration +from ..helpers import days_in_year +from ..helpers import is_leap +from ..helpers import is_long_year +from ..helpers import week_day +from ..tz.timezone import FixedTimezone from .exceptions import ParserError diff --git a/pendulum/period.py b/pendulum/period.py index 81796436..c66c6b9d 100644 --- a/pendulum/period.py +++ b/pendulum/period.py @@ -1,15 +1,18 @@ from __future__ import absolute_import import operator -import pendulum -from datetime import datetime, date, timedelta +from datetime import date +from datetime import datetime +from datetime import timedelta + +import pendulum from pendulum.utils._compat import _HAS_FOLD from pendulum.utils._compat import decode -from .duration import Duration from .constants import MONTHS_PER_YEAR +from .duration import Duration from .helpers import precise_diff diff --git a/pendulum/time.py b/pendulum/time.py index 73664b64..6dea4a05 100644 --- a/pendulum/time.py +++ b/pendulum/time.py @@ -1,12 +1,16 @@ from __future__ import absolute_import -import pendulum +from datetime import time +from datetime import timedelta -from datetime import time, timedelta +import pendulum -from .duration import Duration, AbsoluteDuration +from .constants import SECS_PER_HOUR +from .constants import SECS_PER_MIN +from .constants import USECS_PER_SEC +from .duration import AbsoluteDuration +from .duration import Duration from .mixins.default import FormattableMixin -from .constants import USECS_PER_SEC, SECS_PER_HOUR, SECS_PER_MIN class Time(FormattableMixin, time): @@ -14,7 +18,6 @@ class Time(FormattableMixin, time): Represents a time instance as hour, minute, second, microsecond. """ - pass # String formatting def __repr__(self): us = "" diff --git a/pendulum/tz/__init__.py b/pendulum/tz/__init__.py index cf09e135..e45a6cde 100644 --- a/pendulum/tz/__init__.py +++ b/pendulum/tz/__init__.py @@ -1,14 +1,15 @@ -import pytzdata +from typing import Tuple +from typing import Union -from typing import Union, Tuple +import pytzdata from .local_timezone import get_local_timezone from .local_timezone import set_local_timezone from .local_timezone import test_local_timezone - -from .timezone import Timezone as _Timezone -from .timezone import FixedTimezone as _FixedTimezone from .timezone import UTC +from .timezone import FixedTimezone as _FixedTimezone +from .timezone import Timezone as _Timezone + PRE_TRANSITION = "pre" POST_TRANSITION = "post" diff --git a/pendulum/tz/local_timezone.py b/pendulum/tz/local_timezone.py index de366f88..08a6e4fa 100644 --- a/pendulum/tz/local_timezone.py +++ b/pendulum/tz/local_timezone.py @@ -1,6 +1,16 @@ -import sys import os import re +import sys + +from contextlib import contextmanager +from typing import Iterator +from typing import Optional +from typing import Union + +from .timezone import Timezone +from .timezone import TimezoneFile +from .zoneinfo.exceptions import InvalidTimezone + try: import _winreg as winreg @@ -10,12 +20,6 @@ except ImportError: winreg = None -from contextlib import contextmanager -from typing import Optional, Union, Iterator - -from .timezone import Timezone, TimezoneFile -from .zoneinfo.exceptions import InvalidTimezone - _mock_local_timezone = None _local_timezone = None diff --git a/pendulum/tz/timezone.py b/pendulum/tz/timezone.py index 46a07cb9..62810130 100644 --- a/pendulum/tz/timezone.py +++ b/pendulum/tz/timezone.py @@ -1,13 +1,20 @@ -import pendulum +from datetime import datetime +from datetime import timedelta +from datetime import tzinfo +from typing import Optional +from typing import TypeVar +from typing import overload -from datetime import datetime, timedelta, tzinfo -from typing import Optional, TypeVar, overload +import pendulum -from pendulum.helpers import local_time, timestamp +from pendulum.helpers import local_time +from pendulum.helpers import timestamp from pendulum.utils._compat import _HAS_FOLD -from .exceptions import NonExistingTime, AmbiguousTime -from .zoneinfo import read, read_file +from .exceptions import AmbiguousTime +from .exceptions import NonExistingTime +from .zoneinfo import read +from .zoneinfo import read_file from .zoneinfo.transition import Transition diff --git a/pendulum/tz/zoneinfo/posix_timezone.py b/pendulum/tz/zoneinfo/posix_timezone.py index 1160d171..74a32eba 100644 --- a/pendulum/tz/zoneinfo/posix_timezone.py +++ b/pendulum/tz/zoneinfo/posix_timezone.py @@ -6,10 +6,12 @@ from typing import Optional -from pendulum.constants import MONTHS_OFFSETS, SECS_PER_DAY +from pendulum.constants import MONTHS_OFFSETS +from pendulum.constants import SECS_PER_DAY from .exceptions import InvalidPosixSpec + _spec = re.compile( "^" r"(?P<.*?>|[^-+,\d]{3,})" diff --git a/pendulum/tz/zoneinfo/reader.py b/pendulum/tz/zoneinfo/reader.py index 21848b5c..f4c1fa60 100644 --- a/pendulum/tz/zoneinfo/reader.py +++ b/pendulum/tz/zoneinfo/reader.py @@ -1,18 +1,26 @@ import os -import pytzdata from collections import namedtuple from struct import unpack -from typing import Dict, List, Optional, IO, Any, Tuple +from typing import IO +from typing import Any +from typing import Dict +from typing import List +from typing import Optional +from typing import Tuple + +import pytzdata from pytzdata.exceptions import TimezoneNotFound from pendulum.utils._compat import PY2 -from .exceptions import InvalidZoneinfoFile, InvalidTimezone +from .exceptions import InvalidTimezone +from .exceptions import InvalidZoneinfoFile +from .posix_timezone import PosixTimezone +from .posix_timezone import posix_spec from .timezone import Timezone from .transition import Transition -from .posix_timezone import posix_spec, PosixTimezone from .transition_type import TransitionType diff --git a/pendulum/tz/zoneinfo/timezone.py b/pendulum/tz/zoneinfo/timezone.py index cf8b126e..abdb0ec4 100644 --- a/pendulum/tz/zoneinfo/timezone.py +++ b/pendulum/tz/zoneinfo/timezone.py @@ -1,8 +1,13 @@ from datetime import datetime -from typing import List, Optional - -from pendulum.constants import DAYS_PER_YEAR, SECS_PER_YEAR -from pendulum.helpers import local_time, is_leap, timestamp, week_day +from typing import List +from typing import Optional + +from pendulum.constants import DAYS_PER_YEAR +from pendulum.constants import SECS_PER_YEAR +from pendulum.helpers import is_leap +from pendulum.helpers import local_time +from pendulum.helpers import timestamp +from pendulum.helpers import week_day from .posix_timezone import PosixTimezone from .transition import Transition diff --git a/pendulum/utils/_compat.py b/pendulum/utils/_compat.py index 6ad4ae17..4893979b 100644 --- a/pendulum/utils/_compat.py +++ b/pendulum/utils/_compat.py @@ -1,5 +1,6 @@ import sys + PY2 = sys.version_info < (3, 0) PY36 = sys.version_info >= (3, 6) PYPY = hasattr(sys, "pypy_version_info") diff --git a/poetry.lock b/poetry.lock index f1efe611..21b1288f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -53,7 +53,7 @@ pytz = ">=2015.7" [[package]] category = "dev" description = "The uncompromising code formatter." -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" +marker = "python_version >= \"3.6\" and python_version < \"4.0\" and implementation_name != \"pypy\"" name = "black" optional = false python-versions = ">=3.6" @@ -96,7 +96,7 @@ clikit = ">=0.4.0,<0.5.0" [[package]] category = "dev" description = "Composable command line interface toolkit" -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" +marker = "python_version >= \"3.6\" and python_version < \"4.0\" and implementation_name != \"pypy\" or python_version >= \"3.5\" and python_version < \"4.0\"" name = "click" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -219,6 +219,15 @@ optional = false python-versions = "*" version = "1.0.2" +[[package]] +category = "dev" +description = "Clean single-source support for Python 3 and 2" +marker = "python_version >= \"3.5\" and python_version < \"4.0\"" +name = "future" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +version = "0.18.2" + [[package]] category = "dev" description = "Backport of the concurrent.futures package from Python 3" @@ -244,8 +253,8 @@ category = "dev" description = "Read metadata from Python packages" name = "importlib-metadata" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" -version = "1.1.3" +python-versions = ">=2.7,!=3.0,!=3.1,!=3.2,!=3.3" +version = "0.23" [package.dependencies] zipp = ">=0.5" @@ -303,9 +312,13 @@ marker = "python_version < \"3.7\"" name = "importlib-resources" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" -version = "1.2.0" +version = "1.3.1" [package.dependencies] +[package.dependencies.contextlib2] +python = "<3" +version = "*" + [package.dependencies.importlib-metadata] python = "<3.8" version = "*" @@ -329,6 +342,146 @@ version = ">=0.4" [package.extras] docs = ["sphinx", "docutils (0.12)", "rst.linker"] +[[package]] +category = "dev" +description = "A Python utility / library to sort Python imports." +marker = "python_version >= \"3.6\" and python_version < \"4.0\"" +name = "isort" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "4.3.21" + +[package.extras] +pipfile = ["pipreqs", "requirementslib"] +pyproject = ["toml"] +requirements = ["pipreqs", "pip-api"] +xdg_home = ["appdirs (>=1.4.0)"] + +[[package]] +category = "dev" +description = "A very fast and expressive template engine." +marker = "python_version >= \"3.5\" and python_version < \"4.0\"" +name = "jinja2" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "2.11.1" + +[package.dependencies] +MarkupSafe = ">=0.23" + +[package.extras] +i18n = ["Babel (>=0.8)"] + +[[package]] +category = "dev" +description = "Python LiveReload is an awesome tool for web developers" +marker = "python_version >= \"3.5\" and python_version < \"4.0\"" +name = "livereload" +optional = false +python-versions = "*" +version = "2.6.1" + +[package.dependencies] +six = "*" +tornado = "*" + +[[package]] +category = "dev" +description = "A Python implementation of Lunr.js" +marker = "python_version >= \"3.5\" and python_version < \"4.0\"" +name = "lunr" +optional = false +python-versions = "*" +version = "0.5.6" + +[package.dependencies] +future = ">=0.16.0" +six = ">=1.11.0" + +[package.dependencies.nltk] +optional = true +version = ">=3.2.5" + +[package.extras] +languages = ["nltk (>=3.2.5)"] + +[[package]] +category = "dev" +description = "Python implementation of Markdown." +name = "markdown" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" +version = "3.0.1" + +[[package]] +category = "dev" +description = "Python implementation of Markdown." +name = "markdown" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" +version = "3.1.1" + +[package.dependencies] +setuptools = ">=36" + +[package.extras] +testing = ["coverage", "pyyaml"] + +[[package]] +category = "dev" +description = "Python implementation of Markdown." +name = "markdown" +optional = false +python-versions = ">=3.5" +version = "3.2.1" + +[package.dependencies] +setuptools = ">=36" + +[package.extras] +testing = ["coverage", "pyyaml"] + +[[package]] +category = "dev" +description = "This is an extension to Python-Markdown which provides an \"include\" function, similar to that found in LaTeX (and also the C pre-processor and Fortran). I originally wrote it for my FORD Fortran auto-documentation generator." +name = "markdown-include" +optional = false +python-versions = "*" +version = "0.5.1" + +[package.dependencies] +markdown = "*" + +[[package]] +category = "dev" +description = "Safely add untrusted strings to HTML/XML markup." +marker = "python_version >= \"3.5\" and python_version < \"4.0\"" +name = "markupsafe" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" +version = "1.1.1" + +[[package]] +category = "dev" +description = "Project documentation with Markdown." +marker = "python_version >= \"3.5\" and python_version < \"4.0\"" +name = "mkdocs" +optional = false +python-versions = ">=3.5" +version = "1.1" + +[package.dependencies] +Jinja2 = ">=2.10.1" +Markdown = ">=3.2.1" +PyYAML = ">=3.10" +click = ">=3.3" +livereload = ">=2.5.1" +tornado = ">=5.0" + +[package.dependencies.lunr] +extras = ["languages"] +version = "0.5.6" + [[package]] category = "dev" description = "More routines for operating on iterables, beyond itertools" @@ -359,6 +512,26 @@ optional = false python-versions = ">=3.5" version = "8.2.0" +[[package]] +category = "dev" +description = "Natural Language Toolkit" +marker = "python_version >= \"3.5\" and python_version < \"4.0\"" +name = "nltk" +optional = false +python-versions = "*" +version = "3.4.5" + +[package.dependencies] +six = "*" + +[package.extras] +all = ["pyparsing", "scikit-learn", "python-crfsuite", "matplotlib", "scipy", "gensim", "requests", "twython", "numpy"] +corenlp = ["requests"] +machine_learning = ["gensim", "numpy", "python-crfsuite", "scikit-learn", "scipy"] +plot = ["matplotlib"] +tgrep = ["pyparsing"] +twitter = ["twython"] + [[package]] category = "dev" description = "Node.js virtual environment builder" @@ -373,7 +546,7 @@ description = "Core utilities for Python packages" name = "packaging" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "20.1" +version = "20.3" [package.dependencies] pyparsing = ">=2.0.2" @@ -406,12 +579,20 @@ version = "*" [[package]] category = "dev" description = "Utility library for gitignore style pattern matching of file paths." -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" +marker = "python_version >= \"3.6\" and python_version < \"4.0\" and implementation_name != \"pypy\"" name = "pathspec" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" version = "0.7.0" +[[package]] +category = "dev" +description = "Backport of PEP 562." +name = "pep562" +optional = false +python-versions = "*" +version = "1.0" + [[package]] category = "dev" description = "plugin and hook calling mechanisms for python" @@ -489,6 +670,22 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "1.8.1" +[[package]] +category = "dev" +description = "Pygments is a syntax highlighting package written in Python." +name = "pygments" +optional = false +python-versions = "*" +version = "2.3.1" + +[[package]] +category = "dev" +description = "Pygments is a syntax highlighting package written in Python." +name = "pygments" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "2.5.2" + [[package]] category = "dev" description = "A pure Python Levenshtein implementation that's not freaking GPL'd." @@ -497,6 +694,40 @@ optional = false python-versions = "*" version = "1.3.0" +[[package]] +category = "dev" +description = "Extension pack for Python Markdown." +name = "pymdown-extensions" +optional = false +python-versions = "*" +version = "6.0" + +[package.dependencies] +Markdown = ">=3.0.1" + +[[package]] +category = "dev" +description = "Extension pack for Python Markdown." +name = "pymdown-extensions" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" +version = "6.2.1" + +[package.dependencies] +Markdown = ">=3.0.1" +pep562 = "*" + +[[package]] +category = "dev" +description = "Extension pack for Python Markdown." +name = "pymdown-extensions" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" +version = "6.3" + +[package.dependencies] +Markdown = ">=3.2" + [[package]] category = "dev" description = "Python parsing module" @@ -614,7 +845,7 @@ version = "5.3" [[package]] category = "dev" description = "Alternative regular expression module, to replace re." -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" +marker = "python_version >= \"3.6\" and python_version < \"4.0\" and implementation_name != \"pypy\"" name = "regex" optional = false python-versions = "*" @@ -657,26 +888,39 @@ optional = false python-versions = "*" version = "0.10.0" +[[package]] +category = "dev" +description = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed." +marker = "python_version >= \"3.5\" and python_version < \"4.0\"" +name = "tornado" +optional = false +python-versions = ">= 3.5" +version = "6.0.4" + [[package]] category = "dev" description = "tox is a generic virtualenv management and test command line tool" name = "tox" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "3.12.1" +version = "3.14.0" [package.dependencies] filelock = ">=3.0.0,<4" -pluggy = ">=0.3.0,<1" +packaging = ">=14" +pluggy = ">=0.12.0,<1" py = ">=1.4.17,<2" -setuptools = ">=30.0.0" six = ">=1.0.0,<2" toml = ">=0.9.4" virtualenv = ">=14.0.0" +[package.dependencies.importlib-metadata] +python = "<3.8" +version = ">=0.12,<1" + [package.extras] docs = ["sphinx (>=2.0.0,<3)", "towncrier (>=18.5.0)", "pygments-github-lexers (>=0.0.5)", "sphinxcontrib-autoprogram (>=0.1.5)"] -testing = ["freezegun (>=0.3.11,<1)", "pathlib2 (>=2.3.3,<3)", "pytest (>=3.0.0,<5)", "pytest-cov (>=2.5.1,<3)", "pytest-mock (>=1.10.0,<2)", "pytest-xdist (>=1.22.2,<2)", "pytest-randomly (>=1.2.3,<2)", "flaky (>=3.4.0,<4)", "psutil (>=5.6.1,<6)"] +testing = ["freezegun (>=0.3.11,<1)", "pathlib2 (>=2.3.3,<3)", "pytest (>=4.0.0,<6)", "pytest-cov (>=2.5.1,<3)", "pytest-mock (>=1.10.0,<2)", "pytest-xdist (>=1.22.2,<2)", "pytest-randomly (>=1.2.3,<2)", "flaky (>=3.4.0,<4)", "psutil (>=5.6.1,<6)"] [[package]] category = "dev" @@ -707,7 +951,7 @@ testing = ["freezegun (>=0.3.11,<1)", "pathlib2 (>=2.3.3,<3)", "pytest (>=4.0.0, [[package]] category = "dev" description = "a fork of Python 2 and 3 ast modules with type comment support" -marker = "python_version >= \"3.6\" and python_version < \"4.0\"" +marker = "python_version >= \"3.6\" and python_version < \"4.0\" and implementation_name != \"pypy\"" name = "typed-ast" optional = false python-versions = "*" @@ -776,7 +1020,6 @@ version = "0.1.8" [[package]] category = "dev" description = "Backport of pathlib-compatible object wrapper for zip files" -marker = "python_version < \"3.8\"" name = "zipp" optional = false python-versions = ">=2.7" @@ -792,7 +1035,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"] [metadata] -content-hash = "ee403d974bc621d06008a783ee5e11bb1cf473bc4488c32c5e6a6e5f3376c59a" +content-hash = "4167e586f2b385c66285af3df57abce7f47165c4336dde2045cdb05ddd5e273b" python-versions = "~2.7 || ^3.4" [metadata.files] @@ -931,6 +1174,9 @@ funcsigs = [ {file = "funcsigs-1.0.2-py2.py3-none-any.whl", hash = "sha256:330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca"}, {file = "funcsigs-1.0.2.tar.gz", hash = "sha256:a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50"}, ] +future = [ + {file = "future-0.18.2.tar.gz", hash = "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"}, +] futures = [ {file = "futures-3.3.0-py2-none-any.whl", hash = "sha256:49b3f5b064b6e3afc3316421a3f25f66c137ae88f068abbf72830170033c5e16"}, {file = "futures-3.3.0.tar.gz", hash = "sha256:7e033af76a5e35f58e56da7a91e687706faf4e7bdfb2cbc3f2cca6b9bcda9794"}, @@ -940,16 +1186,82 @@ identify = [ {file = "identify-1.4.11.tar.gz", hash = "sha256:d824ebe21f38325c771c41b08a95a761db1982f1fc0eee37c6c97df3f1636b96"}, ] importlib-metadata = [ - {file = "importlib_metadata-1.1.3-py2.py3-none-any.whl", hash = "sha256:7c7f8ac40673f507f349bef2eed21a0e5f01ddf5b2a7356a6c65eb2099b53764"}, - {file = "importlib_metadata-1.1.3.tar.gz", hash = "sha256:7a99fb4084ffe6dae374961ba7a6521b79c1d07c658ab3a28aa264ee1d1b14e3"}, + {file = "importlib_metadata-0.23-py2.py3-none-any.whl", hash = "sha256:d5f18a79777f3aa179c145737780282e27b508fc8fd688cb17c7a813e8bd39af"}, + {file = "importlib_metadata-0.23.tar.gz", hash = "sha256:aa18d7378b00b40847790e7c27e11673d7fed219354109d0e7b9e5b25dc3ad26"}, {file = "importlib_metadata-1.5.0-py2.py3-none-any.whl", hash = "sha256:b97607a1a18a5100839aec1dc26a1ea17ee0d93b20b0f008d80a5a050afb200b"}, {file = "importlib_metadata-1.5.0.tar.gz", hash = "sha256:06f5b3a99029c7134207dd882428a66992a9de2bef7c2b699b5641f9886c3302"}, ] importlib-resources = [ {file = "importlib_resources-1.0.2-py2.py3-none-any.whl", hash = "sha256:6e2783b2538bd5a14678284a3962b0660c715e5a0f10243fd5e00a4b5974f50b"}, {file = "importlib_resources-1.0.2.tar.gz", hash = "sha256:d3279fd0f6f847cced9f7acc19bd3e5df54d34f93a2e7bb5f238f81545787078"}, - {file = "importlib_resources-1.2.0-py2.py3-none-any.whl", hash = "sha256:6aefffdf63634bd94600dd0691fd6430902272bace0572934fa23c81473a7ff7"}, - {file = "importlib_resources-1.2.0.tar.gz", hash = "sha256:ce84b1c9c05078e1797700505bd1bc386cee9561002a9bdcfcba634adc6333e5"}, + {file = "importlib_resources-1.3.1-py2.py3-none-any.whl", hash = "sha256:1dff36d42d94bd523eeb847c25c7dd327cb56686d74a26dfcc8d67c504922d59"}, + {file = "importlib_resources-1.3.1.tar.gz", hash = "sha256:7f0e1b2b5f3981e39c52da0f99b2955353c5a139c314994d1126c2551ace9bdf"}, +] +isort = [ + {file = "isort-4.3.21-py2.py3-none-any.whl", hash = "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"}, + {file = "isort-4.3.21.tar.gz", hash = "sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1"}, +] +jinja2 = [ + {file = "Jinja2-2.11.1-py2.py3-none-any.whl", hash = "sha256:b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49"}, + {file = "Jinja2-2.11.1.tar.gz", hash = "sha256:93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250"}, +] +livereload = [ + {file = "livereload-2.6.1-py2.py3-none-any.whl", hash = "sha256:78d55f2c268a8823ba499305dcac64e28ddeb9a92571e12d543cd304faf5817b"}, + {file = "livereload-2.6.1.tar.gz", hash = "sha256:89254f78d7529d7ea0a3417d224c34287ebfe266b05e67e51facaf82c27f0f66"}, +] +lunr = [ + {file = "lunr-0.5.6-py2.py3-none-any.whl", hash = "sha256:1208622930c915a07e6f8e8640474357826bad48534c0f57969b6fca9bffc88e"}, + {file = "lunr-0.5.6.tar.gz", hash = "sha256:7be69d7186f65784a4f2adf81e5c58efd6a9921aa95966babcb1f2f2ada75c20"}, +] +markdown = [ + {file = "Markdown-3.0.1-py2.py3-none-any.whl", hash = "sha256:c00429bd503a47ec88d5e30a751e147dcb4c6889663cd3e2ba0afe858e009baa"}, + {file = "Markdown-3.0.1.tar.gz", hash = "sha256:d02e0f9b04c500cde6637c11ad7c72671f359b87b9fe924b2383649d8841db7c"}, + {file = "Markdown-3.1.1-py2.py3-none-any.whl", hash = "sha256:56a46ac655704b91e5b7e6326ce43d5ef72411376588afa1dd90e881b83c7e8c"}, + {file = "Markdown-3.1.1.tar.gz", hash = "sha256:2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a"}, + {file = "Markdown-3.2.1-py2.py3-none-any.whl", hash = "sha256:e4795399163109457d4c5af2183fbe6b60326c17cfdf25ce6e7474c6624f725d"}, + {file = "Markdown-3.2.1.tar.gz", hash = "sha256:90fee683eeabe1a92e149f7ba74e5ccdc81cd397bd6c516d93a8da0ef90b6902"}, +] +markdown-include = [ + {file = "markdown-include-0.5.1.tar.gz", hash = "sha256:72a45461b589489a088753893bc95c5fa5909936186485f4ed55caa57d10250f"}, +] +markupsafe = [ + {file = "MarkupSafe-1.1.1-cp27-cp27m-macosx_10_6_intel.whl", hash = "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-win32.whl", hash = "sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b"}, + {file = "MarkupSafe-1.1.1-cp27-cp27m-win_amd64.whl", hash = "sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e"}, + {file = "MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f"}, + {file = "MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-macosx_10_6_intel.whl", hash = "sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-manylinux1_i686.whl", hash = "sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-manylinux1_x86_64.whl", hash = "sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-win32.whl", hash = "sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21"}, + {file = "MarkupSafe-1.1.1-cp34-cp34m-win_amd64.whl", hash = "sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-win32.whl", hash = "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1"}, + {file = "MarkupSafe-1.1.1-cp35-cp35m-win_amd64.whl", hash = "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-macosx_10_6_intel.whl", hash = "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-win32.whl", hash = "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66"}, + {file = "MarkupSafe-1.1.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-macosx_10_6_intel.whl", hash = "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-win32.whl", hash = "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2"}, + {file = "MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-win32.whl", hash = "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b"}, + {file = "MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"}, + {file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"}, +] +mkdocs = [ + {file = "mkdocs-1.1-py2.py3-none-any.whl", hash = "sha256:1e385a70aea8a9dedb731aea4fd5f3704b2074801c4f96f06b2920999babda8a"}, + {file = "mkdocs-1.1.tar.gz", hash = "sha256:9243291392f59e20b655e4e46210233453faf97787c2cf72176510e868143174"}, ] more-itertools = [ {file = "more-itertools-5.0.0.tar.gz", hash = "sha256:38a936c0a6d98a38bcc2d03fdaaedaba9f412879461dd2ceff8d37564d6522e4"}, @@ -960,12 +1272,16 @@ more-itertools = [ {file = "more-itertools-8.2.0.tar.gz", hash = "sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507"}, {file = "more_itertools-8.2.0-py3-none-any.whl", hash = "sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c"}, ] +nltk = [ + {file = "nltk-3.4.5.win32.exe", hash = "sha256:a08bdb4b8a1c13de16743068d9eb61c8c71c2e5d642e8e08205c528035843f82"}, + {file = "nltk-3.4.5.zip", hash = "sha256:bed45551259aa2101381bbdd5df37d44ca2669c5c3dad72439fa459b29137d94"}, +] nodeenv = [ {file = "nodeenv-1.3.5-py2.py3-none-any.whl", hash = "sha256:5b2438f2e42af54ca968dd1b374d14a1194848955187b0e5e4be1f73813a5212"}, ] packaging = [ - {file = "packaging-20.1-py2.py3-none-any.whl", hash = "sha256:170748228214b70b672c581a3dd610ee51f733018650740e98c7df862a583f73"}, - {file = "packaging-20.1.tar.gz", hash = "sha256:e665345f9eef0c621aa0bf2f8d78cf6d21904eef16a93f020240b704a57f1334"}, + {file = "packaging-20.3-py2.py3-none-any.whl", hash = "sha256:82f77b9bee21c1bafbf35a84905d604d5d1223801d639cf3ed140bd651c08752"}, + {file = "packaging-20.3.tar.gz", hash = "sha256:3c292b474fda1671ec57d46d739d072bfd495a4f51ad01a055121d81e952b7a3"}, ] pastel = [ {file = "pastel-0.2.0-py2.py3-none-any.whl", hash = "sha256:18b559dc3ad4ba9b8bd5baebe6503f25f36d21460f021cf27a8d889cb5d17840"}, @@ -979,6 +1295,10 @@ pathspec = [ {file = "pathspec-0.7.0-py2.py3-none-any.whl", hash = "sha256:163b0632d4e31cef212976cf57b43d9fd6b0bac6e67c26015d611a647d5e7424"}, {file = "pathspec-0.7.0.tar.gz", hash = "sha256:562aa70af2e0d434367d9790ad37aed893de47f1693e4201fd1d3dca15d19b96"}, ] +pep562 = [ + {file = "pep562-1.0-py2.py3-none-any.whl", hash = "sha256:d2a48b178ebf5f8dd31709cc26a19808ef794561fa2fe50ea01ea2bad4d667ef"}, + {file = "pep562-1.0.tar.gz", hash = "sha256:58cb1cc9ee63d93e62b4905a50357618d526d289919814bea1f0da8f53b79395"}, +] pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, @@ -993,10 +1313,24 @@ py = [ {file = "py-1.8.1-py2.py3-none-any.whl", hash = "sha256:c20fdd83a5dbc0af9efd622bee9a5564e278f6380fffcacc43ba6f43db2813b0"}, {file = "py-1.8.1.tar.gz", hash = "sha256:5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa"}, ] +pygments = [ + {file = "Pygments-2.3.1-py2.py3-none-any.whl", hash = "sha256:e8218dd399a61674745138520d0d4cf2621d7e032439341bc3f647bff125818d"}, + {file = "Pygments-2.3.1.tar.gz", hash = "sha256:5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a"}, + {file = "Pygments-2.5.2-py2.py3-none-any.whl", hash = "sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b"}, + {file = "Pygments-2.5.2.tar.gz", hash = "sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe"}, +] pylev = [ {file = "pylev-1.3.0-py2.py3-none-any.whl", hash = "sha256:1d29a87beb45ebe1e821e7a3b10da2b6b2f4c79b43f482c2df1a1f748a6e114e"}, {file = "pylev-1.3.0.tar.gz", hash = "sha256:063910098161199b81e453025653ec53556c1be7165a9b7c50be2f4d57eae1c3"}, ] +pymdown-extensions = [ + {file = "pymdown-extensions-6.0.tar.gz", hash = "sha256:6cf0cf36b5a03b291ace22dc2f320f4789ce56fbdb6635a3be5fadbf5d7694dd"}, + {file = "pymdown_extensions-6.0-py2.py3-none-any.whl", hash = "sha256:25b0a7967fa697b5035e23340a48594e3e93acb10b06d74574218ace3347d1df"}, + {file = "pymdown-extensions-6.2.1.tar.gz", hash = "sha256:3bbe6048275f8a0d13a0fe44e0ea201e67268aa7bb40c2544eef16abbf168f7b"}, + {file = "pymdown_extensions-6.2.1-py2.py3-none-any.whl", hash = "sha256:dce5e17b93be0572322b7d06c9a13c13a9d98694d6468277911d50ca87d26f29"}, + {file = "pymdown-extensions-6.3.tar.gz", hash = "sha256:cb879686a586b22292899771f5e5bc3382808e92aa938f71b550ecdea709419f"}, + {file = "pymdown_extensions-6.3-py2.py3-none-any.whl", hash = "sha256:66fae2683c7a1dac53184f7de57f51f8dad73f9ead2f453e94e85096cb811335"}, +] pyparsing = [ {file = "pyparsing-2.4.6-py2.py3-none-any.whl", hash = "sha256:c342dccb5250c08d45fd6f8b4a559613ca603b57498511740e65cd11a2e7dcec"}, {file = "pyparsing-2.4.6.tar.gz", hash = "sha256:4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f"}, @@ -1094,9 +1428,20 @@ toml = [ {file = "toml-0.10.0-py2.py3-none-any.whl", hash = "sha256:235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e"}, {file = "toml-0.10.0.tar.gz", hash = "sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c"}, ] +tornado = [ + {file = "tornado-6.0.4-cp35-cp35m-win32.whl", hash = "sha256:5217e601700f24e966ddab689f90b7ea4bd91ff3357c3600fa1045e26d68e55d"}, + {file = "tornado-6.0.4-cp35-cp35m-win_amd64.whl", hash = "sha256:c98232a3ac391f5faea6821b53db8db461157baa788f5d6222a193e9456e1740"}, + {file = "tornado-6.0.4-cp36-cp36m-win32.whl", hash = "sha256:5f6a07e62e799be5d2330e68d808c8ac41d4a259b9cea61da4101b83cb5dc673"}, + {file = "tornado-6.0.4-cp36-cp36m-win_amd64.whl", hash = "sha256:c952975c8ba74f546ae6de2e226ab3cc3cc11ae47baf607459a6728585bb542a"}, + {file = "tornado-6.0.4-cp37-cp37m-win32.whl", hash = "sha256:2c027eb2a393d964b22b5c154d1a23a5f8727db6fda837118a776b29e2b8ebc6"}, + {file = "tornado-6.0.4-cp37-cp37m-win_amd64.whl", hash = "sha256:5618f72e947533832cbc3dec54e1dffc1747a5cb17d1fd91577ed14fa0dc081b"}, + {file = "tornado-6.0.4-cp38-cp38-win32.whl", hash = "sha256:22aed82c2ea340c3771e3babc5ef220272f6fd06b5108a53b4976d0d722bcd52"}, + {file = "tornado-6.0.4-cp38-cp38-win_amd64.whl", hash = "sha256:c58d56003daf1b616336781b26d184023ea4af13ae143d9dda65e31e534940b9"}, + {file = "tornado-6.0.4.tar.gz", hash = "sha256:0fe2d45ba43b00a41cd73f8be321a44936dc1aba233dee979f17a042b83eb6dc"}, +] tox = [ - {file = "tox-3.12.1-py2.py3-none-any.whl", hash = "sha256:f5c8e446b51edd2ea97df31d4ded8c8b72e7d6c619519da6bb6084b9dd5770f9"}, - {file = "tox-3.12.1.tar.gz", hash = "sha256:f87fd33892a2df0950e5e034def9468988b8d008c7e9416be665fcc0dd45b14f"}, + {file = "tox-3.14.0-py2.py3-none-any.whl", hash = "sha256:0bc216b6a2e6afe764476b4a07edf2c1dab99ed82bb146a1130b2e828f5bff5e"}, + {file = "tox-3.14.0.tar.gz", hash = "sha256:c4f6b319c20ba4913dbfe71ebfd14ff95d1853c4231493608182f66e566ecfe1"}, {file = "tox-3.14.5-py2.py3-none-any.whl", hash = "sha256:0cbe98369081fa16bd6f1163d3d0b2a62afa29d402ccfad2bd09fb2668be0956"}, {file = "tox-3.14.5.tar.gz", hash = "sha256:676f1e3e7de245ad870f956436b84ea226210587d1f72c8dfb8cd5ac7b6f0e70"}, ] diff --git a/pyproject.toml b/pyproject.toml index 1bfd3826..e98c61e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,35 @@ babel = "^2.5" cleo = "^0.7.5" tox = "^3.0" black = { version = "^19.3b0", markers = "python_version >= '3.6' and python_version < '4.0' and implementation_name != 'pypy'" } +isort = { version = "^4.3.21", markers = "python_version >= '3.6' and python_version < '4.0'" } pre-commit = "^1.10" +mkdocs = { version = "^1.0", python = "^3.5" } +pymdown-extensions = "^6.0" +pygments = "^2.2" +markdown-include = "^0.5.1" + + +[tool.isort] +line_length = 88 +force_single_line = true +force_grid_wrap = 0 +atomic = true +include_trailing_comma = true +lines_after_imports = 2 +lines_between_types = 1 +multi_line_output = 3 +use_parentheses = true +not_skip = "__init__.py" +skip_glob = ["*/setup.py"] +filter_files = true + +known_first_party = "pendulum" +known_third_party = [ + "babel", + "cleo", + "dateutil", + "pytzdata", +] [build-system] diff --git a/tests/conftest.py b/tests/conftest.py index 7a158dde..4ab1b877 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,5 @@ -import pytest import pendulum +import pytest @pytest.fixture(autouse=True) diff --git a/tests/date/test_add.py b/tests/date/test_add.py index f40ce92a..9c83b61a 100644 --- a/tests/date/test_add.py +++ b/tests/date/test_add.py @@ -1,8 +1,7 @@ -import pytest +from datetime import timedelta import pendulum - -from datetime import timedelta +import pytest from ..conftest import assert_date diff --git a/tests/date/test_behavior.py b/tests/date/test_behavior.py index 13b877f3..1ef56c49 100644 --- a/tests/date/test_behavior.py +++ b/tests/date/test_behavior.py @@ -1,10 +1,10 @@ import pickle -import pytest - -import pendulum from datetime import date +import pendulum +import pytest + @pytest.fixture() def p(): diff --git a/tests/date/test_comparison.py b/tests/date/test_comparison.py index 75b0b356..052ae2f3 100644 --- a/tests/date/test_comparison.py +++ b/tests/date/test_comparison.py @@ -1,7 +1,7 @@ -import pendulum - from datetime import date +import pendulum + from ..conftest import assert_date @@ -44,7 +44,7 @@ def test_not_equal_to_false(): def test_not_equal_to_none(): d1 = pendulum.Date(2000, 1, 1) - assert d1 != None + assert d1 != None # noqa def test_greater_than_true(): @@ -242,4 +242,4 @@ def test_comparison_to_unsupported(): dt1 = pendulum.Date.today() assert not dt1 == "test" - assert not dt1 in ["test"] + assert dt1 not in ["test"] diff --git a/tests/date/test_day_of_week_modifiers.py b/tests/date/test_day_of_week_modifiers.py index e65a13c0..62aad336 100644 --- a/tests/date/test_day_of_week_modifiers.py +++ b/tests/date/test_day_of_week_modifiers.py @@ -1,6 +1,6 @@ +import pendulum import pytest -import pendulum from pendulum.exceptions import PendulumException from ..conftest import assert_date diff --git a/tests/date/test_diff.py b/tests/date/test_diff.py index 9bdbc335..29814acc 100644 --- a/tests/date/test_diff.py +++ b/tests/date/test_diff.py @@ -1,8 +1,8 @@ +from datetime import date + import pendulum import pytest -from datetime import date - @pytest.fixture def today(): diff --git a/tests/date/test_sub.py b/tests/date/test_sub.py index 1edbd463..dcf7a2a4 100644 --- a/tests/date/test_sub.py +++ b/tests/date/test_sub.py @@ -1,8 +1,8 @@ -import pytest +from datetime import datetime +from datetime import timedelta import pendulum - -from datetime import datetime, timedelta +import pytest from ..conftest import assert_date diff --git a/tests/datetime/test_add.py b/tests/datetime/test_add.py index 38fc7055..bb338ba7 100644 --- a/tests/datetime/test_add.py +++ b/tests/datetime/test_add.py @@ -1,8 +1,8 @@ +from datetime import timedelta + import pendulum import pytest -from datetime import timedelta - from ..conftest import assert_datetime diff --git a/tests/datetime/test_behavior.py b/tests/datetime/test_behavior.py index e8c67fa4..04c0b1e1 100644 --- a/tests/datetime/test_behavior.py +++ b/tests/datetime/test_behavior.py @@ -1,12 +1,16 @@ import pickle -from datetime import datetime, date, time, timedelta + from copy import deepcopy +from datetime import date +from datetime import datetime +from datetime import time +from datetime import timedelta +import pendulum import pytest -import pendulum -from pendulum.tz.timezone import Timezone from pendulum import timezone +from pendulum.tz.timezone import Timezone @pytest.fixture diff --git a/tests/datetime/test_comparison.py b/tests/datetime/test_comparison.py index 02d4d42c..0819f801 100644 --- a/tests/datetime/test_comparison.py +++ b/tests/datetime/test_comparison.py @@ -1,7 +1,7 @@ -import pytz from datetime import datetime import pendulum +import pytz from ..conftest import assert_datetime @@ -72,7 +72,7 @@ def test_not_equal_with_timezone_true(): def test_not_equal_to_none(): d1 = pendulum.datetime(2000, 1, 1, 1, 2, 3) - assert d1 != None + assert d1 != None # noqa def test_greater_than_true(): diff --git a/tests/datetime/test_construct.py b/tests/datetime/test_construct.py index 149dec18..b5db944c 100644 --- a/tests/datetime/test_construct.py +++ b/tests/datetime/test_construct.py @@ -1,11 +1,13 @@ import os -import pytz + +from datetime import datetime + +from dateutil import tz import pendulum import pytest +import pytz -from datetime import datetime -from dateutil import tz from pendulum import DateTime from pendulum.tz import timezone diff --git a/tests/datetime/test_create_from_timestamp.py b/tests/datetime/test_create_from_timestamp.py index 6651be6b..e7e24d7a 100644 --- a/tests/datetime/test_create_from_timestamp.py +++ b/tests/datetime/test_create_from_timestamp.py @@ -1,6 +1,5 @@ -import pytz - import pendulum + from pendulum import timezone from ..conftest import assert_datetime diff --git a/tests/datetime/test_day_of_week_modifiers.py b/tests/datetime/test_day_of_week_modifiers.py index 7b476418..1526f4a8 100644 --- a/tests/datetime/test_day_of_week_modifiers.py +++ b/tests/datetime/test_day_of_week_modifiers.py @@ -1,6 +1,6 @@ +import pendulum import pytest -import pendulum from pendulum.exceptions import PendulumException from ..conftest import assert_datetime diff --git a/tests/datetime/test_diff.py b/tests/datetime/test_diff.py index 157b543a..b936b901 100644 --- a/tests/datetime/test_diff.py +++ b/tests/datetime/test_diff.py @@ -1,8 +1,8 @@ +from datetime import datetime + import pendulum import pytest -from datetime import datetime - def test_diff_in_years_positive(): dt = pendulum.datetime(2000, 1, 1) diff --git a/tests/datetime/test_fluent_setters.py b/tests/datetime/test_fluent_setters.py index d73a8a7e..1b5d1576 100644 --- a/tests/datetime/test_fluent_setters.py +++ b/tests/datetime/test_fluent_setters.py @@ -1,9 +1,6 @@ -import pytest -import pendulum - from datetime import datetime -from pendulum.tz.exceptions import NonExistingTime +import pendulum from ..conftest import assert_datetime diff --git a/tests/datetime/test_from_format.py b/tests/datetime/test_from_format.py index 06404548..7f1d03ec 100644 --- a/tests/datetime/test_from_format.py +++ b/tests/datetime/test_from_format.py @@ -60,7 +60,7 @@ def test_from_format_with_padded_day(): def test_from_format_with_invalid_padded_day(): with pytest.raises(ValueError): - d = pendulum.from_format("Apr 2 12:00:00 2020 GMT", "MMM DD HH:mm:ss YYYY z") + pendulum.from_format("Apr 2 12:00:00 2020 GMT", "MMM DD HH:mm:ss YYYY z") @pytest.mark.parametrize( diff --git a/tests/datetime/test_getters.py b/tests/datetime/test_getters.py index 64971efc..264f4da5 100644 --- a/tests/datetime/test_getters.py +++ b/tests/datetime/test_getters.py @@ -1,12 +1,14 @@ +import struct + import pendulum import pytest -import struct from pendulum import DateTime from pendulum.tz import timezone from pendulum.utils._compat import _HAS_FOLD -from ..conftest import assert_date, assert_time +from ..conftest import assert_date +from ..conftest import assert_time def test_year(): diff --git a/tests/datetime/test_sub.py b/tests/datetime/test_sub.py index 2a8096c4..7e44eda2 100644 --- a/tests/datetime/test_sub.py +++ b/tests/datetime/test_sub.py @@ -1,8 +1,8 @@ +from datetime import timedelta + import pendulum import pytest -from datetime import timedelta - from ..conftest import assert_datetime diff --git a/tests/duration/test_add_sub.py b/tests/duration/test_add_sub.py index 92d97c70..530343ae 100644 --- a/tests/duration/test_add_sub.py +++ b/tests/duration/test_add_sub.py @@ -1,7 +1,7 @@ -import pendulum - from datetime import timedelta +import pendulum + from ..conftest import assert_duration diff --git a/tests/duration/test_behavior.py b/tests/duration/test_behavior.py index 40d31779..115e3979 100644 --- a/tests/duration/test_behavior.py +++ b/tests/duration/test_behavior.py @@ -1,8 +1,9 @@ import pickle -import pendulum from datetime import timedelta +import pendulum + def test_pickle(): it = pendulum.duration(days=3, seconds=2456, microseconds=123456) diff --git a/tests/duration/test_construct.py b/tests/duration/test_construct.py index 0ef36f51..8afb1bb3 100644 --- a/tests/duration/test_construct.py +++ b/tests/duration/test_construct.py @@ -1,7 +1,8 @@ -import pytest +from datetime import timedelta + import pendulum +import pytest -from datetime import timedelta from pendulum.duration import AbsoluteDuration from ..conftest import assert_duration diff --git a/tests/formatting/test_formatter.py b/tests/formatting/test_formatter.py index 80bb4517..dd44f4d0 100644 --- a/tests/formatting/test_formatter.py +++ b/tests/formatting/test_formatter.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- +import pendulum import pytest -import pendulum from pendulum.formatting import Formatter from pendulum.locales.locale import Locale diff --git a/tests/localization/test_nl.py b/tests/localization/test_nl.py index eba26ce0..545c8a3b 100644 --- a/tests/localization/test_nl.py +++ b/tests/localization/test_nl.py @@ -3,6 +3,7 @@ import pendulum + locale = "nl" diff --git a/tests/parsing/test_parse_iso8601.py b/tests/parsing/test_parse_iso8601.py index 3d2c3ea6..d86cb621 100644 --- a/tests/parsing/test_parse_iso8601.py +++ b/tests/parsing/test_parse_iso8601.py @@ -1,8 +1,12 @@ +from datetime import date +from datetime import datetime +from datetime import time + import pytest -from datetime import date, time, datetime from pendulum.parsing import parse_iso8601 + try: from pendulum.parsing._extension import TZFixedOffset as FixedTimezone except ImportError: diff --git a/tests/parsing/test_parsing.py b/tests/parsing/test_parsing.py index 19f532d4..bcd7a53e 100644 --- a/tests/parsing/test_parsing.py +++ b/tests/parsing/test_parsing.py @@ -1,8 +1,10 @@ -import pytest import datetime + import pendulum +import pytest -from pendulum.parsing import parse, ParserError +from pendulum.parsing import ParserError +from pendulum.parsing import parse def test_y(): diff --git a/tests/parsing/test_parsing_duration.py b/tests/parsing/test_parsing_duration.py index a9e80877..41d488b7 100644 --- a/tests/parsing/test_parsing_duration.py +++ b/tests/parsing/test_parsing_duration.py @@ -1,6 +1,7 @@ import pytest -from pendulum.parsing import parse, ParserError +from pendulum.parsing import ParserError +from pendulum.parsing import parse def test_parse_duration(): diff --git a/tests/period/test_behavior.py b/tests/period/test_behavior.py index 307b78e0..7ad7b455 100644 --- a/tests/period/test_behavior.py +++ b/tests/period/test_behavior.py @@ -1,8 +1,9 @@ import pickle -import pendulum from datetime import timedelta +import pendulum + def test_pickle(): dt1 = pendulum.datetime(2016, 11, 18) diff --git a/tests/period/test_construct.py b/tests/period/test_construct.py index d56f8604..21538fc2 100644 --- a/tests/period/test_construct.py +++ b/tests/period/test_construct.py @@ -1,7 +1,7 @@ -import pendulum - from datetime import datetime +import pendulum + from ..conftest import assert_datetime diff --git a/tests/period/test_range.py b/tests/period/test_range.py index 77356e5e..55aac10c 100644 --- a/tests/period/test_range.py +++ b/tests/period/test_range.py @@ -1,4 +1,5 @@ import pendulum + from pendulum import Period from ..conftest import assert_datetime diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 37dc4185..09a98a8e 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -1,12 +1,15 @@ from __future__ import absolute_import -import pytest +from datetime import datetime + import pendulum +import pytest import pytz -from datetime import datetime from pendulum import timezone -from pendulum.helpers import precise_diff, week_day, days_in_year +from pendulum.helpers import days_in_year +from pendulum.helpers import precise_diff +from pendulum.helpers import week_day from .conftest import assert_datetime diff --git a/tests/test_parsing.py b/tests/test_parsing.py index 4f50d863..1d943657 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -1,6 +1,9 @@ import pendulum -from .conftest import assert_datetime, assert_date, assert_time, assert_duration +from .conftest import assert_date +from .conftest import assert_datetime +from .conftest import assert_duration +from .conftest import assert_time def test_parse(): diff --git a/tests/time/test_add.py b/tests/time/test_add.py index 192ffc04..05998a32 100644 --- a/tests/time/test_add.py +++ b/tests/time/test_add.py @@ -1,8 +1,8 @@ +from datetime import timedelta + import pendulum import pytest -from datetime import timedelta - def test_add_hours_positive(): assert pendulum.time(12, 34, 56).add(hours=1).hour == 13 diff --git a/tests/time/test_behavior.py b/tests/time/test_behavior.py index 515d33cd..42964345 100644 --- a/tests/time/test_behavior.py +++ b/tests/time/test_behavior.py @@ -1,8 +1,10 @@ -import pendulum import pickle -import pytest from datetime import time + +import pendulum +import pytest + from pendulum import Time diff --git a/tests/time/test_comparison.py b/tests/time/test_comparison.py index d9cf7b1a..b163ecba 100644 --- a/tests/time/test_comparison.py +++ b/tests/time/test_comparison.py @@ -1,7 +1,7 @@ -import pendulum - from datetime import time +import pendulum + from ..conftest import assert_time @@ -26,7 +26,7 @@ def test_equal_to_false(): def test_not_equal_to_none(): t1 = pendulum.time(1, 2, 3) - assert t1 != None + assert t1 != None # noqa def test_greater_than_true(): diff --git a/tests/time/test_diff.py b/tests/time/test_diff.py index da76cf76..5e99701b 100644 --- a/tests/time/test_diff.py +++ b/tests/time/test_diff.py @@ -1,5 +1,4 @@ import pendulum -import pytest from pendulum import Time diff --git a/tests/time/test_sub.py b/tests/time/test_sub.py index 5c24390f..05e4b103 100644 --- a/tests/time/test_sub.py +++ b/tests/time/test_sub.py @@ -1,11 +1,12 @@ +from datetime import time +from datetime import timedelta + import pendulum import pytest import pytz -from datetime import timedelta, time from pendulum import Time - from ..conftest import assert_duration diff --git a/tests/tz/test_helpers.py b/tests/tz/test_helpers.py index 3d28c2ac..c8b8c920 100644 --- a/tests/tz/test_helpers.py +++ b/tests/tz/test_helpers.py @@ -1,7 +1,8 @@ import pytest from pendulum.tz import timezone -from pendulum.tz.timezone import Timezone, FixedTimezone +from pendulum.tz.timezone import FixedTimezone +from pendulum.tz.timezone import Timezone from pendulum.tz.zoneinfo.exceptions import InvalidTimezone diff --git a/tests/tz/test_timezone.py b/tests/tz/test_timezone.py index 31d8c3dc..303a5fc9 100644 --- a/tests/tz/test_timezone.py +++ b/tests/tz/test_timezone.py @@ -1,11 +1,14 @@ -import pytest -from datetime import datetime, timedelta +from datetime import datetime +from datetime import timedelta import pendulum +import pytest + from pendulum import timezone -from pendulum.utils._compat import PY36 from pendulum.tz import fixed_timezone -from pendulum.tz.exceptions import NonExistingTime, AmbiguousTime +from pendulum.tz.exceptions import AmbiguousTime +from pendulum.tz.exceptions import NonExistingTime +from pendulum.utils._compat import PY36 from ..conftest import assert_datetime diff --git a/tests/tz/test_timezones.py b/tests/tz/test_timezones.py index 56c8db15..8c90674f 100644 --- a/tests/tz/test_timezones.py +++ b/tests/tz/test_timezones.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- -import pytest - import pendulum +import pytest def test_timezones(): diff --git a/tests/tz/zoneinfo/test_posix_timezone.py b/tests/tz/zoneinfo/test_posix_timezone.py index b9903b1d..41a64587 100644 --- a/tests/tz/zoneinfo/test_posix_timezone.py +++ b/tests/tz/zoneinfo/test_posix_timezone.py @@ -1,6 +1,6 @@ -from pendulum.tz.zoneinfo.posix_timezone import posix_spec from pendulum.tz.zoneinfo.posix_timezone import JPosixTransition from pendulum.tz.zoneinfo.posix_timezone import MPosixTransition +from pendulum.tz.zoneinfo.posix_timezone import posix_spec def test_posix_spec_m(): diff --git a/tests/tz/zoneinfo/test_reader.py b/tests/tz/zoneinfo/test_reader.py index f15e266c..a19ba9a0 100644 --- a/tests/tz/zoneinfo/test_reader.py +++ b/tests/tz/zoneinfo/test_reader.py @@ -1,9 +1,11 @@ import os + import pytest +from pendulum.tz.zoneinfo.exceptions import InvalidTimezone +from pendulum.tz.zoneinfo.exceptions import InvalidZoneinfoFile from pendulum.tz.zoneinfo.reader import Reader from pendulum.tz.zoneinfo.timezone import Timezone -from pendulum.tz.zoneinfo.exceptions import InvalidTimezone, InvalidZoneinfoFile def test_read_for_bad_timezone():