Skip to content

Commit

Permalink
Sort imports using isort
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuba314 committed Dec 8, 2023
1 parent b9d9a68 commit 98e1401
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 16 deletions.
4 changes: 2 additions & 2 deletions arcparse/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .arguments import MxGroup, flag, no_flag, option, positional
from .converters import itemwise
from .parser import ArcParser
from .arguments import flag, no_flag, option, positional, MxGroup
from .subparser import subparsers
from .converters import itemwise

__all__ = [
"ArcParser",
Expand Down
8 changes: 6 additions & 2 deletions arcparse/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
from argparse import ArgumentParser, _ActionsContainer
from collections.abc import Callable
from dataclasses import dataclass, field
from collections.abc import Callable
from typing import Any, Literal, overload

from .converters import itemwise
from .typehints import extract_collection_type, extract_optional_type, extract_type_from_typehint
from .typehints import (
extract_collection_type,
extract_optional_type,
extract_type_from_typehint,
)


class Void:
pass
Expand Down
20 changes: 16 additions & 4 deletions arcparse/parser.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
from __future__ import annotations

from argparse import ArgumentParser
from dataclasses import make_dataclass
from collections.abc import Sequence
from dataclasses import make_dataclass
from enum import StrEnum
from types import NoneType, UnionType
from typing import Any, Self, Union, get_args, get_origin
import inspect
import re

from .arguments import _Option, _BaseValueArgument, _Flag, _BaseArgument, _ValueOverride, MxGroup, void
from .arguments import (
MxGroup,
_BaseArgument,
_BaseValueArgument,
_Flag,
_Option,
_ValueOverride,
void,
)
from .converters import itemwise
from .subparser import _Subparsers
from .typehints import extract_collection_type, extract_subparsers_from_typehint, extract_type_from_typehint
from .converters import itemwise
from .typehints import (
extract_collection_type,
extract_subparsers_from_typehint,
extract_type_from_typehint,
)


def _to_bool(value: str) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion arcparse/subparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from collections.abc import Sequence
from dataclasses import dataclass
from types import NoneType
from typing import Any, TYPE_CHECKING
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from .parser import ArcParser
Expand Down
2 changes: 1 addition & 1 deletion arcparse/typehints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import Optional, Union, get_args, get_origin, TYPE_CHECKING
from types import NoneType, UnionType
from typing import TYPE_CHECKING, Optional, Union, get_args, get_origin

if TYPE_CHECKING:
from .parser import ArcParser
Expand Down
2 changes: 1 addition & 1 deletion tests/test_auto_converter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from enum import StrEnum, auto
import re
from typing import Any, Optional
import re

import pytest

Expand Down
3 changes: 2 additions & 1 deletion tests/test_converter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from enum import StrEnum, auto

import pytest

from arcparse import ArcParser, option, itemwise
from arcparse import ArcParser, itemwise, option
from arcparse.converters import csv


Expand Down
3 changes: 2 additions & 1 deletion tests/test_defaults.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from typing import Any

import pytest

from arcparse import ArcParser, positional, option, flag, no_flag
from arcparse import ArcParser, flag, no_flag, option, positional


class OptArgs(ArcParser):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_dynamic_defaults.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from typing import Any

import pytest

from arcparse import ArcParser, option, flag, no_flag
from arcparse import ArcParser, flag, no_flag, option


class OptArgs(ArcParser):
Expand Down
1 change: 1 addition & 0 deletions tests/test_flag.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any

import pytest

from arcparse import ArcParser, flag, no_flag
Expand Down
2 changes: 1 addition & 1 deletion tests/test_multiple.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from arcparse import ArcParser, positional, option
from arcparse import ArcParser, option, positional


@pytest.mark.parametrize(
Expand Down
3 changes: 2 additions & 1 deletion tests/test_mutual_exclusion.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from typing import Any

import pytest

from arcparse import ArcParser, MxGroup, option, flag
from arcparse import ArcParser, MxGroup, flag, option


def test_group_as_untyped_attribute() -> None:
Expand Down
1 change: 1 addition & 0 deletions tests/test_option.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, Optional

import pytest

from arcparse import ArcParser, option
Expand Down
1 change: 1 addition & 0 deletions tests/test_positional.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any

import pytest

from arcparse import ArcParser, positional
Expand Down

0 comments on commit 98e1401

Please sign in to comment.