Skip to content

Commit

Permalink
Updates for ots 9.2.0 (#45)
Browse files Browse the repository at this point in the history
* updates for OTS v9.2.0

- modify config/build script to use ots v.9.2.0 & related dependencies
- drop Python 3.8; add Python 3.12
- minor doc updates
- tested against https://github.com/googlefonts/ots-python/releases/tag/v9.2.0
  • Loading branch information
josh-hadley authored Nov 20, 2024
1 parent 7e78a08 commit fa59031
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ jobs:
with:
python-version: '3.9'

- name: Set up msbuild (Windows only)
uses: microsoft/[email protected]
if: startsWith(matrix.os, 'windows')

- name: Build wheel
uses: pypa/[email protected]
with:
output-dir: dist
env:
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-*"
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ENVIRONMENT_MACOS: "CFLAGS='-arch arm64 -arch x86_64' CXXFLAGS='-arch arm64 -arch x86_64' LDFLAGS='-arch arm64 -arch x86_64'"
CIBW_ARCHS_LINUX: x86_64
Expand All @@ -57,16 +61,21 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: wheelstorage
name: wheelstorage-${{ matrix.os }}
path: ./dist/*
if-no-files-found: error
retention-days: 30

publish_release:
name: Publish Release
needs: build_wheels
needs:
- build_wheels
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
permissions:
id-token: write
contents: write # Required by 'action-gh-release'

steps:
Expand All @@ -82,17 +91,14 @@ jobs:
echo "VERSION=$FLAT_TAG" >> "$GITHUB_OUTPUT"
shell: bash

- name: Download release assets
- name: Download release assets for ${{ matrix.os }}
uses: actions/download-artifact@v4
with:
name: wheelstorage
name: wheelstorage-${{ matrix.os }}
path: dist

- name: Publish dist(s) to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
run: |
echo "Reason for triggering: ${{ github.event.inputs.reason }}"
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9

- name: Install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Python wrapper for [OpenType Sanitizer](https://github.com/khaledhosny/ots), als
**NOTE:** Although this package is similar to **ots-python**, it is _not_ a drop-in replacement for it, as the Python API is different.

## Requirements
The project builds `pip`-installable wheels for Python 3.8, 3.9, 3.10 or 3.11 under Mac or Linux. It is possible this project will build and run with other Pythons and other operating systems, but it has only been tested with the listed configurations.
The project builds `pip`-installable wheels for Python 3.9, 3.10, 3.11, or 3.12 under Mac or Linux. It is possible this project will build and run with other Pythons and other operating systems, but it has only been tested with the listed configurations.

## Installation with `pip`
If you just want to _use_ `pyots`, you can simply run `python -m pip install -U pyots` (in one of the supported platforms/Python versions) which will install pre-built, compiled, ready-to-use Python wheels. Then you can skip down to the [Use](#Use) section.
Expand Down Expand Up @@ -51,7 +51,7 @@ from pathlib import Path
for filename in Path("src/ots/tests/fonts/good").rglob("*"):
result = pyots.sanitize(filename.absolute())
if not result.sanitized:
print('{}:\n{}'.format(filename, "\n".join([m for m in result.messages])))
print(f'{filename}:\n{", ".join([m for m in result.messages])}')
```

### Options for `sanitize()`
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[download]
; OpenType Sanitizer version that is downloaded from setup.py
version = 9.1.0
version = 9.2.0
; expected SHA-256 of the downloaded tarball. E.g. you can calculate it with:
; $ shasum -a 256 ots-X.X.X.tar.xz
sha256 = e52efca9b6af41121deb71d867c6440b2d89b4cf189a9004f62a3989514acc22
sha256 = 1a1e50cd7ecea27c4ef04c5b1491c21e75555f35bf91e27103ede04ddd11e053
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# to avoid changing it with every new ots release (although it seems like every
# release of ots has something that causes this build to break anyway so it's
# not really that urgent. We just have to adjust every release.
BROTLI_TAG = "1.0.9"
BROTLI_TAG = "1.1.0"
LZ4_TAG = "1.9.4"
WOFF2_TAG = "1.0.2"

Expand Down Expand Up @@ -279,10 +279,10 @@ def run(self):
'Intended Audience :: Developers',
'Topic :: Software Development :: Testing',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
]
Expand All @@ -299,7 +299,7 @@ def run(self):
name='pyots',
packages=find_packages('src'),
package_dir={'': 'src'},
python_requires='>=3.8',
python_requires='>=3.9',
url='https://github.com/adobe-type-tools/pyots',
use_scm_version=True,
setup_requires=['setuptools_scm'],
Expand Down

0 comments on commit fa59031

Please sign in to comment.