Skip to content

Commit

Permalink
Merge test (#125)
Browse files Browse the repository at this point in the history
* Yiddish transliteration via submodules.

* Update checkout workflow.

* Change refs for Yiddish submodules.

* Fix WORKDIR in Dockerfile

* Do not remove yiddish module.

* Manually add yiddish submodules.

* Use git clone instead of submodule.

* Move ext checkout to github actions.

* Chinese numerals (#97)

* WIP Parse Chinese numerals.

* WIP complete number parsing.

* Complete Chinese numerals:

* Use standard table override instead of pre-config hooks.
* Add few test strings.

* Complete numerals:

* Transliterate all numeric examples correctly
* Modify hook return logic for consistency
* WIP partial spacing fix.

* Some cleanup; upgrade docker OS.

* Add dependency for uwsgi.

* Squashed commit of the following: (#98)

commit 30859a5
Author: scossu <[email protected]>
Date:   Wed Feb 28 22:17:36 2024 -0500

    Move ext checkout to github actions.

commit 6d8da6d
Author: scossu <[email protected]>
Date:   Wed Feb 28 21:45:01 2024 -0500

    Use git clone instead of submodule.

commit ade9da5
Author: scossu <[email protected]>
Date:   Wed Feb 28 21:42:45 2024 -0500

    Manually add yiddish submodules.

commit 77cb9ef
Author: scossu <[email protected]>
Date:   Wed Feb 28 21:23:37 2024 -0500

    Do not remove yiddish module.

commit e405b36
Author: scossu <[email protected]>
Date:   Wed Feb 28 09:11:41 2024 -0500

    Fix WORKDIR in Dockerfile

commit 95445ba
Author: scossu <[email protected]>
Date:   Wed Feb 28 09:07:50 2024 -0500

    Change refs for Yiddish submodules.

commit 208ea09
Author: scossu <[email protected]>
Date:   Wed Feb 28 08:45:58 2024 -0500

    Update checkout workflow.

* Add debug output to /trans response.

* Split docker files and requirements.

* Add bad request debug handler.

* Adjust CI workflows.

* Fix image name typo.

* Refine triggers.

* Fix typo on test workflow trigger.

* Use JSON in POST body.

* Also use JSON in feedback request; update docs.

* Return json data in 400 debug.

* Update Aksharamukha.

* Add new set of languages; separate pre and post options in Aksharamukha. (#102)

* Add all remaining Devanagari scripts. (#107)

* Add R2S for Kurdish, Persian, Pushto, Urdu, and bidirectional Divehi.

* Add R2S for Kurdish, Persian, Pushto, Urdu, and bidirectional Divehi. (#108)

* Fix YAML syntax errors.

* P3 legacy mappings (#109)

* Add R2S for Kurdish, Persian, Pushto, Urdu, and bidirectional Divehi.

* Fix YAML syntax errors.

* Fix table section for Divehi.

* P3 legacy mappings (#110)

* Add R2S for Kurdish, Persian, Pushto, Urdu, and bidirectional Divehi.

* Fix YAML syntax errors.

* Fix table section for Divehi.

* Fix mapping for Divehi.

* Add Thai from Randy's table

* Fix YAML errors in Thai alt.

* Fix Tamil YAML.

* Fix Malayalam config.

* Fix Greek numerals logic; add test strings.

* Add Malayalam to index.

* Better exception handling.

* Add CORS to all routes.

* Add MARC codes to language index.

* Fix Greek S2R table.

* Tolerate and normalize nested tokens.

* Add Assamese table.

* Fix char index misalignment after ignoring.

* Yiddish (#123)

* Use yiddish package from pypi; add loshn_koydesh override.

* Remove yiddish submodule update from build automation.

* Add lk override path to example.env.

* Fix some CI issues.

* Test CI.

* test.

* Add git fetch --tags.

* Fix syntax.

* Add --always.

* Mirror config updates in push-app-image action.

* Add git info to home page.
  • Loading branch information
scossu authored Aug 14, 2024
1 parent 0f81dd1 commit ed5877f
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 7 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/push-app-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
tags:
- "v*.*.[1-9]*"
workflow_run:
workflows:
workflows:
- "Push base image"
types:
- "completed"
Expand All @@ -25,6 +25,12 @@ jobs:
with:
submodules: recursive

- name: update version info
run: |
git fetch --tags
git describe --tags --always >| VERSION
git rev-parse HEAD >> VERSION
- name: Build the Docker image
run: >
docker build -f Dockerfile .
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/push-test-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
with:
submodules: recursive

- name: update version info
run: |
git fetch --tags
git describe --tags --always >| VERSION
git rev-parse HEAD >> VERSION
- name: Build the Docker image
run: >
docker build -f Dockerfile .
Expand All @@ -32,4 +38,3 @@ jobs:

- name: Push to Docker Hub
run: docker push $DOCKER_USER/$REPO_NAME:test

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,4 @@ tags.temp
# Local
ext/arabic_rom/data
!.keep
VERSION
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG WORKROOT "/usr/local/scriptshifter/src"

# Copy core application files.
WORKDIR ${WORKROOT}
COPY entrypoint.sh uwsgi.ini wsgi.py ./
COPY entrypoint.sh uwsgi.ini wsgi.py VERSION ./
COPY scriptshifter ./scriptshifter/
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
Expand Down
4 changes: 1 addition & 3 deletions deps.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# External dependencies.
aksharamukha>=2.2,<3
# Base image dependencies.
camel-tools>=1.5
funcy>=1.15,<2
pymarc>=4.0,<5
repackage>=0.7.3
./ext/yiddish
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Core application dependencies.
aksharamukha>=2.2,<3
flask>=2.3,<3
flask-cors>=4.0,<5
python-dotenv>=1.0,<2
Expand Down
5 changes: 5 additions & 0 deletions scriptshifter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
"""
SMTP_HOST = environ.get("TXL_SMTP_HOST")

with open(path.join(path.dirname(APP_ROOT), "VERSION")) as fh:
version_info = fh.readlines()
GIT_TAG = version_info[0].strip()
GIT_COMMIT = version_info[1].strip()

logging.basicConfig(
# filename=environ.get("TXL_LOGFILE", "/dev/stdout"),
level=environ.get("TXL_LOGLEVEL", logging.WARN))
Expand Down
6 changes: 5 additions & 1 deletion scriptshifter/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
from flask import Flask, jsonify, render_template, request
from flask_cors import CORS

from scriptshifter import EMAIL_FROM, EMAIL_TO, SMTP_HOST, SMTP_PORT
from scriptshifter import (
EMAIL_FROM, EMAIL_TO,
GIT_COMMIT, GIT_TAG,
SMTP_HOST, SMTP_PORT)
from scriptshifter.exceptions import ApiError
from scriptshifter.tables import list_tables, load_table
from scriptshifter.trans import transliterate
Expand Down Expand Up @@ -69,6 +72,7 @@ def index():
return render_template(
"index.html",
languages=list_tables(),
version_info=(GIT_TAG, GIT_COMMIT),
feedback_form=SMTP_HOST is not None)


Expand Down
4 changes: 4 additions & 0 deletions scriptshifter/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ <h1 class="title is-1">{{ title }}</h1>
</div>
</section>
</main>
<footer>
<p>Scriptshifter version: tag {{ version_info[0] }} &mdash;&nbsp;
commit # {{ version_info[1] }}</p>
</footer>
</body>
</html>

0 comments on commit ed5877f

Please sign in to comment.