Merge ~cjwatson/launchpad-layers:turnip-still-py36 into launchpad-layers:main

Proposed by Colin Watson
Status: Merged
Merged at revision: 466a8348106b0a14e4c1cf18fbafe13d1f927bad
Proposed branch: ~cjwatson/launchpad-layers:turnip-still-py36
Merge into: launchpad-layers:main
Diff against target: 32 lines (+8/-1)
2 files modified
.pre-commit-config.yaml (+7/-0)
turnip-base/lib/charms/turnip/base.py (+1/-1)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+445371@code.launchpad.net

Commit message

Restore Python 3.6 compatibility in turnip-base

Description of the change

turnip is still deployed on bionic, so its layers need to retain compatibility with Python 3.6 for now.

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve
Revision history for this message
Colin Watson (cjwatson) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
2index 85f5926..9c2d3bc 100644
3--- a/.pre-commit-config.yaml
4+++ b/.pre-commit-config.yaml
5@@ -15,7 +15,14 @@ repos:
6 rev: v3.3.1
7 hooks:
8 - id: pyupgrade
9+ name: pyupgrade (--py38-plus)
10 args: [--py38-plus]
11+ exclude: ^turnip
12+ - id: pyupgrade
13+ alias: pyupgrade-py36
14+ name: pyupgrade (--py36-plus)
15+ args: [--py36-plus]
16+ files: ^turnip
17 - repo: https://github.com/psf/black
18 rev: 22.12.0
19 hooks:
20diff --git a/turnip-base/lib/charms/turnip/base.py b/turnip-base/lib/charms/turnip/base.py
21index 06e5272..7eb96c6 100644
22--- a/turnip-base/lib/charms/turnip/base.py
23+++ b/turnip-base/lib/charms/turnip/base.py
24@@ -47,7 +47,7 @@ def run_dir():
25 def data_mount_unit():
26 return (
27 subprocess.check_output(
28- ["systemd-escape", "--path", data_dir()], text=True
29+ ["systemd-escape", "--path", data_dir()], universal_newlines=True
30 ).rstrip("\n")
31 + ".mount"
32 )

Subscribers

People subscribed via source and target branches