From 91d6f572a5f8e224db225f8c5501952757bed9e3 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 30 Jan 2022 21:34:37 +0100 Subject: [PATCH] scripts: cleanup Signed-off-by: Jens Langhammer --- pyproject.toml | 2 +- scripts/generate_ci_config.py | 12 ++++++++---- scripts/gh_env.py | 5 ++++- scripts/web_api_esm.py | 25 ++++++++++--------------- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 77e405698..de27243cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ pythonPlatform = "Linux" [tool.black] line-length = 100 -target-version = ['py39'] +target-version = ['py310'] exclude = 'node_modules' [tool.isort] diff --git a/scripts/generate_ci_config.py b/scripts/generate_ci_config.py index 6a9613ada..5a0c89ee7 100644 --- a/scripts/generate_ci_config.py +++ b/scripts/generate_ci_config.py @@ -3,7 +3,11 @@ from authentik.lib.generators import generate_id from yaml import safe_dump with open("local.env.yml", "w") as _config: - safe_dump({ - "log_level": "debug", - "secret_key": generate_id(), - }, _config, default_flow_style=False) + safe_dump( + { + "log_level": "debug", + "secret_key": generate_id(), + }, + _config, + default_flow_style=False, + ) diff --git a/scripts/gh_env.py b/scripts/gh_env.py index c121c8538..7917aabe9 100644 --- a/scripts/gh_env.py +++ b/scripts/gh_env.py @@ -13,7 +13,10 @@ if os.environ.get(env_pr_branch, "") != "": should_build = str(os.environ.get("DOCKER_USERNAME", "") != "").lower() print("##[set-output name=branchName]%s" % branch_name) -print("##[set-output name=branchNameContainer]%s" % branch_name.replace("refs/heads/", "").replace("/", "-")) +print( + "##[set-output name=branchNameContainer]%s" + % branch_name.replace("refs/heads/", "").replace("/", "-") +) print("##[set-output name=timestamp]%s" % int(time())) print("##[set-output name=sha]%s" % os.environ[sha]) print("##[set-output name=shouldBuild]%s" % should_build) diff --git a/scripts/web_api_esm.py b/scripts/web_api_esm.py index 5400610d6..f76778067 100644 --- a/scripts/web_api_esm.py +++ b/scripts/web_api_esm.py @@ -2,20 +2,15 @@ from json import loads, dumps TSCONFIG_ESM = { - "compilerOptions": { - "declaration": True, - "target": "es6", - "module": "esnext", - "moduleResolution": "node", - "outDir": "./dist/esm", - "typeRoots": [ - "node_modules/@types" - ] - }, - "exclude": [ - "dist", - "node_modules" - ] + "compilerOptions": { + "declaration": True, + "target": "es6", + "module": "esnext", + "moduleResolution": "node", + "outDir": "./dist/esm", + "typeRoots": ["node_modules/@types"], + }, + "exclude": ["dist", "node_modules"], } @@ -24,7 +19,7 @@ with open("web-api/package.json", encoding="utf-8") as _package: package["license"] = "GPL-3.0-only" package["module"] = "./dist/esm/index.js" package["sideEffects"] = False - package["scripts"]["build"] = "tsc && tsc --project tsconfig.esm.json" + package["scripts"]["build"] = "tsc && tsc --project tsconfig.esm.json" open("web-api/package.json", "w+", encoding="utf-8").write(dumps(package)) open("web-api/tsconfig.esm.json", "w+", encoding="utf-8").write(dumps(TSCONFIG_ESM))