diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a56c328..78352ef6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ on: env: PROJECT_FOLDER: "qgispluginci" - PYTHON_VERSION_RELEASE: "3.8" + PYTHON_VERSION_RELEASE: "3.10" jobs: tests: @@ -29,7 +29,7 @@ jobs: python: [ # Do not make simultaneous tests, transifex and GitHub release will fail # "3.6", - "3.9", + "3.10", ] # "3.10", diff --git a/.gitignore b/.gitignore index 4c03d450..9f44a275 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ build/ dist/ *.egg-info +*.orig + __pycache__/ *.pyc *.tar diff --git a/qgispluginci/translation.py b/qgispluginci/translation.py index 5fc7a1e7..5214e805 100644 --- a/qgispluginci/translation.py +++ b/qgispluginci/translation.py @@ -36,7 +36,9 @@ def __init__( """ self.parameters = parameters self._t = Transifex( - transifex_token, parameters.transifex_organization, i18n_type="QT" + api_token=transifex_token, + organization_name=parameters.transifex_organization, + i18n_type="QT", ) assert self._t.ping() plugin_path = self.parameters.plugin_path @@ -57,7 +59,8 @@ def __init__( f"{self.parameters.transifex_project}" ) self._t.create_project( - slug=self.parameters.transifex_project, + project_slug=self.parameters.transifex_project, + private=False, repository_url=self.parameters.repository_url, source_language_code=parameters.translation_source_language, ) @@ -168,16 +171,19 @@ def pull(self): if lang not in existing_langs: logger.debug(f"Creating missing language: {lang}") self._t.create_language( - self.parameters.transifex_project, - lang, - [self.parameters.transifex_coordinator], + project_slug=self.parameters.transifex_project, + language_code=lang, + coordinators=[self.parameters.transifex_coordinator], ) existing_langs.append(lang) for lang in existing_langs: ts_file = f"{self.parameters.plugin_path}/i18n/{self.parameters.transifex_resource}_{lang}.ts" logger.debug(f"Downloading translation file: {ts_file}") self._t.get_translation( - self.parameters.transifex_project, resource["slug"], lang, ts_file + project_slug=self.parameters.transifex_project, + resource_slug=resource["slug"], + language_code=lang, + path_to_output_file=ts_file, ) def push(self): diff --git a/requirements/base.txt b/requirements/base.txt index 0a8ae4bf..9f4e9bc7 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,5 +6,5 @@ PyGithub>=1.54,<1.58 PyQt5>=5.15,<5.16 pyqt5ac>=1.2,<1.3 python-slugify>=4.0,<8.1 -pytransifex>=0.1.10,<0.2 +pytransifex>=1.1.0,<2.0 pyyaml>=5.4,<6.1