Skip to content

Commit

Permalink
Add python 3.12 (#160)
Browse files Browse the repository at this point in the history
* Add python 3.12

* Add python 3.12

* Update cibuildwheel to 2.16.2

* Try using delvewheel on windows

* Update pyproject.toml

* Update pyproject.toml

* Update pyproject.toml

* Update pyproject.toml

* Update pyproject.toml

* Remove distutils

* Tweak project settings

* don't set SETUPTOOLS_USE_DISTUTILS=stdlib

* Don't do 3.12 on riscv for now

* Remove need for looseversion

* remove unused re package

* lint fix
  • Loading branch information
emlowe authored Jan 24, 2024
1 parent 11f9a0e commit 3cd0004
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 38 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ jobs:
arch: manylinux2014
intel: manylinux2014
matrix: '3.11'
- major-dot-minor: '3.12'
cibw-build: 'cp312-*'
manylinux:
arch: manylinux2014
intel: manylinux2014
matrix: '3.12'

arch:
- name: ARM
matrix: arm
Expand All @@ -87,19 +94,6 @@ jobs:
arch:
name: ARM
matrix: arm
- os:
name: macOS
matrix: macos
runs-on:
arm: [macOS, ARM64]
intel: [macos-11]
python:
major-dot-minor: '3.7'
cibw-build: 'cp37-*'
matrix: '3.7'
arch:
name: ARM
matrix: arm

steps:
- name: Clean workspace
Expand All @@ -126,7 +120,7 @@ jobs:
CIBW_ARCHS_MACOS: ${{ matrix.os.cibw-archs-macos[matrix.arch.matrix] }}
CIBW_PRERELEASE_PYTHONS: True
run:
pipx run --spec='cibuildwheel==2.11.2' cibuildwheel --output-dir dist 2>&1
pipx run --spec='cibuildwheel==2.16.2' cibuildwheel --output-dir dist 2>&1

- name: Upload artifacts
uses: actions/upload-artifact@v3
Expand Down
18 changes: 5 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,10 @@ environment = {MACOSX_DEPLOYMENT_TARGET="11", SYSTEM_VERSION_COMPAT=0, BUILD_VDF
[tool.cibuildwheel.windows]
build-verbosity = 0
before-all = "git clone https://github.com/Chia-Network/mpir_gc_x64.git"
environment = {BUILD_VDF_CLIENT="N", SETUPTOOLS_USE_DISTUTILS="stdlib"}
environment = {BUILD_VDF_CLIENT="N"}
before-build = "pip install delvewheel"
repair-wheel-command = """
ls -l mpir_gc_x64 && pip uninstall -y delocate \
&& pip install git+https://github.com/Chia-Network/delocate.git \
&& delocate-wheel -v -i mpir_gc_x64/mpir.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_gc.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_broadwell.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_broadwell_avx.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_bulldozer.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_haswell.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_piledriver.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_sandybridge.dll {wheel} \
&& delocate-wheel -v -i mpir_gc_x64/mpir_skylake_avx.dll {wheel} \
&& cp {wheel} {dest_dir} \
delvewheel repair -v -w {dest_dir} {wheel} \
--add-path mpir_gc_x64 \
--add-dll mpir.dll;mpir_gc.dll;mpir_broadwell.dll;mpir_broadwell_avx.dll;mpir_bulldozer.dll;mpir_haswell.dll;mpir_piledriver.dll;mpir_sandybridge.dll;mpir_skylake_avx.dll \
"""
13 changes: 2 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import os
import platform
import re
import shutil
import subprocess
import sys
from distutils.command.install import install
from distutils.version import LooseVersion

from setuptools import Command, Extension, setup, errors
from setuptools.command.build import build
from setuptools.command.build_ext import build_ext
from setuptools.command.install import install

BUILD_HOOKS = []
INSTALL_HOOKS = []
Expand Down Expand Up @@ -93,21 +91,14 @@ def invoke_make(**kwargs):
class CMakeBuild(build_ext):
def run(self):
try:
out = subprocess.check_output(["cmake", "--version"])
subprocess.check_output(["cmake", "--version"])
except OSError:
raise RuntimeError(
"CMake must be installed to build"
+ " the following extensions: "
+ ", ".join(e.name for e in self.extensions)
)

if platform.system() == "Windows":
cmake_version = LooseVersion(
re.search(r"version\s*([\d.]+)", out.decode()).group(1)
)
if cmake_version < "3.1.0":
raise RuntimeError("CMake >= 3.1.0 is required on Windows")

for ext in self.extensions:
self.build_extension(ext)

Expand Down

0 comments on commit 3cd0004

Please sign in to comment.