Skip to content

Commit 26923b1

Browse files
Lock file maintenance Python dependencies (main) (#816)
* Lock file maintenance Python dependencies * Fix linting --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Dragomir Penev <[email protected]>
1 parent f8ed45a commit 26923b1

File tree

7 files changed

+553
-456
lines changed

7 files changed

+553
-456
lines changed

poetry.lock

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

pyproject.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ requires-poetry = ">=2.0.0"
77

88
[tool.poetry.dependencies]
99
python = "^3.10"
10-
ops = "^2.18.1"
11-
boto3 = "^1.37.22"
10+
ops = "^2.20.0"
11+
boto3 = "^1.38.0"
1212
pgconnstr = "^1.0.1"
1313
requests = "^2.32.3"
14-
tenacity = "^9.0.0"
14+
tenacity = "^9.1.2"
1515
psycopg2 = "^2.9.10"
1616
pydantic = "^1.10.21"
17-
jinja2 = "^3.1.5"
17+
jinja2 = "^3.1.6"
1818
pysyncobj = "^0.3.14"
1919
psutil = "^7.0.0"
2020

@@ -40,7 +40,7 @@ opentelemetry-exporter-otlp-proto-http = "1.21.0"
4040
optional = true
4141

4242
[tool.poetry.group.format.dependencies]
43-
ruff = "^0.9.6"
43+
ruff = "^0.11.6"
4444

4545
[tool.poetry.group.lint]
4646
optional = true
@@ -52,8 +52,8 @@ codespell = "^2.4.1"
5252
optional = true
5353

5454
[tool.poetry.group.unit.dependencies]
55-
coverage = {extras = ["toml"], version = "^7.6.12"}
56-
pytest = "^8.3.4"
55+
coverage = {extras = ["toml"], version = "^7.8.0"}
56+
pytest = "^8.3.5"
5757
pytest-asyncio = "*"
5858
parameterized = "^0.9.0"
5959
jsonschema = "^4.23.0"
@@ -62,16 +62,16 @@ jsonschema = "^4.23.0"
6262
optional = true
6363

6464
[tool.poetry.group.integration.dependencies]
65-
pytest = "^8.3.4"
66-
pytest-operator = "^0.40.0"
65+
pytest = "^8.3.5"
66+
pytest-operator = "^0.42.0"
6767
# renovate caret doesn't work: https://github.com/renovatebot/renovate/issues/26940
68-
juju = "<=3.6.1.0"
68+
juju = "<=3.6.1.1"
6969
boto3 = "*"
7070
tenacity = "*"
7171
landscape-api-py3 = "^0.9.0"
7272
mailmanclient = "^3.3.5"
7373
psycopg2-binary = "^2.9.10"
74-
allure-pytest = "^2.13.5"
74+
allure-pytest = "^2.14.0"
7575
allure-pytest-default-results = "^0.1.2"
7676

7777
# Testing tools configuration

src/charm.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,9 +1078,9 @@ def _on_install(self, event: InstallEvent) -> None:
10781078
# This is needed due to https://bugs.launchpad.net/snapd/+bug/2011581.
10791079
try:
10801080
# Input is hardcoded
1081-
subprocess.check_call("mkdir -p /home/snap_daemon".split()) # noqa: S603
1082-
subprocess.check_call("chown snap_daemon:snap_daemon /home/snap_daemon".split()) # noqa: S603
1083-
subprocess.check_call("usermod -d /home/snap_daemon snap_daemon".split()) # noqa: S603
1081+
subprocess.check_call(["mkdir", "-p", "/home/snap_daemon"]) # noqa: S607
1082+
subprocess.check_call(["chown", "snap_daemon:snap_daemon", "/home/snap_daemon"]) # noqa: S607
1083+
subprocess.check_call(["usermod", "-d", "/home/snap_daemon", "snap_daemon"]) # noqa: S607
10841084
except subprocess.CalledProcessError:
10851085
logger.exception("Unable to create snap_daemon home dir")
10861086

@@ -1933,8 +1933,7 @@ def _reboot_on_detached_storage(self, event: EventBase) -> None:
19331933
logger.error("Data directory not attached. Reboot unit.")
19341934
self.unit.status = WaitingStatus("Data directory not attached")
19351935
with contextlib.suppress(subprocess.CalledProcessError):
1936-
# Call is constant
1937-
subprocess.check_call(["/usr/bin/systemctl", "reboot"]) # noqa: S603
1936+
subprocess.check_call(["/usr/bin/systemctl", "reboot"])
19381937

19391938
def _restart(self, event: RunWithLock) -> None:
19401939
"""Restart PostgreSQL."""

src/cluster.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,5 +1067,4 @@ def update_patroni_restart_condition(self, new_condition: str) -> None:
10671067
logger.debug(f"new patroni service file: {new_patroni_service}")
10681068
with open(PATRONI_SERVICE_DEFAULT_PATH, "w") as patroni_service_file:
10691069
patroni_service_file.write(new_patroni_service)
1070-
# Input is hardcoded
1071-
subprocess.run(["/bin/systemctl", "daemon-reload"]) # noqa: S603
1070+
subprocess.run(["/bin/systemctl", "daemon-reload"])

src/rotate_logs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def start_log_rotation(self):
4545

4646
logging.info("Starting rotate logs process")
4747

48-
# Input is generated by the charm
49-
pid = subprocess.Popen( # noqa: S603
48+
pid = subprocess.Popen(
5049
["/usr/bin/python3", "scripts/rotate_logs.py"],
5150
# File should not close
5251
stdout=open(LOG_FILE_PATH, "a"), # noqa: SIM115

tests/unit/test_backups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def test_execute_command(harness):
507507
patch("pwd.getpwnam") as _getpwnam,
508508
):
509509
# Test when the command fails.
510-
command = "rm -r /var/lib/postgresql/data/pgdata".split()
510+
command = ["rm", "-r", "/var/lib/postgresql/data/pgdata"]
511511
_run.return_value = CompletedProcess(command, 1, b"", b"fake stderr")
512512
assert harness.charm.backup._execute_command(command) == (1, "", "fake stderr")
513513
_run.assert_called_once_with(

tests/unit/test_charm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ def test_on_install(harness):
9292
pg_snap.alias.assert_any_call("patronictl")
9393

9494
assert _check_call.call_count == 3
95-
_check_call.assert_any_call("mkdir -p /home/snap_daemon".split())
96-
_check_call.assert_any_call("chown snap_daemon:snap_daemon /home/snap_daemon".split())
97-
_check_call.assert_any_call("usermod -d /home/snap_daemon snap_daemon".split())
95+
_check_call.assert_any_call(["mkdir", "-p", "/home/snap_daemon"])
96+
_check_call.assert_any_call(["chown", "snap_daemon:snap_daemon", "/home/snap_daemon"])
97+
_check_call.assert_any_call(["usermod", "-d", "/home/snap_daemon", "snap_daemon"])
9898

9999
# Assert the status set by the event handler.
100100
assert isinstance(harness.model.unit.status, WaitingStatus)

0 commit comments

Comments
 (0)