Skip to content

Commit ecbd7f6

Browse files
committed
Version 0.0.6
- Improved Python packaging to avoid deprecation warnings
1 parent 873898d commit ecbd7f6

5 files changed

Lines changed: 28 additions & 14 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 8 additions & 7 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-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,12 +30,14 @@ 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
@@ -46,11 +48,10 @@ jobs:
4648
- name: Build wheels
4749
run: python3 -m cibuildwheel --output-dir wheelhouse
4850
env:
51+
CIBW_ENABLE: "pypy"
4952
# Windows PyPy 3.8 build is currently failing due to https://github.com/python-cffi/cffi/issues/170
5053
# 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*"
54+
CIBW_SKIP: "*-win32 pp*-win*"
5455
# This ensures WIN_SHELL_COMMANDS does not get defined on Windows in crossplatform.mk, which breaks deep directory creations
5556
# since commands are executed in a UNIX-like shell expecting 'mkdir -p'
5657
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", "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
@@ -14,7 +17,12 @@
1417

1518
from os import path
1619

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

1927
env = os.environ.copy()
2028

@@ -100,9 +108,9 @@ def check_i686_w64_available():
100108
long_description = f.read()
101109

102110
cpu_count = multiprocessing.cpu_count()
103-
eC_dir = os.path.join(os.path.dirname(__file__), 'eC')
104-
eC_c_dir = os.path.join(os.path.dirname(__file__), 'eC', 'bindings', 'c')
105-
eC_py_dir = os.path.join(os.path.dirname(__file__), 'eC', 'bindings', 'py')
111+
eC_dir = os.path.join(rw, 'eC')
112+
eC_c_dir = os.path.join(rw, 'eC', 'bindings', 'c')
113+
eC_py_dir = os.path.join(rw, 'eC', 'bindings', 'py')
106114
platform_str = 'win32' if sys.platform.startswith('win') else ('apple' if sys.platform.startswith('darwin') else 'linux')
107115
dll_prefix = '' if platform_str == 'win32' else 'lib'
108116
dll_dir = 'bin' if platform_str == 'win32' else 'lib'
@@ -274,7 +282,8 @@ def get_tag(self):
274282
setup(
275283
name='ecdev',
276284
version=pkg_version,
277-
setup_requires=['setuptools'],
285+
# setup_requires is deprecated -- build dependencies must now be specified in pyproject.toml
286+
# setup_requires=['setuptools'],
278287
packages=packages,
279288
package_dir=package_dir,
280289
package_data=package_data,

0 commit comments

Comments
 (0)