Skip to content

Commit

Permalink
Build using Github Actions (#112)
Browse files Browse the repository at this point in the history
* remove arm64

* update version

* fix version name

* update CIBW_REPAIR_WHEEL_COMMAND

* added DCMAKE_OSX_ARCHITECTURES

* build all os

* fix windows build

* update readme, version
  • Loading branch information
kotarotanahashi authored Dec 1, 2021
1 parent ab13a2e commit 70f90a2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build_and_upolad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [x86_64, AMD64, i686, arm64]
python: [36, 37, 38, 39]

exclude:
- os: ubuntu-latest
arch: AMD64
Expand Down Expand Up @@ -111,22 +112,20 @@ jobs:
CIBW_PLATFORM: linux
CIBW_BUILD: "cp3*-manylinux*"
CIBW_BEFORE_ALL: ""
CIBW_BEFORE_BUILD: "pip install scikit-build"
CIBW_BEFORE_BUILD: ""
CIBW_REPAIR_WHEEL_COMMAND: "auditwheel repair -w {dest_dir} {wheel}"

- os: macos-latest
CIBW_PLATFORM: macos
CIBW_BUILD: "cp3*-macosx*"
CIBW_BEFORE_ALL: ""
CIBW_BEFORE_BUILD: "pip install git+https://github.com/scikit-build/scikit-build.git@master"
CIBW_REPAIR_WHEEL_COMMAND: "delocate-listdeps {wheel} && delocate-wheel --require-archs {delocate_archs} -w {dest_dir} {wheel}"


CIBW_BEFORE_BUILD: ""

- os: windows-latest
CIBW_PLATFORM: windows
CIBW_BUILD: "cp3*-win_amd64*"
CIBW_BEFORE_ALL: ""
CIBW_BEFORE_BUILD: "pip install delvewheel scikit-build"
CIBW_BEFORE_BUILD: "pip install delvewheel"
CIBW_REPAIR_WHEEL_COMMAND: "delvewheel repair -w {dest_dir} {wheel}"

fail-fast: false
Expand Down
14 changes: 12 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ or
Supported Python Versions
-------------------------

Python 3.7, 3.8 and 3.9 are supported.
Python 3.6, 3.7, 3.8 and 3.9 are supported.

Supported Operating Systems
---------------------------

- Linux (32/64bit)
- OSX (64bit, >=10.9)
- OSX (x86_64(Intel)/arm64(Apple Silicon), 64bit, >=10.9)
- Win (64bit)

.. index-end-marker1
Expand Down Expand Up @@ -165,6 +165,14 @@ If you use PyQUBO in your research, please cite `this paper <https://journals.jp

::

@article{zaman2021pyqubo,
title={PyQUBO: Python Library for QUBO Creation},
author={Zaman, Mashiyat and Tanahashi, Kotaro and Tanaka, Shu},
journal={IEEE Transactions on Computers},
year={2021},
publisher={IEEE}
}

@article{tanahashi2019application,
title={Application of Ising Machines and a Software Development for Ising Machines},
author={Tanahashi, Kotaro and Takayanagi, Shinichi and Motohashi, Tomomitsu and Tanaka, Shu},
Expand All @@ -191,3 +199,5 @@ Contribution
------------

We welcome contributions to this project. See `CONTRIBUTING <./CONTRIBUTING.rst>`_.

We thank the major contributors, @tail-island, @29rou.
2 changes: 1 addition & 1 deletion pyqubo/package_info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# (major, minor, patch, prerelease)

VERSION = (1, 0, 13, "")
VERSION = (1, 1, 0, "")
__shortversion__ = '.'.join(map(str, VERSION[:3]))
__version__ = '.'.join(map(str, VERSION[:3])) + "".join(VERSION[3:])

Expand Down
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
import subprocess
import sys
import platform
import re

from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
Expand Down Expand Up @@ -88,6 +90,14 @@ def build_extension(self, ext):
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}".format(cfg.upper(), extdir)
]
build_args += ["--config", cfg]

if platform.system() == 'Darwin':

# Cross-compile support for macOS - respect ARCHFLAGS if set
archs = re.findall(r"-arch (\S+)", os.environ.get("ARCHFLAGS", ""))
if archs:
cmake_args += ["-DCMAKE_OSX_ARCHITECTURES={}".format(";".join(archs))]


# Set CMAKE_BUILD_PARALLEL_LEVEL to control the parallel build level
# across all generators.
Expand Down

0 comments on commit 70f90a2

Please sign in to comment.