Skip to content

Commit

Permalink
fix build for py312
Browse files Browse the repository at this point in the history
  • Loading branch information
xoolive committed Mar 3, 2024
1 parent 9646c2f commit 93794b6
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

env:
PYTHON_VERSION: ${{ matrix.python-version }}
Expand Down
10 changes: 4 additions & 6 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os
import shutil
import sys
from distutils.command import build_ext
from distutils.core import Distribution, Extension

# import pip
from Cython.Build import cythonize
from setuptools import Distribution, Extension
from setuptools.command import build_ext


def build() -> None:
Expand Down Expand Up @@ -46,9 +46,7 @@ def build() -> None:
compiler_directives={"binding": True, "language_level": 3},
)

distribution = Distribution(
{"name": "extended", "ext_modules": ext_modules}
)
distribution = Distribution({"name": "extended", "ext_modules": ext_modules})
distribution.package_dir = "extended" # type: ignore

cmd = build_ext.build_ext(distribution)
Expand All @@ -57,7 +55,7 @@ def build() -> None:
cmd.run()

# Copy built extensions back to the project
for output in cmd.get_outputs():
for output in cmd.get_output_mapping():
relative_extension = os.path.relpath(output, cmd.build_lib)
shutil.copyfile(output, relative_extension)
mode = os.stat(relative_extension).st_mode
Expand Down
Loading

0 comments on commit 93794b6

Please sign in to comment.