diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 1473b7c9..2aea8b0b 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -30,7 +30,8 @@ jobs: UPLOAD_FILE_NAME: tabcmd.exe OUT_FILE_NAME: tabcmd.exe ASSET_MIME: application/vnd.microsoft.portable-executable - - os: macos-13 + - os: macos-14-large + # This builds for x86 TARGET: macos CMD_BUILD: > pyinstaller tabcmd-mac.spec --clean --noconfirm --distpath ./dist/macos/ @@ -96,7 +97,14 @@ jobs: tar -cvf ${{ matrix.UPLOAD_FILE_NAME }} ${{ matrix.OUT_FILE_NAME }} + - name: Upload build artifact for ${{ matrix.TARGET }} + uses: actions/upload-artifact@v4 + with: + name: tabcmd-${{ matrix.TARGET }} + path: ./dist/${{ matrix.TARGET }}/${{ matrix.UPLOAD_FILE_NAME }} + - name: Upload binaries to release for ${{ matrix.TARGET }} + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/dodo.py b/dodo.py index 3c5d415a..39aae448 100644 --- a/dodo.py +++ b/dodo.py @@ -11,10 +11,22 @@ Usage: pip install -e .[localize] doit list # see available tasks +doit localize # runs all localization tasks in sequence: properties -> po -> mo """ +def task_localize(): + """ + Runs localization pipeline in sequence: + properties -> po -> mo + """ + return { + "actions": [], + "task_dep": ["properties", "po", "mo"], + } + + def task_properties(): """ @@ -252,48 +264,6 @@ def process_locales(): } -def task_clean_all(): - - """remove all generated files such as .po, .out, and pdf, csv etc that are not in the assets folder""" - - def clean_output_files(): - print("todo - delete pdf, csv, .twbx, .hyper etc that have been produced in tests") - - """For all languages: removes all generated intermediate files (properties, po) from the loc build. - all we need to keep are the provided translation.properties files from the monolith, at locales/[current_locale] - and the final tabcmd.mo files in LC_MESSAGES generated by - >doit properties po mo - """ - - def clean_string_files(): - for current_locale in LOCALES: - FILESETS = [ - os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.properties"), - os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.po"), - os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.out"), - ] - for PATH in FILESETS: - for file in glob.glob(PATH): - print("deleting {}".format(os.path.abspath(file))) - try: - os.remove(file) - except OSError: - pass - - STRING_FILES = os.path.join("tabcmd", "locales", "codestrings.*") - for file in glob.glob(STRING_FILES): - print("deleting {}".format(os.path.abspath(file))) - try: - os.remove(file) - except OSError: - pass - - return { - "actions": [clean_string_files, clean_output_files], - "verbosity": 2, - } - - def task_mo(): """ For all languages: Processes the tabcmd.po file to produce a final tabcmd.mo file for each language @@ -418,3 +388,45 @@ def uniquify_file(filename): ) else: print("Saved {} sorted unique lines to {}".format(len(uniques), filename)) + + +def task_clean_all(): + + """remove all generated files such as .po, .out, and pdf, csv etc that are not in the assets folder""" + + def clean_output_files(): + print("todo - delete pdf, csv, .twbx, .hyper etc that have been produced in tests") + + """For all languages: removes all generated intermediate files (properties, po) from the loc build. + all we need to keep are the provided translation.properties files from the monolith, at locales/[current_locale] + and the final tabcmd.mo files in LC_MESSAGES generated by + >doit properties po mo + """ + + def clean_string_files(): + for current_locale in LOCALES: + FILESETS = [ + os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.properties"), + os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.po"), + os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.out"), + ] + for PATH in FILESETS: + for file in glob.glob(PATH): + print("deleting {}".format(os.path.abspath(file))) + try: + os.remove(file) + except OSError: + pass + + STRING_FILES = os.path.join("tabcmd", "locales", "codestrings.*") + for file in glob.glob(STRING_FILES): + print("deleting {}".format(os.path.abspath(file))) + try: + os.remove(file) + except OSError: + pass + + return { + "actions": [clean_string_files, clean_output_files], + "verbosity": 2, + } diff --git a/pyproject.toml b/pyproject.toml index 4f3f3fcd..3591b042 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ tabcmd = ["tabcmd.locales/**/*.mo"] [tool.black] line-length = 120 required-version = 22 -target-version = ['py39', 'py310', 'py311'] +target-version = ['py310', 'py311'] extend-exclude = '^/bin/*' [tool.mypy] disable_error_code = [ @@ -65,7 +65,7 @@ test = [ "types-setuptools" ] localize = ["doit", "ftfy"] -package = ["doit", "pyinstaller==5.13.1"] +package = ["doit", "pyinstaller==5.13.1", "setuptools==81"] versioning = [ "doit", "pyinstaller_versionfile", diff --git a/tabcmd/locales/de/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/de/LC_MESSAGES/tabcmd.mo index a3ff4efb..cac49e59 100644 Binary files a/tabcmd/locales/de/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/de/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/en/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/en/LC_MESSAGES/tabcmd.mo index da3c8a93..6bc6de81 100644 Binary files a/tabcmd/locales/en/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/en/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/es/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/es/LC_MESSAGES/tabcmd.mo index 54238325..db1cd9b8 100644 Binary files a/tabcmd/locales/es/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/es/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo index 98c4eefa..70813c35 100644 Binary files a/tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo index 76c30162..ecc45de2 100644 Binary files a/tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/it/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/it/LC_MESSAGES/tabcmd.mo index 0c894412..50a2e9f7 100644 Binary files a/tabcmd/locales/it/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/it/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo index 7a6a49d7..ce6b79fa 100644 Binary files a/tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo index 1ee885f8..0b1ea7d1 100644 Binary files a/tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo index 13bbb74c..fa709d8a 100644 Binary files a/tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo index d5407d57..e329a6a8 100644 Binary files a/tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo index f249c077..3c252067 100644 Binary files a/tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo differ