Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions plugin-template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import os
import pprint
import shlex
import shutil
import subprocess
import sys
import textwrap
from pathlib import Path
Expand Down Expand Up @@ -97,6 +96,7 @@ DEPRECATED_FILES = {
".ci/scripts/update_github.sh",
".ci/scripts/update_redmine.sh",
".ci/scripts/upper_bound.py",
".github/template_gitref",
".github/workflows/kanban.yml",
".github/workflows/changelog.yml",
".github/workflows/fips.yml",
Expand Down Expand Up @@ -335,14 +335,8 @@ def write_template_section(config, name, plugin_root_dir, verbose=False):
files_templated = 0
files_copied = 0

try:
gitref = subprocess.check_output(["git", "describe", "--dirty"]).decode().strip()
except Exception:
gitref = "unknown"

template_vars = {
"section": name,
"gitref": gitref,
"setup_py": (plugin_root_path / "setup.py").exists(),
"ci_update_branches": utils.ci_update_branches(config),
"python_version": "3.11",
Expand Down
6 changes: 0 additions & 6 deletions scripts/update_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ pip install -r requirements.txt
./plugin-template --github "${docs[@]}" "${plugin_name}"
popd

# Check if only gitref file has changed, so no effect on CI workflows.
if [ -z "$(git diff --name-only | grep -v "template_gitref")" ]; then
echo "No changes detected."
git ls-files | grep template_gitref | xargs git restore
fi

if [[ $(git status --porcelain) ]]; then
git add -A
git commit -m "Update CI files"
Expand Down
2 changes: 1 addition & 1 deletion templates/generate_config/template_config.yml.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This config represents the latest values used when running the plugin-template. Any settings that
# were not present before running plugin-template have been added with their default values.

# generated with plugin_template@{{ gitref }}
# generated with plugin_template

{{ config | to_yaml }}
1 change: 0 additions & 1 deletion templates/github/.github/template_gitref.j2

This file was deleted.

5 changes: 4 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,7 @@ def merge_toml(template, plugin_root_path, relative_path, template_vars):
old_toml[merge_key] = data[merge_key]
else:
old_toml[merge_key].update(data[merge_key])
tomlkit.dump(old_toml, path.open("w"))
output = tomlkit.dumps(old_toml)
if output[-1] != "\n":
output = output + "\n"
path.write_text(output)