Skip to content

Commit

Permalink
Use Python 3.12
Browse files Browse the repository at this point in the history
Multithreading causes errors in Font Bakery in Python 3.12, so it has
been disabled. Even so, the new version of Python is faster enough that
`make -j check` is actually slightly faster than it was before.
  • Loading branch information
dscorbett committed Oct 19, 2024
1 parent 49eaefd commit d540ca3
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 35 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ permissions:
contents: read
env:
FONTFORGE_COMMIT: aa062f4cbd1db21e27b2620f16993ebe4c540ab6
PYTHON_VERSION: 3.11
PYTHON_VERSION: 3.12
jobs:
main:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
include:
Expand Down Expand Up @@ -124,11 +124,14 @@ jobs:
sudo apt-get -qy --no-install-recommends install \
build-essential \
cmake \
libfreetype6-dev \
libglib2.0-dev \
ninja-build \
packaging-dev \
pkg-config \
python${{ env.PYTHON_VERSION }}-dev \
;
pip install $(grep '^setuptools==' dev-requirements.txt)
curl -Lo fontforge.zip https://github.com/fontforge/fontforge/archive/${{ env.FONTFORGE_COMMIT }}.zip
unzip fontforge.zip
mv fontforge-${{ env.FONTFORGE_COMMIT }} fontforge
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ endif

.PHONY: $(addprefix fontbakery-,$(SUFFIXES))
$(addprefix fontbakery-,$(SUFFIXES)): fontbakery-%: %
fontbakery check-notofonts --auto-jobs --configuration <($(UNIFDEF) tests/fontbakery-config.toml) --full-lists --skip-network $(filter %.$*,$(FONTS))
fontbakery check-notofonts --configuration <($(UNIFDEF) tests/fontbakery-config.toml) --full-lists --skip-network $(filter %.$*,$(FONTS))

.PHONY: fontbakery
fontbakery: $(addprefix fontbakery-,$(SUFFIXES))
Expand Down
19 changes: 10 additions & 9 deletions dev-constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@ fs >= 2.4.16
GitPython >= 3.0.6
importlib-resources >= 2 # https://github.com/googlefonts/nam-files/commit/6d12b577cb778f178e9653b7b89c40b182c44a7a
Jinja2 >= 3a0 # https://github.com/fonttools/fontbakery/issues/4717
lxml >= 4.9.1
munkres >= 1.0.6 # https://github.com/bmc/munkres/pull/2
numpy >= 1.22
openstep-plist != 0.3 # https://github.com/fonttools/openstep-plist/issues/16
lxml >= 4.9.3
munkres >= 1.0.10 # https://github.com/bmc/munkres/issues/21
numpy >= 1.26
openstep-plist >= 0.3.1
orjson >= 3.6.3
packaging >= 14.5 # https://github.com/fonttools/fontbakery/issues/4792
pip >= 23.1.2 # https://github.com/pypa/pip/commit/f1a7a6f942b869ae3428dbf55dfc1ca756c78d94
protobuf >= 3.12.2
pyclipper >= 1.3.post3
pyclipper >= 1.3.post5
pytz >= 2014.9
pyyaml >= 6
requests >= 2.19 # https://github.com/fonttools/fontbakery/issues/4718
pyyaml >= 6.0.1 # https://github.com/yaml/pyyaml/issues/601
requests >= 2.25 # https://github.com/psf/requests/commit/03957eb1c2b9a1e5e6d61f5e930d7c5ed7cfe853#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R47
rich >= 13.2 # https://github.com/Textualize/rich/commit/6aac8da6984482ad767c06dd592ffa019a0b5318#diff-a008d33d5743c15fbc11efc91f15d4d66e6751eac937baa1fc4467e563157f0dR411
rstr >= 2.2
ruamel-yaml >= 0.2
setuptools >= 41.1 # https://github.com/pypa/setuptools/pull/1788
setuptools >= 66.1 # https://github.com/pypa/setuptools/pull/3685
sre-yield >= 1.1
toml >= 0.9.1 # https://github.com/uiri/toml/commit/c54810e73feb55167cb7ec327b6568fa21d43669
urllib3 >= 1.23 # https://github.com/urllib3/urllib3/pull/1325
urllib3 >= 1.26.5 # Avoid “No module named 'urllib3.packages.six.moves'” error
23 changes: 12 additions & 11 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fs==2.4.16
# -c dev-constraints.txt
# fontfeatures
# fonttools
gflanguages==0.6.4
gflanguages==0.6.5
# via
# fontbakery
# glyphsets
Expand Down Expand Up @@ -138,7 +138,7 @@ lxml==5.3.0
# fonttools
markdown-it-py==3.0.0
# via rich
markupsafe==3.0.1
markupsafe==3.0.2
# via jinja2
mdurl==0.1.2
# via markdown-it-py
Expand All @@ -152,7 +152,7 @@ mypy-extensions==1.0.0
# via mypy
num2words==0.5.13
# via shaperglot
openstep-plist==0.3.1
openstep-plist==0.4.0
# via
# -c dev-constraints.txt
# babelfont
Expand All @@ -161,7 +161,7 @@ opentype-sanitizer==9.1.0
# via fontbakery
opentypespec==1.9.1
# via fontbakery
orjson==3.10.7
orjson==3.10.9
# via
# -c dev-constraints.txt
# babelfont
Expand All @@ -170,7 +170,9 @@ packaging==24.1
# -c dev-constraints.txt
# fontbakery
pip==24.2
# via pip-api
# via
# -c dev-constraints.txt
# pip-api
pip-api==0.0.34
# via fontbakery
protobuf==3.20.3
Expand All @@ -180,7 +182,7 @@ protobuf==3.20.3
# fontbakery
# gflanguages
# shaperglot
pyclipper==1.3.0.post5
pyclipper==1.3.0.post6
# via
# -c dev-constraints.txt
# beziers
Expand Down Expand Up @@ -211,9 +213,9 @@ rstr==3.2.2
# via
# -c dev-constraints.txt
# stringbrewer
ruff==0.6.4
ruff==0.6.9
# via -r dev-requirements.in
setuptools==75.1.0
setuptools==75.2.0
# via
# -c dev-constraints.txt
# fs
Expand All @@ -224,7 +226,7 @@ six==1.16.0
# via
# fs
# python-dateutil
skia-pathops==0.8.0.post1
skia-pathops==0.8.0.post2
# via collidoscope
soupsieve==2.6
# via beautifulsoup4
Expand All @@ -246,7 +248,6 @@ tqdm==4.66.5
# via collidoscope
typing-extensions==4.12.2
# via
# -r requirements.in
# mypy
# vfblib
ufo2ft==3.3.1
Expand Down Expand Up @@ -278,7 +279,7 @@ urllib3==2.2.3
# via
# -c dev-constraints.txt
# requests
uv==0.4.21
uv==0.4.24
# via -r dev-requirements.in
vfblib==0.7.1
# via babelfont
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ limitations under the License.
The prerequisites are:

