Skip to content

Commit 2260c52

Browse files
branchvincentusepowershell
authored andcommitted
require python 3.9+, fix pyupgrade issues
Previous python versions have reached end of life, with 3.9 support ending soon in October: https://endoflife.date/python Pyupgrade issues were fixed with ruff by opting-in to the UP rules: https://docs.astral.sh/ruff/rules/#pyupgrade-up
1 parent 3f86520 commit 2260c52

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

pycomposefile/compose_element/compose_datatype_transformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def __str__(self) -> str:
1111
return f"Failed to evaluate mandatory variable {self.variable_name}"
1212

1313

14-
class ComposeDataTypeTransformer():
14+
class ComposeDataTypeTransformer:
1515
transform = str
1616
valid_values = None
1717

pycomposefile/secrets/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class SecretFile(str):
55
def readFile(self):
6-
with open(self, "r") as f:
6+
with open(self) as f:
77
secret = f.read()
88
return secret
99

pycomposefile/service/service_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def readFile(self):
1111
env_array = []
1212

1313
for file_name in self:
14-
f = open(file_name, "r")
14+
f = open(file_name)
1515

1616
for line in f.readlines():
1717
if not line.startswith("#"):

pycomposefile/service/service_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __new__(cls, config, key=None, compose_path=None, ) -> None:
1717
condition = detail["condition"]
1818
else:
1919
name = config
20-
ob = super(Dependency, cls).__new__(cls, name)
20+
ob = super().__new__(cls, name)
2121
ob.__setattr__('condition', condition)
2222
return ob
2323

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ readme = "README.md"
66
authors = [
77
{ name = "Steven Murawski", email = "steven.murawski@microsoft.com" },
88
]
9-
requires-python = ">=3.6"
9+
requires-python = ">=3.9"
1010
dependencies = ["pyyaml"]
1111
keywords = ["docker", "compose"]
1212
license = "MIT"
@@ -25,7 +25,7 @@ include = ["sample/", "tests/"]
2525
line-length = 120
2626

2727
[tool.ruff.lint]
28-
select = ["C9", "E", "F", "W"]
28+
select = ["C9", "E", "F", "UP", "W"]
2929
ignore = ["C901", "E501", "E722", "F401", "F811"]
3030
mccabe = { max-complexity = 10 }
3131

0 commit comments

Comments
 (0)