Skip to content

Commit 0063af9

Browse files
authored
python sort imports (#380)
2 parents bc04d7d + 7f36677 commit 0063af9

39 files changed

+107
-96
lines changed

.github/workflows/python-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: poetry run pyright
3434
working-directory: python/selfie-lib
3535
- name: selfie-lib - ruff
36-
run: poetry run ruff format --check
36+
run: poetry run ruff format --check && poetry run ruff check
3737
working-directory: python/selfie-lib
3838
- name: pytest-selfie - poetry install
3939
run: poetry install
@@ -42,7 +42,7 @@ jobs:
4242
run: poetry run pyright
4343
working-directory: python/pytest-selfie
4444
- name: pytest-selfie - ruff
45-
run: poetry run ruff format --check
45+
run: poetry run ruff format --check && poetry run ruff check
4646
working-directory: python/pytest-selfie
4747
- name: example-pytest-selfie - poetry install
4848
run: poetry install
@@ -53,5 +53,5 @@ jobs:
5353
# run: poetry run pyright
5454
# working-directory: python/example-pytest-selfie
5555
- name: example-pytest-selfie - ruff
56-
run: poetry run ruff format --check
56+
run: poetry run ruff format --check && poetry run ruff check
5757
working-directory: python/example-pytest-selfie

python/example-pytest-selfie/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ pytest-selfie = { path = "../pytest-selfie", develop = true }
1919
[build-system]
2020
requires = ["poetry-core"]
2121
build-backend = "poetry.core.masonry.api"
22+
23+
[tool.ruff]
24+
lint.extend-select = ["I"]
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from selfie_lib.Selfie import cache_selfie_string
21
import random
32

3+
from selfie_lib.Selfie import cache_selfie_string
4+
45

56
def test_cache_selfie():
67
cache_selfie_string(lambda: str(random.random())).to_be("0.6623096709843852")

python/example-pytest-selfie/tests/simple_inline_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from selfie_lib.Selfie import expect_selfie
22

3-
43
# def test_read_pass():
54
# expect_selfie("A").to_be("A")
65

python/example-pytest-selfie/tests/to_be_file_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
import os
2+
from pathlib import Path
3+
4+
from pytest_selfie import FSImplementation
15
from selfie_lib.WriteTracker import (
6+
SnapshotFileLayout,
27
ToBeFileWriteTracker,
3-
ToBeFileLazyBytes,
4-
recordCall,
58
TypedPath,
6-
SnapshotFileLayout,
9+
recordCall,
710
)
8-
from pytest_selfie import FSImplementation
9-
from pathlib import Path
10-
import os
1111

1212

1313
def test_to_be_file():

python/pytest-selfie/pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@ requires = ["poetry-core"]
2222
build-backend = "poetry.core.masonry.api"
2323

2424
[tool.poetry.plugins.pytest11]
25-
pytest_selfie = "pytest_selfie.plugin"
25+
pytest_selfie = "pytest_selfie.plugin"
26+
27+
[tool.ruff]
28+
lint.extend-select = ["I"]

python/pytest-selfie/pytest_selfie/SelfieSettingsAPI.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os
22
from pathlib import Path
3-
import re
43
from typing import Optional
5-
from selfie_lib import Mode
4+
65
import pytest
6+
from selfie_lib import Mode
77

88

99
class SelfieSettingsAPI:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
from .SelfieSettingsAPI import SelfieSettingsAPI as SelfieSettingsAPI
21
from .plugin import FSImplementation as FSImplementation
2+
from .SelfieSettingsAPI import SelfieSettingsAPI as SelfieSettingsAPI

python/pytest-selfie/pytest_selfie/plugin.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
1-
from cgi import test
21
import os
2+
from cgi import test
33
from collections import defaultdict
4-
from typing import ByteString, DefaultDict, List, Optional, Iterator
4+
from typing import ByteString, DefaultDict, Iterator, List, Optional
55

6-
from selfie_lib.Atomic import AtomicReference
7-
from selfie_lib.WriteTracker import ToBeFileWriteTracker
8-
from .SelfieSettingsAPI import SelfieSettingsAPI
6+
import pytest
97
from selfie_lib import (
10-
_clearSelfieSystem,
11-
_initSelfieSystem,
8+
FS,
129
ArrayMap,
1310
ArraySet,
1411
CallStack,
1512
CommentTracker,
1613
DiskStorage,
1714
DiskWriteTracker,
18-
FS,
1915
InlineWriteTracker,
2016
LiteralValue,
2117
Mode,
@@ -27,8 +23,13 @@
2723
SourceFile,
2824
TypedPath,
2925
WithinTestGC,
26+
_clearSelfieSystem,
27+
_initSelfieSystem,
3028
)
31-
import pytest
29+
from selfie_lib.Atomic import AtomicReference
30+
from selfie_lib.WriteTracker import ToBeFileWriteTracker
31+
32+
from .SelfieSettingsAPI import SelfieSettingsAPI
3233

3334

3435
class FSImplementation(FS):

python/pytest-selfie/pytest_selfie/replace_todo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import re
22
from pathlib import Path
3+
34
from selfie_lib import (
45
CommentTracker,
5-
recordCall,
66
TypedPath,
7+
recordCall,
78
)
89

910

0 commit comments

Comments
 (0)