From 30ea05f1ce5a659d787a6af7a0f3ab9d48d1587b Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 23 Feb 2024 15:51:21 +0100 Subject: [PATCH] fix usage with empty TX token (#287) --- qgispluginci/release.py | 6 +++--- test/test_release.py | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/qgispluginci/release.py b/qgispluginci/release.py index 23546cd9..f916659f 100644 --- a/qgispluginci/release.py +++ b/qgispluginci/release.py @@ -11,7 +11,7 @@ from glob import glob from pathlib import Path from tempfile import mkstemp -from typing import List +from typing import List, Tuple import git from github import Github, GithubException @@ -55,7 +55,7 @@ def create_archive( is_prerelease: bool = False, raise_min_version: str = None, disable_submodule_update: bool = False, - asset_paths: List[str] = [], + asset_paths: Tuple[str] = (), ): repo = git.Repo() @@ -563,7 +563,7 @@ def release( parameters, release_version, archive_name, - add_translations=tx_api_token is not None, + add_translations=bool(tx_api_token), allow_uncommitted_changes=allow_uncommitted_changes, is_prerelease=is_prerelease, disable_submodule_update=disable_submodule_update, diff --git a/test/test_release.py b/test/test_release.py index ceec0547..d06b3178 100755 --- a/test/test_release.py +++ b/test/test_release.py @@ -82,6 +82,13 @@ def test_release_from_pyproject(self): print(self.pyproject_params) release(self.pyproject_params, RELEASE_VERSION_TEST) + def test_release_with_empty_tx_token(self): + release( + self.qgis_plugin_config_params, + RELEASE_VERSION_TEST, + tx_api_token="", + ) + @unittest.skipIf(can_skip_test(), "Missing tx_api_token") def test_release_with_transifex(self): Translation(self.qgis_plugin_config_params, tx_api_token=self.tx_api_token)