* GNU Make
* Python 3.11 or later
* Python 3.12 or later
* FontForge 20190801 with Python 3 extensions
* unifdef

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ disallow_untyped_defs = false

[tool.ruff]
src = [".", "sources"]
target-version = "py311"
target-version = "py312"

[tool.ruff.lint]
allowed-confusables = [
Expand Down
3 changes: 1 addition & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
cffsubr >= 0.3, < 0.3.1
fonttools[repacker] >= 4.39.4, < 5
gfsubsets >= 2024.9.25
typing_extensions ~= 4.4
uharfbuzz >= 0.31, < 0.37.3 # https://github.com/harfbuzz/harfbuzz/pull/4385#issuecomment-1692191895
uharfbuzz >= 0.37.1, < 0.37.3 # https://github.com/harfbuzz/uharfbuzz/pull/165 https://github.com/harfbuzz/harfbuzz/pull/4385#issuecomment-1692191895
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ gfsubsets==2024.9.25
# via -r requirements.in
importlib-resources==6.4.5
# via gfsubsets
typing-extensions==4.12.2
# via -r requirements.in
uharfbuzz==0.37.2
# via
# -r requirements.in
Expand Down
4 changes: 2 additions & 2 deletions sources/copy_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from _typeshed import StrOrBytesPath


def cast_cff_number(number: float | int) -> float | int: # noqa: PYI041
def cast_cff_number(number: float) -> float:
"""Losslessly casts a number to the data type in which it uses the
fewest bytes in CFF.
Expand All @@ -41,7 +41,7 @@ def cast_cff_number(number: float | int) -> float | int: # noqa: PYI041
`number` as either a `float` or an `int`, whichever uses the
fewest bytes in CFF.
"""
if isinstance(number, float) and not number.is_integer():
if not number.is_integer():
return number
f = float(number)
if not (-2 ** 31 <= number <= 2 ** 31 - 1):
Expand Down
2 changes: 1 addition & 1 deletion sources/phases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@
from typing import TypeVar
from typing import cast
from typing import overload
from typing import override

import fontTools.feaLib.ast
import fontTools.otlLib.builder
from typing_extensions import override

import schema
from utils import GlyphClass
Expand Down
2 changes: 1 addition & 1 deletion sources/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
from typing import Self
from typing import TYPE_CHECKING
from typing import cast
from typing import override
import unicodedata

import fontTools.agl
import fontTools.merge.unicode
from typing_extensions import override

import anchors
from shapes import AnchorWidthDigit
Expand Down
2 changes: 1 addition & 1 deletion sources/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
from typing import TYPE_CHECKING
from typing import TypeVar
from typing import cast
from typing import override

import fontTools.misc.transform
import fontforge
from typing_extensions import override

import anchors
from utils import CAP_HEIGHT
Expand Down
2 changes: 1 addition & 1 deletion sources/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
from typing import TYPE_CHECKING
from typing import TypeVar
from typing import overload
from typing import override

import fontTools.subset
from typing_extensions import override
import uharfbuzz


Expand Down

0 comments on commit d540ca3

Please sign in to comment.