diff --git a/.github/actions/setup-poetry-env/action.yml b/.github/actions/setup-poetry-env/action.yml index 911b91f0..a7cdeb85 100644 --- a/.github/actions/setup-poetry-env/action.yml +++ b/.github/actions/setup-poetry-env/action.yml @@ -31,4 +31,3 @@ runs: if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction shell: bash - diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7b8aafa2..766a72e0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -56,7 +56,7 @@ jobs: - name: Test with tox run: tox - + - name: Upload coverage reports to Codecov with GitHub Action on Python 3.11 uses: codecov/codecov-action@v3 if: {{ matrix.python-version == '3.11' }} diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index e83b609f..8f4e2344 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -31,4 +31,3 @@ pass_filenames: false stages: [post-checkout, post-merge] always_run: true - diff --git a/.readthedocs.yml b/.readthedocs.yml index b8285a82..72fa860a 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -25,4 +25,3 @@ build: os: ubuntu-latest tools: python: "3.9" - diff --git a/Makefile b/Makefile index ef205728..927e1870 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,9 @@ install: ## Install the poetry environment and install the pre-commit hooks .PHONY: check check: ## Run code quality tools. echo "๐Ÿš€ Checking Poetry lock file consistency with 'pyproject.toml': Running poetry lock --check" - poetry lock --check + poetry check --lock echo "๐Ÿš€ Linting code: Running pre-commit" poetry run pre-commit run -a - echo "๐Ÿš€ Static type checking: Running mypy" - poetry run mypy echo "๐Ÿš€ Checking for obsolete dependencies: Running deptry" poetry run deptry . @@ -66,4 +64,3 @@ coverage: ## check code coverage quickly with the default Python servedocs: docs ## compile the docs watching for changes poetry run watchmedo shell-command -p '*.py;*.rst;*ipynb;*md' -c '$(MAKE) -C docs html' -R -D . - diff --git a/docs/conf.py b/docs/conf.py index d9c7b294..e8369715 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -69,9 +69,9 @@ master_doc = "index" # General information about the project. -project = u"Graph Transliterator" -copyright = u"2020, Michigan State University" -author = u"A. Sean Pue" +project = "Graph Transliterator" +copyright = "2020, Michigan State University" +author = "A. Sean Pue" # The version info for the project you're documenting, acts as replacement # for |version| and |release|, also used in various other places throughout @@ -150,8 +150,8 @@ ( master_doc, "graphtransliterator.tex", - u"Graph Transliterator Documentation", - u"A. Sean Pue", + "Graph Transliterator Documentation", + "A. Sean Pue", "manual", ) ] @@ -165,7 +165,7 @@ ( master_doc, "graphtransliterator", - u"Graph-based Transliterator Documentation", + "Graph-based Transliterator Documentation", [author], 1, ) @@ -181,7 +181,7 @@ ( master_doc, "graphtransliterator", - u"Graph Transliterator Documentation", + "Graph Transliterator Documentation", author, "graphtransliterator", "A graph-based transliteration tool.", diff --git a/graphtransliterator/transliterators/example/example.json b/graphtransliterator/transliterators/example/example.json index ff78ead0..cba00071 100644 --- a/graphtransliterator/transliterators/example/example.json +++ b/graphtransliterator/transliterators/example/example.json @@ -1 +1 @@ -{"graphtransliterator_version":"1.2.0","compressed_settings":[["consonant","vowel","whitespace"],[" ","a","b"],[[2],[1],[0]],[["!B!",[0],[1],[2],[1],[0],-5],["A",0,0,[1],0,0,-1],["B",0,0,[2],0,0,-1],[" ",0,0,[0],0,0,-1]],[" ","whitespace",0],[[[1],[1],","]],{"name":"example","version":"1.0.0","description":"An Example Bundled Transliterator","url":"https://github.com/seanpue/graphtransliterator/tree/master/transliterator/sample","author":"Author McAuthorson","author_email":"author_mcauthorson@msu.edu","license":"MIT License","keywords":["example"],"project_urls":{"Documentation":"https://github.com/seanpue/graphtransliterator/tree/master/graphtransliterator/transliterators/example","Source":"https://github.com/seanpue/graphtransliterator/tree/graphtransliterator/transliterators/example","Tracker":"https://github.com/seanpue/graphtransliterator/issues"}},null]} \ No newline at end of file +{"graphtransliterator_version":"1.2.0","compressed_settings":[["consonant","vowel","whitespace"],[" ","a","b"],[[2],[1],[0]],[["!B!",[0],[1],[2],[1],[0],-5],["A",0,0,[1],0,0,-1],["B",0,0,[2],0,0,-1],[" ",0,0,[0],0,0,-1]],[" ","whitespace",0],[[[1],[1],","]],{"name":"example","version":"1.0.0","description":"An Example Bundled Transliterator","url":"https://github.com/seanpue/graphtransliterator/tree/master/transliterator/sample","author":"Author McAuthorson","author_email":"author_mcauthorson@msu.edu","license":"MIT License","keywords":["example"],"project_urls":{"Documentation":"https://github.com/seanpue/graphtransliterator/tree/master/graphtransliterator/transliterators/example","Source":"https://github.com/seanpue/graphtransliterator/tree/graphtransliterator/transliterators/example","Tracker":"https://github.com/seanpue/graphtransliterator/issues"}},null]} diff --git a/graphtransliterator/transliterators/itrans_devanagari_to_unicode/itrans_devanagari_to_unicode.json b/graphtransliterator/transliterators/itrans_devanagari_to_unicode/itrans_devanagari_to_unicode.json index 198968bc..42193af1 100644 --- a/graphtransliterator/transliterators/itrans_devanagari_to_unicode/itrans_devanagari_to_unicode.json +++ b/graphtransliterator/transliterators/itrans_devanagari_to_unicode/itrans_devanagari_to_unicode.json @@ -1 +1 @@ -{"graphtransliterator_version":"1.2.0","compressed_settings":[["consonant","vowel","vowel_sign","wb","whitespace"],["\t"," ",",",".D",".Dh",".N",".a",".h",".m",".n","0","1","2","3","4","5","6","7","8","9","A","A.c","AUM","Ch","D","Dh","G","GY","H","I","J","K","L","LLI","LLi","L^i","M","N","OM","R","RRI","RRi","R^i","Rs.","Sh","T","Th","U","Y","^e","^n","^o","a","a.c","a.e","aa","ai","au","b","bh","ch","chh","d","dh","dny","e","ee","f","g","gh","h","i","ii","j","jh","j~n","k","kSh","kh","l","ld","m","n","o","p","ph","q","r","s","sh","t","th","u","uu","v","x","y","z","zh","|","||","~N","~Rs.","~n","\u1e45"],[[3,4],[3,4],[3],[0],[0],[2],[3],[3],[2],[2],[3],[3],[3],[3],[3],[3],[3],[3],[3],[3],[1],[1],[3],[0],[0],[0],[0],[0],[3],[1],[0],[0],[0],[1],[1],[1],[2],[0],[3],[0],[1],[1],[1],[3],[0],[0],[0],[1],[0],[1],[0],[1],[1],[1],[2],[1],[1],[1],[0],[0],[0],[0],[0],[0],[0],[1],[1],[0],[0],[0],[0],[1],[1],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[1],[0],[0],[0],[0],[0],[0],[0],[0],[1],[1],[0],[0],[0],[0],[0],[3],[3],[0],[3],[0],[0]],[["\u093e",[0],0,[20],0,0,-2],["\u0949",[0],0,[21],0,0,-2],["\u0940",[0],0,[29],0,0,-2],["\u0963",[0],0,[33],0,0,-2],["\u0962",[0],0,[34],0,0,-2],["\u0962",[0],0,[35],0,0,-2],["\u0944",[0],0,[40],0,0,-2],["\u0943",[0],0,[41],0,0,-2],["\u0943",[0],0,[42],0,0,-2],["\u0942",[0],0,[47],0,0,-2],["\u0946",[0],0,[49],0,0,-2],["\u094a",[0],0,[51],0,0,-2],["",[0],0,[52],0,0,-2],["\u0945",[0],0,[53],0,0,-2],["\u093e",[0],0,[55],0,0,-2],["\u0948",[0],0,[56],0,0,-2],["\u094c",[0],0,[57],0,0,-2],["\u0947",[0],0,[65],0,0,-2],["\u0940",[0],0,[66],0,0,-2],["\u093f",[0],0,[71],0,0,-2],["\u0940",[0],0,[72],0,0,-2],["\u094b",[0],0,[83],0,0,-2],["\u0941",[0],0,[92],0,0,-2],["\u0942",[0],0,[93],0,0,-2],["\t",0,0,[0],0,0,-1],[" ",0,0,[1],0,0,-1],[",",0,0,[2],0,0,-1],["\u095c",0,0,[3],0,0,-1],["\u095d",0,0,[4],0,0,-1],["\u0901",0,0,[5],0,0,-1],["\u093d",0,0,[6],0,0,-1],["\u094d\u200c",0,0,[7],0,0,-1],["\u0902",0,0,[8],0,0,-1],["\u0902",0,0,[9],0,0,-1],["\u0966",0,0,[10],0,0,-1],["\u0967",0,0,[11],0,0,-1],["\u0968",0,0,[12],0,0,-1],["\u0969",0,0,[13],0,0,-1],["\u096a",0,0,[14],0,0,-1],["\u096b",0,0,[15],0,0,-1],["\u096c",0,0,[16],0,0,-1],["\u096d",0,0,[17],0,0,-1],["\u096e",0,0,[18],0,0,-1],["\u096f",0,0,[19],0,0,-1],["\u0906",0,0,[20],0,0,-1],["\u0911",0,0,[21],0,0,-1],["\u0950",0,0,[22],0,0,-1],["\u091b",0,0,[23],0,0,-1],["\u0921",0,0,[24],0,0,-1],["\u0922",0,0,[25],0,0,-1],["\u095a",0,0,[26],0,0,-1],["\u091c\u094d\u091e",0,0,[27],0,0,-1],["\u0903",0,0,[28],0,0,-1],["\u0908",0,0,[29],0,0,-1],["\u095b",0,0,[30],0,0,-1],["\u0959",0,0,[31],0,0,-1],["\u0933",0,0,[32],0,0,-1],["\u0961",0,0,[33],0,0,-1],["\u090c",0,0,[34],0,0,-1],["\u090c",0,0,[35],0,0,-1],["\u0902",0,0,[36],0,0,-1],["\u0923",0,0,[37],0,0,-1],["\u0950",0,0,[38],0,0,-1],["\u0931",0,0,[39],0,0,-1],["\u0960",0,0,[40],0,0,-1],["\u090b",0,0,[41],0,0,-1],["\u090b",0,0,[42],0,0,-1],["\u20b9",0,0,[43],0,0,-1],["\u0937",0,0,[44],0,0,-1],["\u091f",0,0,[45],0,0,-1],["\u0920",0,0,[46],0,0,-1],["\u090a",0,0,[47],0,0,-1],["\u095f",0,0,[48],0,0,-1],["\u090e",0,0,[49],0,0,-1],["\u0929",0,0,[50],0,0,-1],["\u0912",0,0,[51],0,0,-1],["\u0905",0,0,[52],0,0,-1],["\u090d",0,0,[53],0,0,-1],["\u0972",0,0,[54],0,0,-1],["\u0906",0,0,[55],0,0,-1],["\u0910",0,0,[56],0,0,-1],["\u0914",0,0,[57],0,0,-1],["\u092c",0,0,[58],0,0,-1],["\u092d",0,0,[59],0,0,-1],["\u091a",0,0,[60],0,0,-1],["\u091b",0,0,[61],0,0,-1],["\u0926",0,0,[62],0,0,-1],["\u0927",0,0,[63],0,0,-1],["\u091c\u094d\u091e",0,0,[64],0,0,-1],["\u090f",0,0,[65],0,0,-1],["\u0908",0,0,[66],0,0,-1],["\u095e",0,0,[67],0,0,-1],["\u0917",0,0,[68],0,0,-1],["\u0918",0,0,[69],0,0,-1],["\u0939",0,0,[70],0,0,-1],["\u0907",0,0,[71],0,0,-1],["\u0908",0,0,[72],0,0,-1],["\u091c",0,0,[73],0,0,-1],["\u091d",0,0,[74],0,0,-1],["\u091c\u094d\u091e",0,0,[75],0,0,-1],["\u0915",0,0,[76],0,0,-1],["\u0915\u094d\u0937",0,0,[77],0,0,-1],["\u0916",0,0,[78],0,0,-1],["\u0932",0,0,[79],0,0,-1],["\u0933",0,0,[80],0,0,-1],["\u092e",0,0,[81],0,0,-1],["\u0928",0,0,[82],0,0,-1],["\u0913",0,0,[83],0,0,-1],["\u092a",0,0,[84],0,0,-1],["\u092b",0,0,[85],0,0,-1],["\u0958",0,0,[86],0,0,-1],["\u0930",0,0,[87],0,0,-1],["\u0938",0,0,[88],0,0,-1],["\u0936",0,0,[89],0,0,-1],["\u0924",0,0,[90],0,0,-1],["\u0925",0,0,[91],0,0,-1],["\u0909",0,0,[92],0,0,-1],["\u090a",0,0,[93],0,0,-1],["\u0935",0,0,[94],0,0,-1],["\u0915\u094d\u0937",0,0,[95],0,0,-1],["\u092f",0,0,[96],0,0,-1],["\u095b",0,0,[97],0,0,-1],["\u0934",0,0,[98],0,0,-1],["\u0964",0,0,[99],0,0,-1],["\u0965",0,0,[100],0,0,-1],["\u0919",0,0,[101],0,0,-1],["\u20b9",0,0,[102],0,0,-1],["\u091e",0,0,[103],0,0,-1],["\u0919",0,0,[104],0,0,-1]],[" ","whitespace",0],[[[0],[0],"\u094d"]],{"name":"ITRANSDevanagariToUnicode","description":"ITRANS Devanagari to Unicode Transliterator","version":"0.1.0","url":"https://github.com/seanpue/graphtransliterator/tree/graphtransliterator/transliterators/itrans_devanagari_to_unicode","author":"A. Sean Pue","author_email":"pue@msu.edu","license":"MIT","keywords":["devanagari","ITRANS","Hindi","Sanskrit"],"project_urls":{"Documentation":"https://github.com/seanpue/graphtransliterator/tree/master/graphtransliterator/transliterators/itrans_devanagari_to_unicode","Source":"https://github.com/seanpue/graphtransliterator/tree/graphtransliterator/transliterators/itrans_devanagari_to_unicode","Tracker":"https://github.com/seanpue/graphtransliterator/issues"}},null]} \ No newline at end of file +{"graphtransliterator_version":"1.2.0","compressed_settings":[["consonant","vowel","vowel_sign","wb","whitespace"],["\t"," ",",",".D",".Dh",".N",".a",".h",".m",".n","0","1","2","3","4","5","6","7","8","9","A","A.c","AUM","Ch","D","Dh","G","GY","H","I","J","K","L","LLI","LLi","L^i","M","N","OM","R","RRI","RRi","R^i","Rs.","Sh","T","Th","U","Y","^e","^n","^o","a","a.c","a.e","aa","ai","au","b","bh","ch","chh","d","dh","dny","e","ee","f","g","gh","h","i","ii","j","jh","j~n","k","kSh","kh","l","ld","m","n","o","p","ph","q","r","s","sh","t","th","u","uu","v","x","y","z","zh","|","||","~N","~Rs.","~n","\u1e45"],[[3,4],[3,4],[3],[0],[0],[2],[3],[3],[2],[2],[3],[3],[3],[3],[3],[3],[3],[3],[3],[3],[1],[1],[3],[0],[0],[0],[0],[0],[3],[1],[0],[0],[0],[1],[1],[1],[2],[0],[3],[0],[1],[1],[1],[3],[0],[0],[0],[1],[0],[1],[0],[1],[1],[1],[2],[1],[1],[1],[0],[0],[0],[0],[0],[0],[0],[1],[1],[0],[0],[0],[0],[1],[1],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[1],[0],[0],[0],[0],[0],[0],[0],[0],[1],[1],[0],[0],[0],[0],[0],[3],[3],[0],[3],[0],[0]],[["\u093e",[0],0,[20],0,0,-2],["\u0949",[0],0,[21],0,0,-2],["\u0940",[0],0,[29],0,0,-2],["\u0963",[0],0,[33],0,0,-2],["\u0962",[0],0,[34],0,0,-2],["\u0962",[0],0,[35],0,0,-2],["\u0944",[0],0,[40],0,0,-2],["\u0943",[0],0,[41],0,0,-2],["\u0943",[0],0,[42],0,0,-2],["\u0942",[0],0,[47],0,0,-2],["\u0946",[0],0,[49],0,0,-2],["\u094a",[0],0,[51],0,0,-2],["",[0],0,[52],0,0,-2],["\u0945",[0],0,[53],0,0,-2],["\u093e",[0],0,[55],0,0,-2],["\u0948",[0],0,[56],0,0,-2],["\u094c",[0],0,[57],0,0,-2],["\u0947",[0],0,[65],0,0,-2],["\u0940",[0],0,[66],0,0,-2],["\u093f",[0],0,[71],0,0,-2],["\u0940",[0],0,[72],0,0,-2],["\u094b",[0],0,[83],0,0,-2],["\u0941",[0],0,[92],0,0,-2],["\u0942",[0],0,[93],0,0,-2],["\t",0,0,[0],0,0,-1],[" ",0,0,[1],0,0,-1],[",",0,0,[2],0,0,-1],["\u095c",0,0,[3],0,0,-1],["\u095d",0,0,[4],0,0,-1],["\u0901",0,0,[5],0,0,-1],["\u093d",0,0,[6],0,0,-1],["\u094d\u200c",0,0,[7],0,0,-1],["\u0902",0,0,[8],0,0,-1],["\u0902",0,0,[9],0,0,-1],["\u0966",0,0,[10],0,0,-1],["\u0967",0,0,[11],0,0,-1],["\u0968",0,0,[12],0,0,-1],["\u0969",0,0,[13],0,0,-1],["\u096a",0,0,[14],0,0,-1],["\u096b",0,0,[15],0,0,-1],["\u096c",0,0,[16],0,0,-1],["\u096d",0,0,[17],0,0,-1],["\u096e",0,0,[18],0,0,-1],["\u096f",0,0,[19],0,0,-1],["\u0906",0,0,[20],0,0,-1],["\u0911",0,0,[21],0,0,-1],["\u0950",0,0,[22],0,0,-1],["\u091b",0,0,[23],0,0,-1],["\u0921",0,0,[24],0,0,-1],["\u0922",0,0,[25],0,0,-1],["\u095a",0,0,[26],0,0,-1],["\u091c\u094d\u091e",0,0,[27],0,0,-1],["\u0903",0,0,[28],0,0,-1],["\u0908",0,0,[29],0,0,-1],["\u095b",0,0,[30],0,0,-1],["\u0959",0,0,[31],0,0,-1],["\u0933",0,0,[32],0,0,-1],["\u0961",0,0,[33],0,0,-1],["\u090c",0,0,[34],0,0,-1],["\u090c",0,0,[35],0,0,-1],["\u0902",0,0,[36],0,0,-1],["\u0923",0,0,[37],0,0,-1],["\u0950",0,0,[38],0,0,-1],["\u0931",0,0,[39],0,0,-1],["\u0960",0,0,[40],0,0,-1],["\u090b",0,0,[41],0,0,-1],["\u090b",0,0,[42],0,0,-1],["\u20b9",0,0,[43],0,0,-1],["\u0937",0,0,[44],0,0,-1],["\u091f",0,0,[45],0,0,-1],["\u0920",0,0,[46],0,0,-1],["\u090a",0,0,[47],0,0,-1],["\u095f",0,0,[48],0,0,-1],["\u090e",0,0,[49],0,0,-1],["\u0929",0,0,[50],0,0,-1],["\u0912",0,0,[51],0,0,-1],["\u0905",0,0,[52],0,0,-1],["\u090d",0,0,[53],0,0,-1],["\u0972",0,0,[54],0,0,-1],["\u0906",0,0,[55],0,0,-1],["\u0910",0,0,[56],0,0,-1],["\u0914",0,0,[57],0,0,-1],["\u092c",0,0,[58],0,0,-1],["\u092d",0,0,[59],0,0,-1],["\u091a",0,0,[60],0,0,-1],["\u091b",0,0,[61],0,0,-1],["\u0926",0,0,[62],0,0,-1],["\u0927",0,0,[63],0,0,-1],["\u091c\u094d\u091e",0,0,[64],0,0,-1],["\u090f",0,0,[65],0,0,-1],["\u0908",0,0,[66],0,0,-1],["\u095e",0,0,[67],0,0,-1],["\u0917",0,0,[68],0,0,-1],["\u0918",0,0,[69],0,0,-1],["\u0939",0,0,[70],0,0,-1],["\u0907",0,0,[71],0,0,-1],["\u0908",0,0,[72],0,0,-1],["\u091c",0,0,[73],0,0,-1],["\u091d",0,0,[74],0,0,-1],["\u091c\u094d\u091e",0,0,[75],0,0,-1],["\u0915",0,0,[76],0,0,-1],["\u0915\u094d\u0937",0,0,[77],0,0,-1],["\u0916",0,0,[78],0,0,-1],["\u0932",0,0,[79],0,0,-1],["\u0933",0,0,[80],0,0,-1],["\u092e",0,0,[81],0,0,-1],["\u0928",0,0,[82],0,0,-1],["\u0913",0,0,[83],0,0,-1],["\u092a",0,0,[84],0,0,-1],["\u092b",0,0,[85],0,0,-1],["\u0958",0,0,[86],0,0,-1],["\u0930",0,0,[87],0,0,-1],["\u0938",0,0,[88],0,0,-1],["\u0936",0,0,[89],0,0,-1],["\u0924",0,0,[90],0,0,-1],["\u0925",0,0,[91],0,0,-1],["\u0909",0,0,[92],0,0,-1],["\u090a",0,0,[93],0,0,-1],["\u0935",0,0,[94],0,0,-1],["\u0915\u094d\u0937",0,0,[95],0,0,-1],["\u092f",0,0,[96],0,0,-1],["\u095b",0,0,[97],0,0,-1],["\u0934",0,0,[98],0,0,-1],["\u0964",0,0,[99],0,0,-1],["\u0965",0,0,[100],0,0,-1],["\u0919",0,0,[101],0,0,-1],["\u20b9",0,0,[102],0,0,-1],["\u091e",0,0,[103],0,0,-1],["\u0919",0,0,[104],0,0,-1]],[" ","whitespace",0],[[[0],[0],"\u094d"]],{"name":"ITRANSDevanagariToUnicode","description":"ITRANS Devanagari to Unicode Transliterator","version":"0.1.0","url":"https://github.com/seanpue/graphtransliterator/tree/graphtransliterator/transliterators/itrans_devanagari_to_unicode","author":"A. Sean Pue","author_email":"pue@msu.edu","license":"MIT","keywords":["devanagari","ITRANS","Hindi","Sanskrit"],"project_urls":{"Documentation":"https://github.com/seanpue/graphtransliterator/tree/master/graphtransliterator/transliterators/itrans_devanagari_to_unicode","Source":"https://github.com/seanpue/graphtransliterator/tree/graphtransliterator/transliterators/itrans_devanagari_to_unicode","Tracker":"https://github.com/seanpue/graphtransliterator/issues"}},null]} diff --git a/graphtransliterator/transliterators/itrans_devanagari_to_unicode/tests/itrans_devanagari_to_unicode_tests.yaml b/graphtransliterator/transliterators/itrans_devanagari_to_unicode/tests/itrans_devanagari_to_unicode_tests.yaml index 109d199d..94a1976b 100644 --- a/graphtransliterator/transliterators/itrans_devanagari_to_unicode/tests/itrans_devanagari_to_unicode_tests.yaml +++ b/graphtransliterator/transliterators/itrans_devanagari_to_unicode/tests/itrans_devanagari_to_unicode_tests.yaml @@ -128,4 +128,3 @@ zh: เคด ~Rs.: โ‚น ~n: เคž แน…: เค™ - diff --git a/tests/test_ambiguity.py b/tests/test_ambiguity.py index 01fb077a..5b7fbc86 100644 --- a/tests/test_ambiguity.py +++ b/tests/test_ambiguity.py @@ -6,14 +6,15 @@ from graphtransliterator import ( AmbiguousTransliterationRulesException, - GraphTransliterator, TransliterationRule + GraphTransliterator, + TransliterationRule, ) from graphtransliterator.ambiguity import _easyreading_rule import pytest def test_GraphParser_check_ambiguity(): - """ Test for rules that can both match the same thing.""" + """Test for rules that can both match the same thing.""" yaml_for_test = r""" tokens: diff --git a/tests/test_cli.py b/tests/test_cli.py index 9fe7651b..bbec620b 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -14,6 +14,7 @@ import yaml import click + def test_command_line_interface(): """Test the CLI.""" runner = CliRunner() @@ -157,19 +158,23 @@ def test_list_bundled(): assert "Bundled transliterators:" in test_result.output assert "Example" in test_result.output + def test_dump_tests(): runner = CliRunner() - test_result = runner.invoke(cli.main, ["dump-tests", "Example"]) # yaml + test_result = runner.invoke(cli.main, ["dump-tests", "Example"]) # yaml assert "a: A" in test_result.output - test_result = runner.invoke(cli.main, ["dump-tests", "--to", "json", "Example"]) # json + test_result = runner.invoke( + cli.main, ["dump-tests", "--to", "json", "Example"] + ) # json assert '"a": "A"' in test_result.output, test_result.output - test_result = runner.invoke(cli.main, ["dump-tests", "--to", "yaml", "Example"]) # json + test_result = runner.invoke( + cli.main, ["dump-tests", "--to", "yaml", "Example"] + ) # json assert "a: A" in test_result.output + def test_command_line_version(): """Test CLI version.""" runner = CliRunner() version_result = runner.invoke(cli.main, ["--version"]) assert f"{version}" in version_result.output - - diff --git a/tests/test_compression.py b/tests/test_compression.py index b6fb0bae..96244b46 100644 --- a/tests/test_compression.py +++ b/tests/test_compression.py @@ -51,13 +51,12 @@ def test_compression(): decompressed_config = compression.decompress_config(compressed_config) gt_from_decompressed = GraphTransliterator.load(decompressed_config) # Compare JSON dumps with sorted keys. - assert ( - json.dumps(gt.dump(), sort_keys=True) == - json.dumps(gt_from_decompressed.dump(), sort_keys=True) + assert json.dumps(gt.dump(), sort_keys=True) == json.dumps( + gt_from_decompressed.dump(), sort_keys=True ) # Test bad compression level with pytest.raises(ValueError): - gt.dump(compression_level=graphtransliterator.HIGHEST_COMPRESSION_LEVEL+1) + gt.dump(compression_level=graphtransliterator.HIGHEST_COMPRESSION_LEVEL + 1) # Test compression at level 0 (should likely not be called) assert "compressed_settings" not in compression.compress_config( gt.dump(), compression_level=0 @@ -66,7 +65,7 @@ def test_compression(): assert '"tokens": ' in gt.dumps(compression_level=0) assert '"compressed_settings"' in gt.dumps(compression_level=1) assert '"compressed_settings"' in gt.dumps(compression_level=2) - for i in range(0, graphtransliterator.HIGHEST_COMPRESSION_LEVEL+1): + for i in range(0, graphtransliterator.HIGHEST_COMPRESSION_LEVEL + 1): x = gt.dumps(compression_level=i) y = gt.loads(x) assert y.transliterate("a") == "A" diff --git a/tests/test_graphtransliterator.py b/tests/test_graphtransliterator.py index 8afc6f65..85b4bc18 100644 --- a/tests/test_graphtransliterator.py +++ b/tests/test_graphtransliterator.py @@ -412,7 +412,7 @@ def test_serialization(): assert GraphTransliterator.load(settings) # test IncorrectVersionException _ = gt.dump() - _['graphtransliterator_version'] += "1" # add 1 e.g. 1.0.11 + _["graphtransliterator_version"] += "1" # add 1 e.g. 1.0.11 with pytest.raises(IncorrectVersionException): assert GraphTransliterator.load(_)