Skip to content

Commit

Permalink
Run isort
Browse files Browse the repository at this point in the history
  • Loading branch information
Secrus committed Aug 3, 2022
1 parent 3df90b7 commit cfa19d4
Show file tree
Hide file tree
Showing 107 changed files with 250 additions and 11 deletions.
7 changes: 0 additions & 7 deletions .coveragerc

This file was deleted.

24 changes: 23 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
[flake8]
max-line-length = 88
ignore = E501, E203, W503
ignore =
# E501: Line too long
E501,
# E203: Whitespace before ':'
E203,
#W503: Line break occurred before a binary operator
W503
per-file-ignores =
# F401: Module imported but unused
__init__.py:F401
# F811: Redefinition of unused name from line n
pendulum/tz/timezone.py:F811
min_python_version = 3.7.0
ban-relative-imports = true
# flake8-use-fstring: https://github.com/MichaelKim0407/flake8-use-fstring#--percent-greedy-and---format-greedy
format-greedy = 1
inline-quotes = double
enable-extensions = TC, TC1
type-checking-exempt-modules = typing, typing-extensions
eradicate-whitelist-extend = ^-.*;
extend-ignore =
# SIM106: Handle error-cases first
SIM106,
extend-exclude =
# External to the project's coding standards:
docs/*,
exclude =
.git
__pycache__
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@ repos:
rev: v2.37.3
hooks:
- id: pyupgrade
exclude: ^build\.py$
args:
- --py37-plus

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
hooks:
- id: mypy
pass_filenames: false
exclude: ^build\.py$
additional_dependencies:
- pytest>=7.1.2
2 changes: 2 additions & 0 deletions clock
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python

from __future__ import annotations

import glob
import json
import os
Expand Down
2 changes: 2 additions & 0 deletions pendulum/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import datetime as _datetime

from typing import Optional
Expand Down
2 changes: 1 addition & 1 deletion pendulum/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.1.1"
__version__ = "3.0.0a"
2 changes: 2 additions & 0 deletions pendulum/_extensions/helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import datetime
import math
import typing
Expand Down
3 changes: 3 additions & 0 deletions pendulum/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# The day constants
from __future__ import annotations


SUNDAY = 0
MONDAY = 1
TUESDAY = 2
Expand Down
2 changes: 2 additions & 0 deletions pendulum/date.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import calendar
import math

Expand Down
2 changes: 2 additions & 0 deletions pendulum/datetime.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import calendar
import datetime

Expand Down
2 changes: 2 additions & 0 deletions pendulum/duration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import timedelta

import pendulum
Expand Down
2 changes: 2 additions & 0 deletions pendulum/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from .parsing.exceptions import ParserError # noqa


Expand Down
2 changes: 2 additions & 0 deletions pendulum/formatting/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from .formatter import Formatter


Expand Down
2 changes: 2 additions & 0 deletions pendulum/formatting/difference_formatter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import typing

import pendulum
Expand Down
2 changes: 2 additions & 0 deletions pendulum/formatting/formatter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import datetime
import re
import typing
Expand Down
2 changes: 2 additions & 0 deletions pendulum/helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os
import struct

Expand Down
2 changes: 2 additions & 0 deletions pendulum/mixins/default.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from ..formatting import Formatter


Expand Down
2 changes: 2 additions & 0 deletions pendulum/parser.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import datetime
import typing

Expand Down
2 changes: 2 additions & 0 deletions pendulum/parsing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import copy
import os
import re
Expand Down
3 changes: 3 additions & 0 deletions pendulum/parsing/exceptions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from __future__ import annotations


class ParserError(ValueError):

pass
2 changes: 2 additions & 0 deletions pendulum/parsing/iso8601.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import datetime
import re

Expand Down
2 changes: 2 additions & 0 deletions pendulum/period.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import operator

from datetime import date
Expand Down
2 changes: 2 additions & 0 deletions pendulum/time.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import time
from datetime import timedelta

Expand Down
2 changes: 2 additions & 0 deletions pendulum/tz/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os

from typing import Union
Expand Down
3 changes: 3 additions & 0 deletions pendulum/tz/data/windows.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from __future__ import annotations


windows_timezones = {
"AUS Central Standard Time": "Australia/Darwin",
"AUS Eastern Standard Time": "Australia/Sydney",
Expand Down
3 changes: 3 additions & 0 deletions pendulum/tz/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from __future__ import annotations


class TimezoneError(ValueError):

pass
Expand Down
2 changes: 2 additions & 0 deletions pendulum/tz/local_timezone.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os
import re
import sys
Expand Down
2 changes: 2 additions & 0 deletions pendulum/tz/timezone.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from abc import ABC
from abc import abstractmethod
from datetime import datetime
Expand Down
2 changes: 2 additions & 0 deletions pendulum/utils/_compat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import sys


Expand Down
16 changes: 14 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ include_trailing_comma = true
lines_after_imports = 2
lines_between_types = 1
use_parentheses = true
not_skip = "__init__.py"
skip_glob = ["*/setup.py"]
skip_glob = [
"pendulum/locales/**",
"build.py",
"pendulum/__version__.py",
]
filter_files = true

known_first_party = "pendulum"
Expand All @@ -83,6 +86,15 @@ files = "pendulum, tests"
show_error_codes = true
pretty = true

[tool.coverage.run]
omit = [
"pendulum/locales/*",
"pendulum/__version__.py,",
"pendulum/_extensions/*",
"pendulum/parsing/iso8601.py",
"pendulum/utils/_compat.py",
]

[build-system]
requires = ["poetry-core>=1.1.0a6"]
build-backend = "poetry.core.masonry.api"
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pendulum
Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_add.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import timedelta

import pytest
Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_behavior.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pickle

from datetime import date
Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_comparison.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import date

import pendulum
Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_construct.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from pendulum import Date

from ..conftest import assert_date
Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_day_of_week_modifiers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pendulum
Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_diff.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import date

import pytest
Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_fluent_setters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pendulum

from ..conftest import assert_date
Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_getters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pendulum


Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_start_end_of.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pendulum
Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_strings.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pendulum


Expand Down
2 changes: 2 additions & 0 deletions tests/date/test_sub.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import datetime
from datetime import timedelta

Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_add.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import timedelta

import pytest
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_behavior.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pickle

from copy import deepcopy
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_comparison.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import datetime

import pytz
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_construct.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os

from datetime import datetime
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_create_from_timestamp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pendulum

from pendulum import timezone
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_day_of_week_modifiers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pendulum
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_diff.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import datetime

import pytest
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_fluent_setters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import datetime

import pendulum
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_from_format.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pendulum
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_getters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import struct

import pytest
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_naive.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pendulum

from ..conftest import assert_datetime
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_replace.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pendulum

from ..conftest import assert_datetime
Expand Down
2 changes: 2 additions & 0 deletions tests/datetime/test_start_end_of.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import pytest

import pendulum
Expand Down
Loading

0 comments on commit cfa19d4

Please sign in to comment.