Skip to content

Commit

Permalink
fix: Update repo template
Browse files Browse the repository at this point in the history
  • Loading branch information
ottta committed Feb 1, 2024
1 parent fc92152 commit 5ce37b1
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 147 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Build font and specimen

on: [release]
on: [push, release]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.10"
- name: Install sys tools/deps
run: |
sudo apt-get update
Expand Down
29 changes: 13 additions & 16 deletions Makefile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ build: build.stamp

venv: venv/touchfile

venv-test: venv-test/touchfile

build.stamp: venv .init.stamp sources/config.yaml $(SOURCES)
. venv/bin/activate; rm -rf fonts/; gftools builder sources/config.yaml && python3 scripts/rename-files.py && touch build.stamp;
rm -rf fonts
(for config in sources/config*.yaml; do . venv/bin/activate; gftools builder $$config; done) && touch build.stamp

.init.stamp: venv
. venv/bin/activate; python3 scripts/first-run.py
Expand All @@ -29,31 +32,25 @@ venv/touchfile: requirements.txt
. venv/bin/activate; pip install -Ur requirements.txt
touch venv/touchfile

check-variable: venv build.stamp
. venv/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-universal -l WARN --full-lists --succinct --badges out/badges --html out/fontbakery/fontbakery-variable-report.html --ghmarkdown out/fontbakery/fontbakery-variable-report.md $(shell find fonts/variable -type f) || echo '::warning file=sources/config.yaml,title=Fontbakery failures::The fontbakery QA check reported errors in your font. Please check the generated report.'

check-otf: venv build.stamp
. venv/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-universal -l WARN --full-lists --succinct --badges out/badges --html out/fontbakery/fontbakery-static-otf-report.html --ghmarkdown out/fontbakery/fontbakery-static-otf-report.md $(shell find fonts/otf -type f) || echo '::warning file=sources/config.yaml,title=Fontbakery failures::The fontbakery QA check reported errors in your font. Please check the generated report.'


check-ttf: venv build.stamp
. venv/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-universal -l WARN --full-lists --succinct --badges out/badges --html out/fontbakery/fontbakery-static-ttf-report.html --ghmarkdown out/fontbakery/fontbakery-static-ttf-report.md $(shell find fonts/ttf -type f) || echo '::warning file=sources/config.yaml,title=Fontbakery failures::The fontbakery QA check reported errors in your font. Please check the generated report.'
venv-test/touchfile: requirements-test.txt
test -d venv-test || python3 -m venv venv-test
. venv-test/bin/activate; pip install -Ur requirements-test.txt
touch venv-test/touchfile

check:
make check-variable; make check-otf; make check-ttf
test: venv-test build.stamp
. venv-test/bin/activate; mkdir -p out/ out/fontbakery; fontbakery check-googlefonts -l WARN --full-lists --succinct --badges out/badges --html out/fontbakery/fontbakery-report.html --ghmarkdown out/fontbakery/fontbakery-report.md $(shell find fonts/ttf -type f) || echo '::warning file=sources/config.yaml,title=Fontbakery failures::The fontbakery QA check reported errors in your font. Please check the generated report.'

proof: venv build.stamp
. venv/bin/activate; mkdir -p out/ out/proof; diffenator2 proof $(shell find fonts/ttf -type f) -o out/proof

