From 279b3fb63facabea0a5e96a39b293e19eab517e6 Mon Sep 17 00:00:00 2001 From: Josh Hadley Date: Fri, 4 Oct 2024 11:59:52 -0700 Subject: [PATCH 1/3] 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 --- .github/workflows/release.yml | 2 +- README.md | 4 ++-- setup.cfg | 4 ++-- setup.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92443c3..deb2596 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: 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 diff --git a/README.md b/README.md index c511649..225e2dc 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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()` diff --git a/setup.cfg b/setup.cfg index 877af5c..c0744e2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py index f9879ad..dd9a9ab 100644 --- a/setup.py +++ b/setup.py @@ -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" @@ -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', ] @@ -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'], From 239db81a3068ad76c40c63dd23c076fcfda4d9bc Mon Sep 17 00:00:00 2001 From: Josh Hadley Date: Fri, 4 Oct 2024 12:06:12 -0700 Subject: [PATCH 2/3] Update run_tests.yml Use Python 3.9 --- .github/workflows/run_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 303a2a1..06ba379 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -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: | From 52ed4248502864dd7a453fc8503eda8aaa9f9ba9 Mon Sep 17 00:00:00 2001 From: Josh Hadley Date: Fri, 4 Oct 2024 13:38:53 -0700 Subject: [PATCH 3/3] Update release.yml actions/upload-artifact@v4 has a breaking change that prevents uploading to the same named Artifact multiple times. This change attempts to address that by splitting the Artifact by `matrix.os` value updates for PyPI Trusted Publishing --- .github/workflows/release.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index deb2596..9d221de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,6 +36,10 @@ jobs: with: python-version: '3.9' + - name: Set up msbuild (Windows only) + uses: microsoft/setup-msbuild@v1.0.2 + if: startsWith(matrix.os, 'windows') + - name: Build wheel uses: pypa/cibuildwheel@v2.21.2 with: @@ -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: @@ -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