Skip to content

Commit 3f86520

Browse files
branchvincentusepowershell
authored andcommitted
flake8 -> ruff
Ruff has largely superseded flake8 due to its impressive performance and re-implementation of popular plugins. Created via `uvx flake8-to-ruff .flake8`
1 parent b4a1b90 commit 3f86520

File tree

6 files changed

+12
-33
lines changed

6 files changed

+12
-33
lines changed

.flake8

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
3535
- name: Lint
3636
run: |
37-
python -m flake8 -v .
37+
python -m ruff check
3838
3939
- name: Run Unit Tests and generate coverage report
4040
run: |

pycomposefile/service/service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ class Service(ComposeElement):
9191
"networks": (Networks, "https://github.com/compose-spec/compose-spec/blob/master/spec.md#networks"),
9292
"mac_address": (str, "https://github.com/compose-spec/compose-spec/blob/master/spec.md#mac_address"),
9393
"mem_limit": (ComposeByteValue, "https://github.com/compose-spec/compose-spec/blob/master/spec.md#mem_limit"),
94-
"mem_reservation": (ComposeByteValue, "https://github.com/compose-spec/compose-spec/blob/master/spec.md#mem_reservation"),
9594
"mem_swappiness": ((int, [0, 100]), "https://github.com/compose-spec/compose-spec/blob/master/spec.md#mem_swappiness"),
9695
"memswap_limit": (ComposeByteValue, "https://github.com/compose-spec/compose-spec/blob/master/spec.md#memswap_limit"),
9796
"oom_kill_disable": (bool, "https://github.com/compose-spec/compose-spec/blob/master/spec.md#oom_kill_disable"),

pyproject.toml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@ license-files = ["LICENSE"]
1616
Homepage = "https://github.com/smurawski/pycomposefile"
1717

1818
[dependency-groups]
19-
dev = [
20-
"pyyaml>=6.0",
21-
"build>=0.7",
22-
"flake8==7.3.0",
23-
"pylint==3.3.7",
24-
"timeout-decorator==0.5.0",
25-
]
19+
dev = ["pyyaml>=6.0", "build>=0.7", "ruff==0.12.5", "timeout-decorator==0.5.0"]
2620

2721
[tool.flit.sdist]
2822
include = ["sample/", "tests/"]
2923

24+
[tool.ruff]
25+
line-length = 120
26+
27+
[tool.ruff.lint]
28+
select = ["C9", "E", "F", "W"]
29+
ignore = ["C901", "E501", "E722", "F401", "F811"]
30+
mccabe = { max-complexity = 10 }
31+
3032
[build-system]
3133
requires = ["flit_core >=3.11,<4"]
3234
build-backend = "flit_core.buildapi"

tests/compose_generator/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def get_compose_with_one_service_with_specific_build_context():
556556
services:
557557
frontend:
558558
image: awesome/webapp
559-
build:
559+
build:
560560
context: ./webapp
561561
"""
562562
return ComposeGenerator.convert_yaml_to_compose_file(compose)

tests/environment_variable_evaluation/test_environment_variables_braces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_uppercase_with_rightbrace_as_default(self):
149149
os.unsetenv(env_var)
150150
braced_env_with_default_unset = "{" + env_var + ":-a}-}"
151151
compose_file = ComposeGenerator.get_compose_with_string_value(braced_env_with_default_unset)
152-
self.assertEqual(compose_file.services["frontend"].image, "awesome/a-}") #
152+
self.assertEqual(compose_file.services["frontend"].image, "awesome/a-}")
153153

154154
@timeout_decorator.timeout(5)
155155
def test_lowercase_with_asterisk_as_default(self):

0 commit comments

Comments
 (0)