images: venv build.stamp $(DRAWBOT_OUTPUT)
git add documentation/*.png && git commit -m "fix: Rebuild images" documentation/*.png
images: venv $(DRAWBOT_OUTPUT)

%.png: %.py build.stamp
python3 $< --output $@
. venv/bin/activate; python3 $< --output $@

clean:
rm -rf venv
find . -name "*.pyc" | xargs rm delete
find . -name "*.pyc" -delete

update-project-template:
npx update-template https://github.com/googlefonts/googlefonts-project-template/
Expand Down
108 changes: 7 additions & 101 deletions requirements.txt
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,101 +1,7 @@
absl-py==2.1.0
afdko==4.0.1
appdirs==1.4.4
attrs==23.2.0
axisregistry==0.4.5
babelfont==3.0.1
beautifulsoup4==4.12.3
beziers==0.5.0
booleanOperations==0.9.0
Brotli==1.1.0
bump2version==1.0.1
bumpfontversion==0.4.1
cattrs==23.2.3
certifi==2023.11.17
cffi==1.16.0
cffsubr==0.3.0
charset-normalizer==3.3.2
click==8.1.7
cmarkgfm==2024.1.14
colorlog==6.8.2
compreffor==0.5.5
cryptography==42.0.2
cu2qu==1.6.7.post2
defcon==0.10.3
Deprecated==1.2.14
exceptiongroup==1.2.0
font-v==2.1.0
fontbakery==0.10.9
fontFeatures==1.8.0
fontmake==3.7.2
fontMath==0.9.3
fontParts==0.12.1
fontPens==0.2.4
fonttools==4.47.2
freetype-py==2.3.0
fs==2.4.16
gflanguages==0.5.16
gftools==0.9.45
gitdb==4.0.11
GitPython==3.1.41
glyphsets==0.6.11
glyphsLib==6.6.2
hyperglot==0.4.5
idna==3.6
Jinja2==3.1.3
lxml==4.9.4
markdown-it-py==3.0.0
MarkupSafe==2.1.4
mdurl==0.1.2
munkres==1.1.4
MutatorMath==3.0.1
nanoemoji==0.15.1
ninja==1.11.1.1
openstep-plist==0.3.1
opentype-sanitizer==9.1.0
opentypespec==1.9.1
orjson==3.9.12
packaging==23.2
picosvg==0.22.1
pillow==10.2.0
pip-api==0.0.30
pngquant-cli==2.17.0.post5
protobuf==3.20.3
pyclipper==1.3.0.post5
pycparser==2.21
pygit2==1.14.0
PyGithub==2.2.0
Pygments==2.17.2
PyJWT==2.8.0
PyNaCl==1.5.0
pyparsing==3.1.1
python-dateutil==2.8.2
PyYAML==6.0.1
regex==2023.12.25
requests==2.31.0
resvg-cli==0.22.0.post3
rich==13.7.0
sh==2.0.6
six==1.16.0
skia-pathops==0.8.0.post1
smmap==5.0.1
soupsieve==2.5
statmake==0.6.0
strictyaml==1.7.3
tabulate==0.9.0
toml==0.10.2
tqdm==4.66.1
ttfautohint-py==0.5.1
typing_extensions==4.9.0
ufo2ft==2.33.4
ufoLib2==0.16.0
ufonormalizer==0.6.1
ufoProcessor==1.9.0
uharfbuzz==0.38.0
unicodedata2==15.1.0
Unidecode==1.3.8
urllib3==2.2.0
vharfbuzz==0.2.0
vttLib==0.12.0
wrapt==1.16.0
zopfli==0.2.3
fontmake>=2.4
gftools[qa]>=0.9.23
drawbot-skia>=0.4.8
sh>=1.14.2
bumpfontversion>=0.2.0
diffenator2>=0.2.5

8 changes: 4 additions & 4 deletions scripts/first-run.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ def lose(msg, e=None):
fh.write(ofl)

# Pin the dependencies
#print("Pinning dependencies")
#dependencies = subprocess.check_output(["pip", "freeze"])
#with open("requirements.txt", "wb") as dependency_file:
#dependency_file.write(dependencies)
print("Pinning dependencies")
dependencies = subprocess.check_output(["pip", "freeze"])
with open("requirements.txt", "wb") as dependency_file:
dependency_file.write(dependencies)

# Finally, we add a "touch file" called ".init.stamp" to the repository which
# prevents this first-run process from being run again.
Expand Down
46 changes: 23 additions & 23 deletions scripts/read-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@

parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--sources',action='store_true')
group.add_argument('--family',action='store_true')
group.add_argument("--sources", action="store_true")
group.add_argument("--family", action="store_true")
args = parser.parse_args()

with open(os.path.join("sources", "config.yaml")) as config:
data = config.read()
data = config.read()

if args.family:
m = re.search(r"(?m)^familyName: (.*)", data)
if m:
print(m[1])
sys.exit(0)
else:
print("Could not determine family name from config file!")
sys.exit(1)
m = re.search(r"(?m)^familyName: (.*)", data)
if m:
print(m[1])
sys.exit(0)
else:
print("Could not determine family name from config file!")
sys.exit(1)

toggle = False
sources = []
for line in data.splitlines():
if re.match("^sources:", line):
toggle = True
continue
if toggle:
m = re.match(r"^\s+-\s*(.*)", line)
if m:
sources.append("sources/"+m[1])
else:
toggle = False
if re.match("^sources:", line):
toggle = True
continue
if toggle:
m = re.match(r"^\s*-\s*(.*)", line)
if m:
sources.append("sources/" + m[1])
else:
toggle = False
if sources:
print(" ".join(sources))
sys.exit(0)
print(" ".join(sources))
sys.exit(0)
else:
print("Could not determine sources from config file!")
sys.exit(1)
print("Could not determine sources from config file!")
sys.exit(1)
8 changes: 8 additions & 0 deletions scripts/update-custom-filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import requests

GF_Latin_All = "https://github.com/googlefonts/glyphsets/raw/main/GF_glyphsets/Latin/glyphs/CustomFilter_GF_Latin.plist"
dest = "sources/CustomFilter_GF_Latin_All.plist"

r = requests.get(GF_Latin_All)
with open(dest, "wb") as f:
f.write(r.content)

0 comments on commit 5ce37b1

Please sign in to comment.