Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Aug 1, 2024
1 parent 13c6247 commit 0ff1e8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qgispluginci/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def create_archive(
if not Path(f"{parameters.plugin_path}/LICENSE").is_file():
parent_license = Path(f"{parameters.plugin_path}/../LICENSE")
if parent_license.is_file():
shutil.copy(str(parent_license.resolve()), f"{parameters.plugin_path}/LICENSE")
shutil.copy(parent_license, f"{parameters.plugin_path}/LICENSE")
parent_folder_license_copied = True
with tarfile.open(top_tar_file, mode="a") as tt:
tt.add(f"{parameters.plugin_path}/LICENSE")
Expand Down Expand Up @@ -277,8 +277,8 @@ def create_archive(
zf.writestr(info, fl)

if parent_folder_license_copied:
os.remove(f"{parameters.plugin_path}/LICENSE")
Path(f"{parameters.plugin_path}/LICENSE").unlink()

logger.debug("-" * 40)
logger.debug(f"Files in ZIP archive ({archive_name}):")
with zipfile.ZipFile(file=archive_name, mode="r") as zf:
Expand Down
8 changes: 8 additions & 0 deletions test/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def test_release_changelog(self):
# open archive and compare
with ZipFile(archive_name, "r") as zip_file:
data = zip_file.read(f"{parameters.plugin_path}/metadata.txt")
license_data = zip_file.read(f"{parameters.plugin_path}/LICENSE")

# Changelog
self.assertGreater(
Expand All @@ -204,6 +205,13 @@ def test_release_changelog(self):
f"changelog detection failed in release: {data}",
)

# License
self.assertGreater(
data.find(bytes(changelog_lastitems, "utf8")),
0,
"GNU GENERAL PUBLIC LICENSE",
)

# Commit number
self.assertEqual(1, len(re.findall(r"commitNumber=\d+", str(data))))

Expand Down

0 comments on commit 0ff1e8c

Please sign in to comment.