summaryrefslogtreecommitdiffstats
path: root/release/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'release/util.py')
-rw-r--r--release/util.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/release/util.py b/release/util.py
index c839b872..8596324f 100644
--- a/release/util.py
+++ b/release/util.py
@@ -14,7 +14,7 @@
14 14
15"""Random utility code for release tools.""" 15"""Random utility code for release tools."""
16 16
17import os 17from pathlib import Path
18import re 18import re
19import shlex 19import shlex
20import subprocess 20import subprocess
@@ -24,8 +24,9 @@ import sys
24assert sys.version_info >= (3, 6), "This module requires Python 3.6+" 24assert sys.version_info >= (3, 6), "This module requires Python 3.6+"
25 25
26 26
27TOPDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 27THIS_FILE = Path(__file__).resolve()
28HOMEDIR = os.path.expanduser("~") 28TOPDIR = THIS_FILE.parent.parent
29HOMEDIR = Path("~").expanduser()
29 30
30 31
31# These are the release keys we sign with. 32# These are the release keys we sign with.
@@ -54,7 +55,7 @@ def run(opts, cmd, check=True, **kwargs):
54def import_release_key(opts): 55def import_release_key(opts):
55 """Import the public key of the official release repo signing key.""" 56 """Import the public key of the official release repo signing key."""
56 # Extract the key from our repo launcher. 57 # Extract the key from our repo launcher.
57 launcher = getattr(opts, "launcher", os.path.join(TOPDIR, "repo")) 58 launcher = getattr(opts, "launcher", TOPDIR / "repo")
58 print(f'Importing keys from "{launcher}" launcher script') 59 print(f'Importing keys from "{launcher}" launcher script')
59 with open(launcher, encoding="utf-8") as fp: 60 with open(launcher, encoding="utf-8") as fp:
60 data = fp.read() 61 data = fp.read()