dev-util/gftools: initial import

Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
This commit is contained in:
Alessandro Barbieri
2021-06-20 19:51:01 +02:00
parent 1805b9c2f5
commit 34490e7e01
5 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
DIST GlyphsInfo-0fe81a08dee6e7614c0f196e6668a9aafaad0d3e.tar.gz 629268 BLAKE2B 0997002383bcbff740c71bb70a80e9ddd72c25898d37febb37858fa2cfaa23c26880c107d7827baee0eaa96f01aabc904e3fcf347efbe8af6dff0d5394426474 SHA512 f55dd62edddee2ed2e015db5b5efdab49ce3323b4a09282b7260d2d201337fd71346fb735a7d78a79a969fa167ddf9bef5cc2f1eec61a1c68ba001be97ec208c
DIST gftools-0.6.2.tar.gz 4855429 BLAKE2B 7b71089eef885a576298e9900f1d2ed0d3b23d2a95bca3b1916bb111b9001408af561b40c2dc78be669335522efb7a74593322d6babd42c96c3d03baae06e757 SHA512 6f8a32733e2c37e1a3300f8c8ef446c90958b908eaba5366b4a80061ba3b090ae3589640062ccbb206901331c97b088c8d78661f793ef4ea7a684cfe97695e26

View File

@@ -0,0 +1,10 @@
--- a/setup.py
+++ b/setup.py
@@ -72,7 +72,6 @@ setup(
# see: https://github.com/fontforge/fontforge/issues/2048
'setuptools',
'FontTools[ufo]',
- 'Flask',
'absl-py',
'glyphsLib',
'PyGithub',

View File

@@ -0,0 +1,28 @@
--- a/Lib/gftools/tests/test_qa.py
+++ b/Lib/gftools/tests/test_qa.py
@@ -1,5 +1,6 @@
import subprocess
import unittest
+import pytest
import tempfile
import os
@@ -38,6 +39,7 @@ class TestQA(unittest.TestCase):
self.assertTrue("Fontbakery" in os.listdir(qa_out))
def test_diff_github_fonts_vs_googlefonts_vf(self):
+ if not 'GH_TOKEN' in os.environ.keys(): pytest.skip("GH_TOKEN not provided")
with tempfile.TemporaryDirectory() as qa_out:
subprocess.call(
[
--- a/Lib/gftools/tests/test_stat.py
+++ b/Lib/gftools/tests/test_stat.py
@@ -373,7 +373,7 @@ def test_gen_stat_tables_from_config(var
- name: Italic
value: 1
"""
- config = yaml.load(config_text)
+ config = yaml.safe_load(config_text)
gen_stat_tables_from_config(config, var_fonts)
roman, italic = var_fonts

View File

@@ -0,0 +1,80 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
COMMIT="0fe81a08dee6e7614c0f196e6668a9aafaad0d3e"
DISTUTILS_SINGLE_IMPL=1
PYTHON_COMPAT=( python3_8 )
inherit distutils-r1
SRC_URI="
https://github.com/googlefonts/gftools/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
https://github.com/schriftgestalt/GlyphsInfo/archive/${COMMIT}.tar.gz -> GlyphsInfo-${COMMIT}.tar.gz
"
KEYWORDS="~amd64"
DESCRIPTION="Miscellaneous tools for working with the Google Fonts collection"
HOMEPAGE="https://github.com/googlefonts/gftools"
LICENSE="Apache-2.0"
SLOT="0"
RESTRICT="test"
PROPERTIES="test_network"
RDEPEND="
$(python_gen_cond_dep '
app-arch/brotli[python,${PYTHON_MULTI_USEDEP}]
dev-python/absl-py[${PYTHON_MULTI_USEDEP}]
dev-python/babelfont[${PYTHON_MULTI_USEDEP}]
dev-python/browserstack-local-python[${PYTHON_MULTI_USEDEP}]
dev-python/fonttools[${PYTHON_MULTI_USEDEP}]
dev-python/glyphsLib[${PYTHON_MULTI_USEDEP}]
dev-python/ots-python[${PYTHON_MULTI_USEDEP}]
dev-python/protobuf-python[${PYTHON_MULTI_USEDEP}]
dev-python/pybrowserstack-screenshots[${PYTHON_MULTI_USEDEP}]
dev-python/pygit2[${PYTHON_MULTI_USEDEP}]
dev-python/PyGithub[${PYTHON_MULTI_USEDEP}]
dev-python/pyyaml[${PYTHON_MULTI_USEDEP}]
dev-python/statmake[${PYTHON_MULTI_USEDEP}]
dev-python/strictyaml[${PYTHON_MULTI_USEDEP}]
dev-python/requests[${PYTHON_MULTI_USEDEP}]
dev-python/tabulate[${PYTHON_MULTI_USEDEP}]
dev-python/ttfautohint-py[${PYTHON_MULTI_USEDEP}]
dev-python/unidecode[${PYTHON_MULTI_USEDEP}]
dev-python/vttlib[${PYTHON_MULTI_USEDEP}]
dev-util/fontmake[${PYTHON_MULTI_USEDEP}]
')
"
DEPEND="${RDEPEND}"
BDEPEND="
$(python_gen_cond_dep '
dev-python/setuptools_scm[${PYTHON_MULTI_USEDEP}]
')
test? (
$(python_gen_cond_dep '
dev-python/tabulate[${PYTHON_MULTI_USEDEP}]
media-gfx/fontforge[python,${PYTHON_SINGLE_USEDEP}]
')
)
"
PATCHES=(
"${FILESDIR}/${PN}-setup.diff"
"${FILESDIR}/${PN}-tests.diff"
)
distutils_enable_tests pytest
python_prepare_all() {
mv "${WORKDIR}/GlyphsInfo"/*.xml "Lib/${PN}/util/GlyphsInfo"
export SETUPTOOLS_SCM_PRETEND_VERSION="${PV/_p/.post}"
distutils-r1_python_prepare_all
}
python_test() {
local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
local -x PATH="${S}:${PATH}"
distutils_install_for_testing
epytest -vv
}

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<upstream>
<bugs-to>https://github.com/googlefonts/gftools/issues</bugs-to>
<remote-id type="github">googlefonts/gftools</remote-id>
<remote-id type="pypi">gftools</remote-id>
</upstream>
</pkgmetadata>