Skip to content

Commit c3811ab

Browse files
Update dependency python to 3.13 (#65)
* Update dependency python to 3.13 * Work around setup.py deprecation --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Josh Hadley <johadley@adobe.com>
1 parent 18f682a commit c3811ab

File tree

3 files changed

+65
-38
lines changed

3 files changed

+65
-38
lines changed

.github/workflows/run_tests.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0 # Fetch full history for setuptools_scm
2224

2325
- name: Log reason (manual run only)
2426
if: github.event_name == 'workflow_dispatch'
@@ -28,23 +30,33 @@ jobs:
2830
- name: Set up Python
2931
uses: actions/setup-python@v5
3032
with:
31-
python-version: 3.11
33+
python-version: 3.13
34+
35+
- name: Install system dependencies
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y build-essential pkg-config zlib1g-dev libtool autotools-dev
3239
3340
- name: Install dependencies
3441
run: |
3542
python -m pip install --upgrade pip
3643
python -m pip install setuptools>=61.0
3744
python -m pip install -r requirements.txt
45+
python -m pip install opentype-sanitizer
46+
47+
- name: Download OTS source
48+
run: |
49+
python setup.py download --version=9.2.0 --sha256=1a1e50cd7ecea27c4ef04c5b1491c21e75555f35bf91e27103ede04ddd11e053
3850
3951
- name: Lint with flake8
4052
run: flake8 . --show-source --statistics
4153

4254
- name: Lint with cpplint
43-
run: cpplint --filter=-build/includesubdir,-readability/casting,-build/include --recursive .
55+
run: cpplint --filter=-build/includesubdir,-readability/casting,-build/include --recursive src/_pyots/
4456

4557
- name: Build and install
4658
run: |
47-
python setup.py install
59+
python -m pip install -v .
4860
4961
- name: Test with pytest
5062
run: |

pyproject.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
[build-system]
22
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=3.4", "ninja", "meson"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "pyots"
7+
description = "Python wrapper for ot-sanitizer"
8+
readme = "README.md"
9+
license = "BSD-3-Clause"
10+
authors = [
11+
{name = "Adobe Type team & friends", email = "afdko@adobe.com"}
12+
]
13+
classifiers = [
14+
"Development Status :: 4 - Beta",
15+
"Intended Audience :: Developers",
16+
"Topic :: Software Development :: Testing",
17+
"Programming Language :: Python :: 3.9",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
"Operating System :: MacOS :: MacOS X",
23+
"Operating System :: POSIX :: Linux",
24+
]
25+
requires-python = ">=3.9"
26+
dynamic = ["version"]
27+
28+
[project.urls]
29+
Homepage = "https://github.com/adobe-type-tools/pyots"
30+
31+
[tool.setuptools]
32+
package-dir = {"" = "src"}
33+
zip-safe = false
34+
35+
[tool.setuptools.packages.find]
36+
where = ["src"]
37+
38+
[tool.setuptools_scm]
339

440
[tool.pytest.ini_options]
541
testpaths = [

setup.py

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
from build import SRC_DIR, OTS_SRC_DIR
21
from distutils.dir_util import mkpath, remove_tree
32
from distutils import log
43
import io
54
import os
65
import re
7-
from setuptools import setup, find_packages, Extension, Command
6+
from pathlib import Path
7+
from setuptools import setup, Extension, Command
88
from setuptools.command import build_py
99
from setuptools.command.egg_info import egg_info
1010
import subprocess
1111
import sys
1212

1313
PY = sys.executable
1414

15+
# Define paths (previously imported from build.py)
16+
try:
17+
ROOT = Path(__file__).parent.resolve()
18+
except NameError:
19+
# Fallback for when __file__ is not defined
20+
ROOT = Path.cwd()
21+
SRC_DIR = ROOT / "src"
22+
OTS_SRC_DIR = SRC_DIR / "ots"
23+
1524
BUILD_DIR = OTS_SRC_DIR / "build" / "meson"
1625
BUILD_SUB_DIR = BUILD_DIR / "subprojects"
1726
SRC_SUB_DIR = OTS_SRC_DIR / "subprojects"
@@ -47,7 +56,7 @@ def _get_extra_objects():
4756
# xo.append(BUILD_SUB_DIR / f"woff2-{WOFF2_TAG}" / "libwoff2_decoder.a")
4857
# xo.append(BUILD_SUB_DIR / f"woff2-{WOFF2_TAG}" / "libwoff2_common.a")
4958

50-
return [str(p) for p in xo]
59+
return [str(p.relative_to(ROOT)) for p in xo]
5160

5261

5362
def _get_include_dirs():
@@ -69,7 +78,7 @@ def _get_include_dirs():
6978
# woff2
7079
ip.append(SRC_SUB_DIR / f"woff2-{WOFF2_TAG}" / "include")
7180

72-
return [str(p) for p in ip]
81+
return [str(p.relative_to(ROOT)) for p in ip]
7382

7483

7584
def _get_sources():
@@ -87,7 +96,7 @@ def _get_sources():
8796
sp.append(SRC_SUB_DIR / f"woff2-{WOFF2_TAG}" / "src" / "woff2_dec.cc")
8897
sp.append(SRC_SUB_DIR / f"woff2-{WOFF2_TAG}" / "src" / "woff2_out.cc")
8998

90-
return [str(p) for p in sp]
99+
return [str(p.relative_to(ROOT)) for p in sp]
91100

92101

93102
class BuildStaticLibs(Command):
@@ -271,37 +280,7 @@ def run(self):
271280
sources=_get_sources(),
272281
)
273282

274-
with io.open("README.md", encoding="utf-8") as readme:
275-
long_description = readme.read()
276-
277-
classifiers = [
278-
'Development Status :: 4 - Beta',
279-
'Intended Audience :: Developers',
280-
'Topic :: Software Development :: Testing',
281-
'License :: OSI Approved :: BSD License',
282-
'Programming Language :: Python :: 3.9',
283-
'Programming Language :: Python :: 3.10',
284-
'Programming Language :: Python :: 3.11',
285-
'Programming Language :: Python :: 3.12',
286-
'Operating System :: MacOS :: MacOS X',
287-
'Operating System :: POSIX :: Linux',
288-
]
289-
290283
setup(
291-
author='Adobe Type team & friends',
292-
author_email='afdko@adobe.com',
293284
cmdclass=custom_commands,
294-
classifiers=classifiers,
295-
description='Python wrapper for ot-sanitizer',
296285
ext_modules=[pyots_mod],
297-
long_description_content_type='text/markdown',
298-
long_description=long_description,
299-
name='pyots',
300-
packages=find_packages('src'),
301-
package_dir={'': 'src'},
302-
python_requires='>=3.9',
303-
url='https://github.com/adobe-type-tools/pyots',
304-
use_scm_version=True,
305-
setup_requires=['setuptools_scm'],
306-
zip_safe=False,
307286
)

0 commit comments

Comments
 (0)