Skip to content

Commit 82494c9

Browse files
authored
v2.0.19 Localization and packaging update (#391)
2 parents ef4be6b + 65a99ce commit 82494c9

14 files changed

Lines changed: 65 additions & 45 deletions

File tree

.github/workflows/package.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ jobs:
3030
UPLOAD_FILE_NAME: tabcmd.exe
3131
OUT_FILE_NAME: tabcmd.exe
3232
ASSET_MIME: application/vnd.microsoft.portable-executable
33-
- os: macos-13
33+
- os: macos-14-large
34+
# This builds for x86
3435
TARGET: macos
3536
CMD_BUILD: >
3637
pyinstaller tabcmd-mac.spec --clean --noconfirm --distpath ./dist/macos/
@@ -96,7 +97,14 @@ jobs:
9697
tar -cvf ${{ matrix.UPLOAD_FILE_NAME }} ${{ matrix.OUT_FILE_NAME }}
9798
9899
100+
- name: Upload build artifact for ${{ matrix.TARGET }}
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: tabcmd-${{ matrix.TARGET }}
104+
path: ./dist/${{ matrix.TARGET }}/${{ matrix.UPLOAD_FILE_NAME }}
105+
99106
- name: Upload binaries to release for ${{ matrix.TARGET }}
107+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
100108
uses: svenstaro/upload-release-action@v2
101109
with:
102110
repo_token: ${{ secrets.GITHUB_TOKEN }}

dodo.py

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,22 @@
1111
Usage:
1212
pip install -e .[localize]
1313
doit list # see available tasks
14+
doit localize # runs all localization tasks in sequence: properties -> po -> mo
1415
1516
"""
1617

1718

19+
def task_localize():
20+
"""
21+
Runs localization pipeline in sequence:
22+
properties -> po -> mo
23+
"""
24+
return {
25+
"actions": [],
26+
"task_dep": ["properties", "po", "mo"],
27+
}
28+
29+
1830
def task_properties():
1931

2032
"""
@@ -252,48 +264,6 @@ def process_locales():
252264
}
253265

254266

255-
def task_clean_all():
256-
257-
"""remove all generated files such as .po, .out, and pdf, csv etc that are not in the assets folder"""
258-
259-
def clean_output_files():
260-
print("todo - delete pdf, csv, .twbx, .hyper etc that have been produced in tests")
261-
262-
"""For all languages: removes all generated intermediate files (properties, po) from the loc build.
263-
all we need to keep are the provided translation.properties files from the monolith, at locales/[current_locale]
264-
and the final tabcmd.mo files in LC_MESSAGES generated by
265-
>doit properties po mo
266-
"""
267-
268-
def clean_string_files():
269-
for current_locale in LOCALES:
270-
FILESETS = [
271-
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.properties"),
272-
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.po"),
273-
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.out"),
274-
]
275-
for PATH in FILESETS:
276-
for file in glob.glob(PATH):
277-
print("deleting {}".format(os.path.abspath(file)))
278-
try:
279-
os.remove(file)
280-
except OSError:
281-
pass
282-
283-
STRING_FILES = os.path.join("tabcmd", "locales", "codestrings.*")
284-
for file in glob.glob(STRING_FILES):
285-
print("deleting {}".format(os.path.abspath(file)))
286-
try:
287-
os.remove(file)
288-
except OSError:
289-
pass
290-
291-
return {
292-
"actions": [clean_string_files, clean_output_files],
293-
"verbosity": 2,
294-
}
295-
296-
297267
def task_mo():
298268
"""
299269
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):
418388
)
419389
else:
420390
print("Saved {} sorted unique lines to {}".format(len(uniques), filename))
391+
392+
393+
def task_clean_all():
394+
395+
"""remove all generated files such as .po, .out, and pdf, csv etc that are not in the assets folder"""
396+
397+
def clean_output_files():
398+
print("todo - delete pdf, csv, .twbx, .hyper etc that have been produced in tests")
399+
400+
"""For all languages: removes all generated intermediate files (properties, po) from the loc build.
401+
all we need to keep are the provided translation.properties files from the monolith, at locales/[current_locale]
402+
and the final tabcmd.mo files in LC_MESSAGES generated by
403+
>doit properties po mo
404+
"""
405+
406+
def clean_string_files():
407+
for current_locale in LOCALES:
408+
FILESETS = [
409+
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.properties"),
410+
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.po"),
411+
os.path.join("tabcmd", "locales", current_locale, "LC_MESSAGES", "*.out"),
412+
]
413+
for PATH in FILESETS:
414+
for file in glob.glob(PATH):
415+
print("deleting {}".format(os.path.abspath(file)))
416+
try:
417+
os.remove(file)
418+
except OSError:
419+
pass
420+
421+
STRING_FILES = os.path.join("tabcmd", "locales", "codestrings.*")
422+
for file in glob.glob(STRING_FILES):
423+
print("deleting {}".format(os.path.abspath(file)))
424+
try:
425+
os.remove(file)
426+
except OSError:
427+
pass
428+
429+
return {
430+
"actions": [clean_string_files, clean_output_files],
431+
"verbosity": 2,
432+
}

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tabcmd = ["tabcmd.locales/**/*.mo"]
1010
[tool.black]
1111
line-length = 120
1212
required-version = 22
13-
target-version = ['py39', 'py310', 'py311']
13+
target-version = ['py310', 'py311']
1414
extend-exclude = '^/bin/*'
1515
[tool.mypy]
1616
disable_error_code = [
@@ -65,7 +65,7 @@ test = [
6565
"types-setuptools"
6666
]
6767
localize = ["doit", "ftfy"]
68-
package = ["doit", "pyinstaller==5.13.1"]
68+
package = ["doit", "pyinstaller==5.13.1", "setuptools==81"]
6969
versioning = [
7070
"doit",
7171
"pyinstaller_versionfile",
6.71 KB
Binary file not shown.
8.92 KB
Binary file not shown.
6.59 KB
Binary file not shown.
6.79 KB
Binary file not shown.
6.34 KB
Binary file not shown.
6.63 KB
Binary file not shown.
7.35 KB
Binary file not shown.

0 commit comments

Comments
 (0)