Skip to content

Commit 35087fb

Browse files
authored
Updates for ots 8.2.2 (#17)
- bump setup.cfg info to point to ots 8.2.2 - update brotli, lz4 & woff2 tags - add config for pytest to automatically use "tests" path - minor updates & improvements to README.md
1 parent fbeaab4 commit 35087fb

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@ Python wrapper for [OpenType Sanitizer](https://github.com/khaledhosny/ots), als
1414
The project builds `pip`-installable wheels for Python 3.7, 3.8, 3.9 or 3.10 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.
1515

1616
## Installation with `pip`
17-
If you just want to _use_ `pyots`, you can simply run `pip install 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.
17+
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.
1818

1919
## Installation/setup for developing `pyots`
2020
If you'd like to tinker with the `pyots` code, you will want to get your local setup ready:
2121
- clone this repo
2222
- run `python setup.py download` to download the OTS source (which is _not included_ in this project). You can modify the `version` value in [`setup.cfg`](./setup.cfg) under `[download]` to specify a different version of OTS. You'll also need to change the `sha256` hash value that corresponds to the OTS tar.xz package. Note that this scheme has some limitations: OTS sources older than 8.1.3 might not build correctly since they used different build systems. Also, versions newer than the one specified in this repo might require adjustments in order to build correctly. What can we say, we're dependent on `ots`...
23-
- to build and install `pyots` after downloading OTS, you can run `python setup.py install` or `pip install .`
23+
- to build and install `pyots` after downloading OTS, you can run `python setup.py install` or `python -m pip install .`
2424
- while iterating changes, you will want to delete the temporary `build` and `src/ots/build` folders.
2525

2626
## Testing
27-
There is a test suite defined for exercising the Python extension. It makes use (and assumes the presence of) the downloaded OTS library source's test font data in `src/ots` so ensure you have run `python setup.py download` and have the `ots` folder under `src`. Invoke the tests with `python -m pytest tests` *OR* `pytest tests` (make sure you specify `tests` folder, otherwise `pytest` will discover and attempt to execute other Python tests within the `ots` tree, which will probably fail)
27+
There is a test suite defined for exercising the Python extension. It makes use (and assumes the presence of) the downloaded OTS library source's test font data in `src/ots` so ensure you have run `python setup.py download` and have the `ots` folder under `src`. Invoke the tests with `python -m pytest`.
28+
29+
If you wish to run tests comparing results from `ots-python` against `pyots`, be sure to `python -m pip install opentype-sanitizer` first, otherwise that set of tests will be skipped.
2830

2931
## Use
3032
Simplest case:

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
[build-system]
2-
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "ninja", "meson"]
2+
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=3.4", "ninja", "meson"]
3+
4+
[tool.pytest.ini_options]
5+
testpaths = [
6+
"tests",
7+
]

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[download]
22
; OpenType Sanitizer version that is downloaded from setup.py
3-
version = 8.2.1
3+
version = 8.2.2
44
; expected SHA-256 of the downloaded tarball. E.g. you can calculate it with:
55
; $ shasum -a 256 ots-X.X.X.tar.xz
6-
sha256 = c9948c8ae61c50937afc6a0da6fb1c351fb7ea1ab30f796679d165447667e89f
6+
sha256 = d0d60d4bfb8cc8841ac8f91d3e562e47fa831d3e5c9b3bd7c05120391cf1f36b

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
# to avoid changing it with every new ots release (although it seems like every
2121
# release of ots has something that causes this build to break anyway so it's
2222
# not really that urgent. We just have to adjust every release.
23-
BROTLI_TAG = "1.0.7"
24-
LZ4_TAG = "1.9.3"
25-
WOFF2_TAG = "a0d0ed7da27b708c0a4e96ad7a998bddc933c06e"
23+
BROTLI_TAG = "1.0.9"
24+
LZ4_TAG = "1.9.4"
25+
WOFF2_TAG = "1.0.2"
2626

2727

2828
def _get_extra_objects():

0 commit comments

Comments
 (0)