1
0
mirror of https://github.com/google/fonts.git synced 2024-12-17 13:41:32 +03:00
fonts/lang/tox.ini

66 lines
1.6 KiB
INI
Raw Normal View History

Initial implementation of the `languages` module. This python module provides an API with data about languages/regions/scripts for use in the language-support categorization of the font families in the Google Fonts collection. You can also directly access the raw **textproto** files on the `Lib/languages/data` directory: * [`languages`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/languages) * [`regions`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/regions) * [`scripts`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/scripts) Most of the code in this project was copied from the `gftools` repository (https://github.com/googlefonts/gftools/) so that language/region/script data can be easily available to all our tools without having to also get the large dependency tree of `gftools`. The most immediate user of this module is `Font Bakery`, which needs to validate language support on font binaries being checked. (see https://github.com/googlefonts/fontbakery/issues/3605) The second obvious user of this `languages` module will be `gftools` itself. I'll be sending a pull request soon. Language/region/script definitions are still being gradualy updated on the `google/fonts` repo, on its **lang/** directory (https://github.com/google/fonts/tree/main/lang) and this `languages` module will try to be kept in sync. Ideally at some point this module would become the main place to update these definitions, avoiding data duplication and guaranteeing uniformity across tools. But that will require coordination with the Google Fonts team, so I hope this module can serve, for now, as a prototype for such proposed integration.
2022-02-16 10:49:46 +03:00
[tox]
envlist = py37, py38, py39, coverage, flake8, pylint
[gh-actions]
python =
3.7: py37, coverage, flake8, pylint
3.8: py38, coverage, flake8, pylint
3.9: py39, coverage, flake8, pylint
[testenv]
deps =
pytest
coverage
-rrequirements.txt
commands = coverage run -m pytest {posargs}
passenv = LD_LIBRARY_PATH LD_PRELOAD
[testenv:coverage]
deps = coverage
skip_install = true
commands =
coverage report
coverage html
# Exclude a lot of tests here without turning them off in setup.cfg, because a
# developer might want to see and fix them. This is more of a regression test.
[testenv:flake8]
deps =
flake8
sphinx
sphinx_rtd_theme
recommonmark
commands = flake8 --count --show-source --statistics
# Same rationale as with flake8.
[testenv:pylint]
deps =
pylint
sphinx
sphinx_rtd_theme
recommonmark
wont_fix = invalid-name,protected-access,too-many-lines
maybe_someday = fixme,missing-docstring,line-too-long
commands = pylint --disable={[testenv:pylint]wont_fix},{[testenv:pylint]maybe_someday} Lib/gflanguages
Initial implementation of the `languages` module. This python module provides an API with data about languages/regions/scripts for use in the language-support categorization of the font families in the Google Fonts collection. You can also directly access the raw **textproto** files on the `Lib/languages/data` directory: * [`languages`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/languages) * [`regions`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/regions) * [`scripts`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/scripts) Most of the code in this project was copied from the `gftools` repository (https://github.com/googlefonts/gftools/) so that language/region/script data can be easily available to all our tools without having to also get the large dependency tree of `gftools`. The most immediate user of this module is `Font Bakery`, which needs to validate language support on font binaries being checked. (see https://github.com/googlefonts/fontbakery/issues/3605) The second obvious user of this `languages` module will be `gftools` itself. I'll be sending a pull request soon. Language/region/script definitions are still being gradualy updated on the `google/fonts` repo, on its **lang/** directory (https://github.com/google/fonts/tree/main/lang) and this `languages` module will try to be kept in sync. Ideally at some point this module would become the main place to update these definitions, avoiding data duplication and guaranteeing uniformity across tools. But that will require coordination with the Google Fonts team, so I hope this module can serve, for now, as a prototype for such proposed integration.
2022-02-16 10:49:46 +03:00
[flake8]
select = E,F,W
exclude =
# Exclude the entire build directory:
build
# Exclude these auto-generated files that should not be hand-edited:
Lib/gflanguages/languages_public_pb2.py,
Initial implementation of the `languages` module. This python module provides an API with data about languages/regions/scripts for use in the language-support categorization of the font families in the Google Fonts collection. You can also directly access the raw **textproto** files on the `Lib/languages/data` directory: * [`languages`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/languages) * [`regions`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/regions) * [`scripts`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/scripts) Most of the code in this project was copied from the `gftools` repository (https://github.com/googlefonts/gftools/) so that language/region/script data can be easily available to all our tools without having to also get the large dependency tree of `gftools`. The most immediate user of this module is `Font Bakery`, which needs to validate language support on font binaries being checked. (see https://github.com/googlefonts/fontbakery/issues/3605) The second obvious user of this `languages` module will be `gftools` itself. I'll be sending a pull request soon. Language/region/script definitions are still being gradualy updated on the `google/fonts` repo, on its **lang/** directory (https://github.com/google/fonts/tree/main/lang) and this `languages` module will try to be kept in sync. Ideally at some point this module would become the main place to update these definitions, avoiding data duplication and guaranteeing uniformity across tools. But that will require coordination with the Google Fonts team, so I hope this module can serve, for now, as a prototype for such proposed integration.
2022-02-16 10:49:46 +03:00
# No need to traverse hidden directories such as .git, .tox
.*,
# Exclude virtual environment directory:
venv*,
# There's no value in checking cache directories
__pycache__,
# The Sphinx configuration file is mostly autogenerated, ignore it
docs/source/conf.py,
max-line-length=100
Initial implementation of the `languages` module. This python module provides an API with data about languages/regions/scripts for use in the language-support categorization of the font families in the Google Fonts collection. You can also directly access the raw **textproto** files on the `Lib/languages/data` directory: * [`languages`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/languages) * [`regions`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/regions) * [`scripts`](https://github.com/felipesanches/languages/tree/main/Lib/languages/data/scripts) Most of the code in this project was copied from the `gftools` repository (https://github.com/googlefonts/gftools/) so that language/region/script data can be easily available to all our tools without having to also get the large dependency tree of `gftools`. The most immediate user of this module is `Font Bakery`, which needs to validate language support on font binaries being checked. (see https://github.com/googlefonts/fontbakery/issues/3605) The second obvious user of this `languages` module will be `gftools` itself. I'll be sending a pull request soon. Language/region/script definitions are still being gradualy updated on the `google/fonts` repo, on its **lang/** directory (https://github.com/google/fonts/tree/main/lang) and this `languages` module will try to be kept in sync. Ideally at some point this module would become the main place to update these definitions, avoiding data duplication and guaranteeing uniformity across tools. But that will require coordination with the Google Fonts team, so I hope this module can serve, for now, as a prototype for such proposed integration.
2022-02-16 10:49:46 +03:00
ignore =
E126, # continuation line over-indented for hanging indent