Skip to content

Commit 8db0383

Browse files
committed
style: sort imports using isort
1 parent 1724f4f commit 8db0383

File tree

7 files changed

+51
-36
lines changed

7 files changed

+51
-36
lines changed

getmac/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .getmac import __version__, settings, get_mac_address # noqa: F401
1+
from .getmac import __version__, get_mac_address, settings # noqa: F401
22

33
__all__ = ["get_mac_address"]

getmac/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66

77
from . import getmac
8-
from .variables import settings, gvars
8+
from .variables import gvars, settings
99

1010

1111
def build_parser() -> argparse.ArgumentParser:

getmac/getmac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from typing import Dict, Final, List, Optional, Set, Tuple, Type, Union
4141

4242
from . import utils
43-
from .variables import settings, consts, gvars
43+
from .variables import consts, gvars, settings
4444

4545
#: Current version of getmac package
4646
__version__ = "1.0.0a0"

getmac/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import os
88
import re
99
import shlex
10+
import shutil
1011
import socket
1112
import subprocess
12-
import shutil
1313
from typing import Optional, Union
1414

15-
from .variables import settings, consts, gvars
15+
from .variables import consts, gvars, settings
1616

1717

1818
def check_command(command: str) -> bool:

pdm.lock

Lines changed: 35 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@ build-backend = "pdm.backend"
44

55
[project]
66
name = "getmac"
7-
dynamic = ["version"] # , "readme"
7+
dynamic = ["version"]
88
description = "Platform-independent pure-Python module to get a MAC address"
99
dependencies = []
1010
readme = "README.md"
11-
# readme = { file = "README.md", content-type = "text/markdown" }
1211
authors = [
1312
{name = "Christopher Goes", email = "ghostofgoes@gmail.com"},
1413
]
1514
maintainers = [
1615
{name = "Christopher Goes", email = "ghostofgoes@gmail.com"},
1716
]
18-
license = { file = "LICENSE"} # text = "MIT"
17+
license = { file = "LICENSE"}
1918
requires-python = "<4.0,>=3.8"
2019
classifiers = [
2120
"Development Status :: 5 - Production/Stable",
@@ -89,14 +88,16 @@ test = [
8988
"pytest-xdist",
9089
"psutil",
9190
"pygments<3.0,>=2.13",
91+
# TODO: pytest-sugar
9292
]
9393
lint = [
9494
"codespell>=2.2.4",
9595
"tomli; python_version < \"3.12\"",
9696
"ruff",
9797
"vulture",
98-
"black<24.0.0,>=23.3.0",
98+
"black",
9999
"mypy<2.0.0,>=1.3.0",
100+
"isort",
100101
]
101102
docs = [
102103
"furo; python_version >= \"3.10\"",
@@ -145,8 +146,8 @@ cmd = "vulture --min-confidence 100 getmac tests"
145146
[tool.pdm.scripts.check_format]
146147
help = "Check code formatting is correct"
147148
composite = [
149+
"isort --check getmac tests",
148150
"black --check getmac tests",
149-
# TODO: isort
150151
]
151152

152153
[tool.pdm.scripts.typing]
@@ -166,8 +167,8 @@ composite = [
166167
[tool.pdm.scripts.format]
167168
help = "Auto-format code to match requirements"
168169
composite = [
170+
"isort getmac tests",
169171
"black getmac tests",
170-
# TODO: isort
171172
]
172173

173174
[tool.pdm.scripts.benchmark]
@@ -276,3 +277,6 @@ ignore = [
276277

277278
[tool.ruff.lint.per-file-ignores]
278279
"tests/*.py" = ["ANN001", "ANN002", "ANN003", "ANN201", "ANN202", "S101", "S104", "S603"]
280+
281+
[tool.isort]
282+
profile = "black"

tests/test_getmac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import pytest
1313

1414
from getmac import get_mac_address, getmac, utils
15-
from getmac.variables import settings, consts, gvars
15+
from getmac.variables import consts, gvars, settings
1616

1717

1818
def test_all_methods_defined_are_in_methods_list():

0 commit comments

Comments
 (0)