Skip to content

Commit

Permalink
Rename module to gflanguages
Browse files Browse the repository at this point in the history
as there was already a `languages` python module on PyPI
(fonttools/fontbakery#3605 (comment))
  • Loading branch information
felipesanches committed Feb 16, 2022
1 parent 08cec65 commit 531c5ec
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.eggs/*
*.egg-info
*__pycache__
Lib/languages/_version.py
Lib/gflanguages/_version.py
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Below are the most important changes from each release.

## 0.1.0 (2022-Feb-16)
### Release notes
- Initial release of the `languages` python module.
- Initial release of the `gflanguages` python module.
- Most of the code 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.
- The second obvious user of this `gflanguages` 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 `gflanguages` 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.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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)
You can also directly access the raw **textproto** files on the `Lib/gflanguages/data` directory:
* [`languages`](https://github.com/felipesanches/gflanguages/tree/main/Lib/gflanguages/data/languages)
* [`regions`](https://github.com/felipesanches/gflanguages/tree/main/Lib/gflanguages/data/regions)
* [`scripts`](https://github.com/felipesanches/gflanguages/tree/main/Lib/gflanguages/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.
The second obvious user of this `gflanguages` 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.
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 `gflanguages` 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.
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
long_description = f.read()

setup(
name="languages",
use_scm_version={"write_to": "Lib/languages/_version.py"},
url='https://github.com/felipesanches/languages/',
name="gflanguages",
use_scm_version={"write_to": "Lib/gflanguages/_version.py"},
url='https://github.com/felipesanches/gflanguages/',
description='A python API for evaluating language support in the Google Fonts collection.',
long_description=long_description,
long_description_content_type='text/markdown', # This is important!
Expand All @@ -35,8 +35,8 @@
'Roderick Sheeter'),
author_email='dave@lab6.com',
package_dir={'': 'Lib'},
packages=['languages'],
package_data={'languages': [
packages=['gflanguages'],
package_data={'gflanguages': [
"data/languages/*.textproto",
"data/regions/*.textproto",
"data/scripts/*.textproto"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_languages_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import pytest
from languages import lang_support
from gflanguages import lang_support

def portable_path(p):
return os.path.join(*p.split('/'))
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ deps =
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/languages
commands = pylint --disable={[testenv:pylint]wont_fix},{[testenv:pylint]maybe_someday} Lib/gflanguages

[flake8]
select = E,F,W
Expand All @@ -50,7 +50,7 @@ exclude =
# Exclude the entire build directory:
build
# Exclude these auto-generated files that should not be hand-edited:
Lib/languages/fonts_public_pb2.py,
Lib/gflanguages/fonts_public_pb2.py,
# No need to traverse hidden directories such as .git, .tox
.*,
# Exclude virtual environment directory:
Expand All @@ -62,7 +62,7 @@ exclude =


# The ignore-list below comes from FontBakery linting setup.
# The `languages` module has a much simples codebase, so we may be in much better shape in here.
# The `gflanguages` module has a much simples codebase, so we may be in much better shape in here.
# So, perhaps, we could safely enable many of these lint-checks.
max-line-length=100
ignore =
Expand Down

0 comments on commit 531c5ec

Please sign in to comment.