Skip to content

Commit 0b8947e

Browse files
committed
Version 0.0.6
- Python packaging improvements to avoid deprecation warnings
1 parent 93c1f52 commit 0b8947e

File tree

5 files changed

+31
-15
lines changed

5 files changed

+31
-15
lines changed

.github/workflows/wheels.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
# os: [ubuntu-latest]
1313
# os: [windows-2019] #latest]
1414
# os: [macos-13] # macos-latest]
15-
os: [ubuntu-latest, windows-2022, ubuntu-24.04-arm, macos-13, macos-latest]
15+
os: [ubuntu-latest, windows-2022, ubuntu-24.04-arm, macos-15-intel, macos-latest]
1616

1717
steps:
1818
- uses: actions/checkout@v4
@@ -21,7 +21,7 @@ jobs:
2121
if: runner.os == 'macOS'
2222
uses: actions/setup-python@v4
2323
with:
24-
python-version: '3.8'
24+
python-version: '3.11'
2525

2626
# Apply patch only on Windows
2727
- name: Apply header patch on Windows
@@ -30,27 +30,30 @@ jobs:
3030
# Patch MinGW-w64 header files currently causing troubles for eC compiler (C99 .namedmembers assignments in AVX files, and re-defnitions of function type typedef in winbase.h)
3131
#git apply --directory=mingw64 '${{ github.workspace }}\patches\mingw64-gcc-12.2.0-patches.patch'
3232
cd C:\
33-
copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16intrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16intrin.h
34-
copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16vlintrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16vlintrin.h
33+
copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16intrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\14.2.0\include\avx512fp16intrin.h
34+
copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16vlintrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\14.2.0\include\avx512fp16vlintrin.h
3535
copy ${{ github.workspace }}\patches\x86_64-w64-mingw32\include\winbase.h C:\mingw64\x86_64-w64-mingw32\include\winbase.h
3636
3737
# Used to host cibuildwheel
3838
- uses: actions/setup-python@v5
39+
with:
40+
python-version: '3.11'
3941

4042
- name: Initialize submodules
4143
run: git submodule update --init --recursive
4244

4345
- name: Install cibuildwheel
44-
run: python3 -m pip install cibuildwheel==2.23.3
46+
run: |
47+
set CFLAGS=-D__AVX512BF16__=0
48+
python3 -m pip install cibuildwheel==2.23.3
4549
4650
- name: Build wheels
4751
run: python3 -m cibuildwheel --output-dir wheelhouse
4852
env:
53+
CIBW_ENABLE: "pypy"
4954
# Windows PyPy 3.8 build is currently failing due to https://github.com/python-cffi/cffi/issues/170
5055
# 32-bit builds on Windows are not supported because the MinGW-w64 does not have multilib enabled
51-
# musllinux builds do not currently work
52-
# There seems to be setuptools-related issues with 3.6 and 3.7 CPython builds
53-
CIBW_SKIP: "cp36-* cp37-* *-win32 pp*-win*"
56+
CIBW_SKIP: "*-win32 pp*-win*"
5457
# This ensures WIN_SHELL_COMMANDS does not get defined on Windows in crossplatform.mk, which breaks deep directory creations
5558
# since commands are executed in a UNIX-like shell expecting 'mkdir -p'
5659
CIBW_ENVIRONMENT: "MSYSCON=y"

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ recursive-exclude eC .git**
77
recursive-exclude eC */__pycache__
88
recursive-exclude eC bindings/py/_pyecrt.c
99
include setup.py
10+
include pyproject.toml
1011
include README.md

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel", "cffi>=1.0.0", "importlib_metadata; python_version<'3.8'"]
3+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
from setuptools import setup, Extension
22
import multiprocessing
3-
from setuptools.command.build import build
3+
try:
4+
from setuptools.command.build import build # Python 3.7+
5+
except ImportError:
6+
from distutils.command.build import build # Fallback for older Python (<3.7)
47
from setuptools.command.egg_info import egg_info
58
import subprocess
69
import os
@@ -12,7 +15,12 @@
1215
import distutils.ccompiler
1316
from distutils.command.build_ext import build_ext
1417

15-
pkg_version = '0.0.5'
18+
# Work around for CPython 3.6 on Windows
19+
if sys.platform.startswith("win") and sys.version_info[:2] == (3, 6):
20+
import distutils.cygwinccompiler
21+
distutils.cygwinccompiler.get_msvcr = lambda: [] # ["msvcr140"] -- we're building with MinGW-w64
22+
23+
pkg_version = '0.0.6'
1624

1725
env = os.environ.copy()
1826

@@ -98,9 +106,9 @@ def check_i686_w64_available():
98106
long_description = f.read()
99107

100108
cpu_count = multiprocessing.cpu_count()
101-
eC_dir = os.path.join(os.path.dirname(__file__), 'eC')
102-
eC_c_dir = os.path.join(os.path.dirname(__file__), 'eC', 'bindings', 'c')
103-
eC_py_dir = os.path.join(os.path.dirname(__file__), 'eC', 'bindings', 'py')
109+
eC_dir = os.path.join(rwd, 'eC')
110+
eC_c_dir = os.path.join(rwd, 'eC', 'bindings', 'c')
111+
eC_py_dir = os.path.join(rwd, 'eC', 'bindings', 'py')
104112
platform = 'win32' if sys.platform.startswith('win') else ('apple' if sys.platform.startswith('darwin') else 'linux')
105113
dll_prefix = '' if platform == 'win32' else 'lib'
106114
dll_dir = 'bin' if platform == 'win32' else 'lib'
@@ -185,7 +193,8 @@ def run(self):
185193
name='ecrt',
186194
version=pkg_version,
187195
cffi_modules=cffi_modules,
188-
setup_requires=['cffi >= 1.0.0'],
196+
# setup_requires is deprecated -- build dependencies must now be specified in pyproject.toml
197+
# setup_requires=['cffi >= 1.0.0'],
189198
install_requires=['cffi >= 1.0.0'],
190199
packages=packages,
191200
package_dir=package_dir,

0 commit comments

Comments
 (0)