From 26bdfcf8938740a129cdae8b34106e9a6c34ede9 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 1 Sep 2020 15:50:42 -0400 Subject: [PATCH 01/66] Add CI wheel builds --- .github/workflows/release.yml | 59 +++++ tools/openblas_support.py | 410 ++++++++++++++++++++++++++++++++++ 2 files changed, 469 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 tools/openblas_support.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..eec1704f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +--- +name: Build + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.7' + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==1.5.5 + + - name: Install Visual C++ for Python 2.7 + if: runner.os == 'Windows' + run: | + choco install vcpython27 -f -y + - name: Install OpenBLAS Windows + if: runner.os == 'Windows' + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + # Download and get the path to "openblas.a". We cannot copy it + # to $PYTHON_EXE's directory since that is on a different drive which + # mingw does not like. Instead copy it to a directory and set OPENBLAS, + # since OPENBLAS will be picked up by the openblas discovery + $target = $(python tools/openblas_support.py) + mkdir openblas + echo "Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a" + cp $target openblas/openblas$env:OPENBLAS_SUFFIX.a + If ( Test-Path env:NPY_USE_BLAS_ILP64 ){ + echo "##vso[task.setvariable variable=OPENBLAS64_]$pwd\openblas" + } else { + echo "##vso[task.setvariable variable=OPENBLAS]$pwd\openblas" + } + - name: Build wheels + run: | + python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_SKIP: "cp27-* cp34-* pp*" + CIBW_BEFORE_ALL_LINUX_LINUX: "yum install -y openblas-devel" + CIBW_BEFORE_ALL_MACOS: "brew install openblas" + CIBW_BEFORE_ALL_WINDOWS: "python3 tools/openblas_support.py" + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl diff --git a/tools/openblas_support.py b/tools/openblas_support.py new file mode 100644 index 00000000..fa105de7 --- /dev/null +++ b/tools/openblas_support.py @@ -0,0 +1,410 @@ +# This script was forked from the numpy repo: +# https://github.com/numpy/numpy/blob/cfb7a9c5366241c39c9b20383370bce619c815b8/tools/openblas_support.py + +import glob +import hashlib +import os +import platform +import sys +import shutil +import tarfile +import textwrap +import zipfile + +from tempfile import mkstemp, gettempdir +from urllib.request import urlopen, Request +from urllib.error import HTTPError + +OPENBLAS_V = '0.3.10' +# Temporary build of OpenBLAS to test a fix for dynamic detection of CPU +OPENBLAS_LONG = 'v0.3.9-452-g349b722d' +BASE_LOC = 'https://anaconda.org/multibuild-wheels-staging/openblas-libs' +BASEURL = f'{BASE_LOC}/{OPENBLAS_LONG}/download' +ARCHITECTURES = ['', 'windows', 'darwin', 'aarch64', 'x86_64', + 'i686', 'ppc64le', 's390x'] +sha256_vals = { + "openblas-v0.3.7-527-g79fd006c-win_amd64-gcc_7_1_0.zip": + "7249d68c02e6b6339e06edfeab1fecddf29ee1e67a3afaa77917c320c43de840", + "openblas64_-v0.3.7-527-g79fd006c-win_amd64-gcc_7_1_0.zip": + "6488e0961a5926e47242f63b63b41cfdd661e6f1d267e8e313e397cde4775c17", + "openblas-v0.3.7-527-g79fd006c-win32-gcc_7_1_0.zip": + "5fb0867ca70b1d0fdbf68dd387c0211f26903d74631420e4aabb49e94aa3930d", + "openblas-v0.3.7-527-g79fd006c-macosx_10_9_x86_64-gf_1becaaa.tar.gz": + "69434bd626bbc495da9ce8c36b005d140c75e3c47f94e88c764a199e820f9259", + "openblas64_-v0.3.7-527-g79fd006c-macosx_10_9_x86_64-gf_1becaaa.tar.gz": + "093f6d953e3fa76a86809be67bd1f0b27656671b5a55b233169cfaa43fd63e22", + "openblas-v0.3.7-527-g79fd006c-manylinux2014_aarch64.tar.gz": + "42676c69dc48cd6e412251b39da6b955a5a0e00323ddd77f9137f7c259d35319", + "openblas64_-v0.3.7-527-g79fd006c-manylinux2014_aarch64.tar.gz": + "5aec167af4052cf5e9e3e416c522d9794efabf03a2aea78b9bb3adc94f0b73d8", + "openblas-v0.3.7-527-g79fd006c-manylinux2010_x86_64.tar.gz": + "fa67c6cc29d4cc5c70a147c80526243239a6f95fc3feadcf83a78176cd9c526b", + "openblas64_-v0.3.7-527-g79fd006c-manylinux2010_x86_64.tar.gz": + "9ad34e89a5307dcf5823bf5c020580d0559a0c155fe85b44fc219752e61852b0", + "openblas-v0.3.7-527-g79fd006c-manylinux2010_i686.tar.gz": + "0b8595d316c8b7be84ab1f1d5a0c89c1b35f7c987cdaf61d441bcba7ab4c7439", + "openblas-v0.3.7-527-g79fd006c-manylinux2014_ppc64le.tar.gz": + "3e1c7d6472c34e7210e3605be4bac9ddd32f613d44297dc50cf2d067e720c4a9", + "openblas64_-v0.3.7-527-g79fd006c-manylinux2014_ppc64le.tar.gz": + "a0885873298e21297a04be6cb7355a585df4fa4873e436b4c16c0a18fc9073ea", + "openblas-v0.3.7-527-g79fd006c-manylinux2014_s390x.tar.gz": + "79b454320817574e20499d58f05259ed35213bea0158953992b910607b17f240", + "openblas64_-v0.3.7-527-g79fd006c-manylinux2014_s390x.tar.gz": + "9fddbebf5301518fc4a5d2022a61886544a0566868c8c014359a1ee6b17f2814", + "openblas-v0.3.7-527-g79fd006c-manylinux1_i686.tar.gz": + "24fb92684ec4676185fff5c9340f50c3db6075948bcef760e9c715a8974e4680", + "openblas-v0.3.7-527-g79fd006c-manylinux1_x86_64.tar.gz": + "ebb8236b57a1b4075fd5cdc3e9246d2900c133a42482e5e714d1e67af5d00e62", + "openblas-v0.3.10-win_amd64-gcc_7_1_0.zip": + "e5356a2aa4aa7ed9233b2ca199fdd445f55ba227f004ebc63071dfa2426e9b09", + "openblas64_-v0.3.10-win_amd64-gcc_7_1_0.zip": + "aea3f9c8bdfe0b837f0d2739a6c755b12b6838f6c983e4ede71b4e1b576e6e77", + "openblas-v0.3.10-win32-gcc_7_1_0.zip": + "af1ad3172b23f7c6ef2234151a71d3be4d92010dad4dfb25d07cf5a20f009202", + "openblas64_-v0.3.10-macosx_10_9_x86_64-gf_1becaaa.tar.gz": + "38b61c58d63048731d6884fea7b63f8cbd610e85b138c6bac0e39fd77cd4699b", + "openblas-v0.3.10-manylinux2014_aarch64.tar.gz": + "c4444b9836ec26f7772fae02851961bf73177ff2aa436470e56fab8a1ef8d405", + "openblas-v0.3.10-manylinux2010_x86_64.tar.gz": + "cb7988c4a015aece9c49b1169f51c4ac2287fb9aab8114c8ab67792138ffc85e", + "openblas-v0.3.10-manylinux2010_i686.tar.gz": + "dc637801dd80ebd6394ea8b4a97f8858e4224870ea9214de08bebbdddd8e206e", + "openblas-v0.3.10-manylinux1_x86_64.tar.gz": + "ec1f9e9b2a62d5cb9e2634b88ee2da7cb6b07702d5a0e8b190d680a31adfa23a", + "openblas-v0.3.10-manylinux1_i686.tar.gz": + "b13d9d14e6bd452c0fbadb5cd5fda05b98b1e14043edb13ead90694d4cc07f0e", + "openblas-v0.3.10-manylinux2014_ppc64le.tar.gz": + "1cbc8176986099cf0cbb8f64968d5a14880d602d4b3c59a91d75b69b8760cde3", + "openblas-v0.3.10-manylinux2014_s390x.tar.gz": + "fa6722f0b12507ab0a65f38501ed8435b573df0adc0b979f47cdc4c9e9599475", + "openblas-v0.3.10-macosx_10_9_x86_64-gf_1becaaa.tar.gz": + "c6940b5133e687ae7a4f9c7c794f6a6d92b619cf41e591e5db07aab5da118199", + "openblas64_-v0.3.10-manylinux2014_s390x.tar.gz": + "e0347dd6f3f3a27d2f5e76d382e8a4a68e2e92f5f6a10e54ef65c7b14b44d0e8", + "openblas64_-v0.3.10-manylinux2014_ppc64le.tar.gz": + "4b96a51ac767ec0aabb821c61bcd3420e82e987fc93f7e1f85aebb2a845694eb", + "openblas64_-v0.3.10-manylinux2010_x86_64.tar.gz": + "f68fea21fbc73d06b7566057cad2ed8c7c0eb71fabf9ed8a609f86e5bc60ce5e", + "openblas64_-v0.3.10-manylinux2014_aarch64.tar.gz": + "15e6eed8cb0df8b88e52baa136ffe1769c517e9de7bcdfd81ec56420ae1069e9", + "openblas64_-v0.3.10-win_amd64-gcc_7_1_0.zip": + "aea3f9c8bdfe0b837f0d2739a6c755b12b6838f6c983e4ede71b4e1b576e6e77", +} + + +IS_32BIT = sys.maxsize < 2**32 + + +def get_arch(): + if platform.system() == 'Windows': + ret = 'windows' + elif platform.system() == 'Darwin': + ret = 'darwin' + else: + ret = platform.uname().machine + # What do 32 bit machines report? + # If they are a docker, they can report x86_64 + if 'x86' in ret and IS_32BIT: + ret = 'i686' + assert ret in ARCHITECTURES, f'invalid architecture {ret}' + return ret + + +def get_ilp64(): + if os.environ.get("NPY_USE_BLAS_ILP64", "0") == "0": + return None + if IS_32BIT: + raise RuntimeError("NPY_USE_BLAS_ILP64 set on 32-bit arch") + return "64_" + + +def get_manylinux(arch): + if arch in ('x86_64', 'i686'): + default = '2010' + else: + default = '2014' + ret = os.environ.get("MB_ML_VER", default) + # XXX For PEP 600 this can be a glibc version + assert ret in ('1', '2010', '2014'), f'invalid MB_ML_VER {ret}' + return ret + + +def download_openblas(target, arch, ilp64, is_32bit): + ml_ver = get_manylinux(arch) + fnsuffix = {None: "", "64_": "64_"}[ilp64] + filename = '' + headers = {'User-Agent': + ('Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 ; ' + '(KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.3')} + if arch in ('aarch64', 'ppc64le', 's390x', 'x86_64', 'i686'): + suffix = f'manylinux{ml_ver}_{arch}.tar.gz' + filename = f'{BASEURL}/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' + typ = 'tar.gz' + elif arch == 'darwin': + suffix = 'macosx_10_9_x86_64-gf_1becaaa.tar.gz' + filename = f'{BASEURL}/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' + typ = 'tar.gz' + elif arch == 'windows': + if is_32bit: + suffix = 'win32-gcc_7_1_0.zip' + else: + suffix = 'win_amd64-gcc_7_1_0.zip' + filename = f'{BASEURL}/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' + typ = 'zip' + if not filename: + return None + req = Request(url=filename, headers=headers) + try: + response = urlopen(req) + except HTTPError: + print(f'Could not download "{filename}"', file=sys.stderr) + raise + length = response.getheader('content-length') + if response.status != 200: + print(f'Could not download "{filename}"', file=sys.stderr) + return None + print(f"Downloading {length} from {filename}", file=sys.stderr) + data = response.read() + # Verify hash + key = os.path.basename(filename) + sha256_returned = hashlib.sha256(data).hexdigest() + if 0: + if key not in sha256_vals: + raise ValueError( + f'\nkey "{key}" with hash "{sha256_returned}" not in sha256_vals\n') + sha256_expected = sha256_vals[key] + if sha256_returned != sha256_expected: + # print(f'\nkey "{key}" with hash "{sha256_returned}" mismatch\n') + raise ValueError(f'sha256 hash mismatch for filename {filename}') + print("Saving to file", file=sys.stderr) + with open(target, 'wb') as fid: + fid.write(data) + return typ + + +def setup_openblas(arch=get_arch(), ilp64=get_ilp64(), is_32bit=IS_32BIT): + ''' + Download and setup an openblas library for building. If successful, + the configuration script will find it automatically. + + Returns + ------- + msg : str + path to extracted files on success, otherwise indicates what went wrong + To determine success, do ``os.path.exists(msg)`` + ''' + _, tmp = mkstemp() + if not arch: + raise ValueError('unknown architecture') + typ = download_openblas(tmp, arch, ilp64, is_32bit) + if not typ: + return '' + if arch == 'windows': + if not typ == 'zip': + return f'expecting to download zipfile on windows, not {typ}' + return unpack_windows_zip(tmp) + else: + if not typ == 'tar.gz': + return 'expecting to download tar.gz, not %s' % str(typ) + return unpack_targz(tmp) + + +def unpack_windows_zip(fname): + with zipfile.ZipFile(fname, 'r') as zf: + # Get the openblas.a file, but not openblas.dll.a nor openblas.dev.a + lib = [x for x in zf.namelist() if OPENBLAS_LONG in x and + x.endswith('a') and not x.endswith('dll.a') and + not x.endswith('dev.a')] + if not lib: + return 'could not find libopenblas_%s*.a ' \ + 'in downloaded zipfile' % OPENBLAS_LONG + target = os.path.join(gettempdir(), 'openblas.a') + with open(target, 'wb') as fid: + fid.write(zf.read(lib[0])) + return target + + +def unpack_targz(fname): + target = os.path.join(gettempdir(), 'openblas') + if not os.path.exists(target): + os.mkdir(target) + with tarfile.open(fname, 'r') as zf: + # Strip common prefix from paths when unpacking + prefix = os.path.commonpath(zf.getnames()) + extract_tarfile_to(zf, target, prefix) + return target + + +def extract_tarfile_to(tarfileobj, target_path, archive_path): + """Extract TarFile contents under archive_path/ to target_path/""" + + target_path = os.path.abspath(target_path) + + def get_members(): + for member in tarfileobj.getmembers(): + if archive_path: + norm_path = os.path.normpath(member.name) + if norm_path.startswith(archive_path + os.path.sep): + member.name = norm_path[len(archive_path)+1:] + else: + continue + + dst_path = os.path.abspath(os.path.join(target_path, member.name)) + if os.path.commonpath([target_path, dst_path]) != target_path: + # Path not under target_path, probably contains ../ + continue + + yield member + + tarfileobj.extractall(target_path, members=get_members()) + + +def make_init(dirname): + ''' + Create a _distributor_init.py file for OpenBlas + ''' + with open(os.path.join(dirname, '_distributor_init.py'), 'wt') as fid: + fid.write(textwrap.dedent(""" + ''' + Helper to preload windows dlls to prevent dll not found errors. + Once a DLL is preloaded, its namespace is made available to any + subsequent DLL. This file originated in the numpy-wheels repo, + and is created as part of the scripts that build the wheel. + ''' + import os + import glob + if os.name == 'nt': + # convention for storing / loading the DLL from + # numpy/.libs/, if present + try: + from ctypes import WinDLL + basedir = os.path.dirname(__file__) + except: + pass + else: + libs_dir = os.path.abspath(os.path.join(basedir, '.libs')) + DLL_filenames = [] + if os.path.isdir(libs_dir): + for filename in glob.glob(os.path.join(libs_dir, + '*openblas*dll')): + # NOTE: would it change behavior to load ALL + # DLLs at this path vs. the name restriction? + WinDLL(os.path.abspath(filename)) + DLL_filenames.append(filename) + if len(DLL_filenames) > 1: + import warnings + warnings.warn("loaded more than 1 DLL from .libs:" + "\\n%s" % "\\n".join(DLL_filenames), + stacklevel=1) + """)) + + +def test_setup(arches): + ''' + Make sure all the downloadable files exist and can be opened + ''' + def items(): + """ yields all combinations of arch, ilp64, is_32bit + """ + for arch in arches: + yield arch, None, False + if arch not in ('i686',): + yield arch, '64_', False + if arch in ('windows',): + yield arch, None, True + if arch in ('i686', 'x86_64'): + oldval = os.environ.get('MB_ML_VER', None) + os.environ['MB_ML_VER'] = '1' + yield arch, None, False + # Once we create x86_64 and i686 manylinux2014 wheels... + # os.environ['MB_ML_VER'] = '2014' + # yield arch, None, False + if oldval: + os.environ['MB_ML_VER'] = oldval + else: + os.environ.pop('MB_ML_VER') + + errs = [] + for arch, ilp64, is_32bit in items(): + if arch == '': + continue + if arch not in arches: + continue + target = None + try: + try: + target = setup_openblas(arch, ilp64, is_32bit) + except Exception as e: + print(f'Could not setup {arch} with ilp64 {ilp64}, ' + f'32bit {is_32bit}:') + print(e) + errs.append(e) + continue + if not target: + raise RuntimeError(f'Could not setup {arch}') + print(target) + if arch == 'windows': + if not target.endswith('.a'): + raise RuntimeError("Not .a extracted!") + else: + files = glob.glob(os.path.join(target, "lib", "*.a")) + if not files: + raise RuntimeError("No lib/*.a unpacked!") + finally: + if target is not None: + if os.path.isfile(target): + os.unlink(target) + else: + shutil.rmtree(target) + if errs: + raise errs[0] + + +def test_version(expected_version, ilp64=get_ilp64()): + """ + Assert that expected OpenBLAS version is + actually available via NumPy + """ + import numpy + import ctypes + + dll = ctypes.CDLL(numpy.core._multiarray_umath.__file__) + if ilp64 == "64_": + get_config = dll.openblas_get_config64_ + else: + get_config = dll.openblas_get_config + get_config.restype = ctypes.c_char_p + res = get_config() + print('OpenBLAS get_config returned', str(res)) + if not expected_version: + expected_version = OPENBLAS_V + check_str = b'OpenBLAS %s' % expected_version.encode() + print(check_str) + assert check_str in res, f'{expected_version} not found in {res}' + if ilp64: + assert b"USE64BITINT" in res + else: + assert b"USE64BITINT" not in res + + +if __name__ == '__main__': + import argparse + parser = argparse.ArgumentParser( + description='Download and expand an OpenBLAS archive for this ' + 'architecture') + parser.add_argument('--test', nargs='*', default=None, + help='Test different architectures. "all", or any of ' + f'{ARCHITECTURES}') + parser.add_argument('--check_version', nargs='?', default='', + help='Check provided OpenBLAS version string ' + 'against available OpenBLAS') + args = parser.parse_args() + if args.check_version != '': + test_version(args.check_version) + elif args.test is None: + print(setup_openblas()) + else: + if len(args.test) == 0 or 'all' in args.test: + test_setup(ARCHITECTURES) + else: + test_setup(args.test) From a4c39db7e63886e82e363364d807593d209534e9 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 1 Sep 2020 15:53:56 -0400 Subject: [PATCH 02/66] Fix some typos --- .github/workflows/release.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eec1704f..3052d17a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,19 +40,14 @@ jobs: mkdir openblas echo "Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a" cp $target openblas/openblas$env:OPENBLAS_SUFFIX.a - If ( Test-Path env:NPY_USE_BLAS_ILP64 ){ - echo "##vso[task.setvariable variable=OPENBLAS64_]$pwd\openblas" - } else { - echo "##vso[task.setvariable variable=OPENBLAS]$pwd\openblas" - } + echo "##vso[task.setvariable variable=OPENBLAS]$pwd\openblas" - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse env: CIBW_SKIP: "cp27-* cp34-* pp*" - CIBW_BEFORE_ALL_LINUX_LINUX: "yum install -y openblas-devel" + CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel" CIBW_BEFORE_ALL_MACOS: "brew install openblas" - CIBW_BEFORE_ALL_WINDOWS: "python3 tools/openblas_support.py" - uses: actions/upload-artifact@v2 with: From ca662047bc210bdaa398952459a2c6ac56bab9f0 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 1 Sep 2020 15:58:50 -0400 Subject: [PATCH 03/66] Add lapack --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3052d17a..d9d3c769 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,8 +46,9 @@ jobs: python -m cibuildwheel --output-dir wheelhouse env: CIBW_SKIP: "cp27-* cp34-* pp*" - CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel" - CIBW_BEFORE_ALL_MACOS: "brew install openblas" + CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" + CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" + CIBW_TEST_COMMAND: "nosetests test_scs_basic.py test_scs_rand.py test_scs_sdp.py test_scs_python_linsys.py" - uses: actions/upload-artifact@v2 with: From d49ab05cbb9adb102c5bc297fc9eb3c79c972f17 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 1 Sep 2020 16:12:21 -0400 Subject: [PATCH 04/66] Pull submodules too --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9d3c769..368f36b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + submodules: true - uses: actions/setup-python@v2 name: Install Python @@ -49,6 +51,7 @@ jobs: CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_TEST_COMMAND: "nosetests test_scs_basic.py test_scs_rand.py test_scs_sdp.py test_scs_python_linsys.py" + CIBW_TEST_REQUIRES: nose - uses: actions/upload-artifact@v2 with: From 9acfc0aeb74aba7b85572e7b7cd03ba42e84f6db Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 1 Sep 2020 16:18:45 -0400 Subject: [PATCH 05/66] Adjust test path --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 368f36b8..17be1e82 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: CIBW_SKIP: "cp27-* cp34-* pp*" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" - CIBW_TEST_COMMAND: "nosetests test_scs_basic.py test_scs_rand.py test_scs_sdp.py test_scs_python_linsys.py" + CIBW_TEST_COMMAND: "nosetests {project}/test_*.py" CIBW_TEST_REQUIRES: nose - uses: actions/upload-artifact@v2 From 4869f4516f77a88bb53c9e6bd398fccdbf0702d6 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 1 Sep 2020 16:23:23 -0400 Subject: [PATCH 06/66] Use a valid path --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 17be1e82..dd465866 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: CIBW_SKIP: "cp27-* cp34-* pp*" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" - CIBW_TEST_COMMAND: "nosetests {project}/test_*.py" + CIBW_TEST_COMMAND: "nosetests {project}/test/test_*.py" CIBW_TEST_REQUIRES: nose - uses: actions/upload-artifact@v2 From fbcec1defe65e86d4c219e27d44c423e6a055e83 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 1 Sep 2020 16:33:07 -0400 Subject: [PATCH 07/66] Try no wildcard for test path --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd465866..5f3b7cb0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,9 +50,8 @@ jobs: CIBW_SKIP: "cp27-* cp34-* pp*" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" - CIBW_TEST_COMMAND: "nosetests {project}/test/test_*.py" + CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl From f5d6022a42650aa226cf98b5823e038097669dd8 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 1 Sep 2020 16:45:03 -0400 Subject: [PATCH 08/66] Try no openblas windows --- .github/workflows/release.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f3b7cb0..a2c5d4d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,20 +29,20 @@ jobs: if: runner.os == 'Windows' run: | choco install vcpython27 -f -y - - name: Install OpenBLAS Windows - if: runner.os == 'Windows' - shell: pwsh - run: | - $ErrorActionPreference = "Stop" - # Download and get the path to "openblas.a". We cannot copy it - # to $PYTHON_EXE's directory since that is on a different drive which - # mingw does not like. Instead copy it to a directory and set OPENBLAS, - # since OPENBLAS will be picked up by the openblas discovery - $target = $(python tools/openblas_support.py) - mkdir openblas - echo "Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a" - cp $target openblas/openblas$env:OPENBLAS_SUFFIX.a - echo "##vso[task.setvariable variable=OPENBLAS]$pwd\openblas" +# - name: Install OpenBLAS Windows +# if: runner.os == 'Windows' +# shell: pwsh +# run: | +# $ErrorActionPreference = "Stop" +# # Download and get the path to "openblas.a". We cannot copy it +# # to $PYTHON_EXE's directory since that is on a different drive which +# # mingw does not like. Instead copy it to a directory and set OPENBLAS, +# # since OPENBLAS will be picked up by the openblas discovery +# $target = $(python tools/openblas_support.py) +# mkdir openblas +# echo "Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a" +# cp $target openblas/openblas$env:OPENBLAS_SUFFIX.a +# echo "##vso[task.setvariable variable=OPENBLAS]$pwd\openblas" - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -50,6 +50,7 @@ jobs: CIBW_SKIP: "cp27-* cp34-* pp*" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" + CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - uses: actions/upload-artifact@v2 From 19968d8d4c0e8a6b34166c74473759e8fd5d2bf8 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 1 Sep 2020 16:54:09 -0400 Subject: [PATCH 09/66] Disable win32 builds --- .github/workflows/release.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2c5d4d0..dbf484cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,25 +29,25 @@ jobs: if: runner.os == 'Windows' run: | choco install vcpython27 -f -y -# - name: Install OpenBLAS Windows -# if: runner.os == 'Windows' -# shell: pwsh -# run: | -# $ErrorActionPreference = "Stop" -# # Download and get the path to "openblas.a". We cannot copy it -# # to $PYTHON_EXE's directory since that is on a different drive which -# # mingw does not like. Instead copy it to a directory and set OPENBLAS, -# # since OPENBLAS will be picked up by the openblas discovery -# $target = $(python tools/openblas_support.py) -# mkdir openblas -# echo "Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a" -# cp $target openblas/openblas$env:OPENBLAS_SUFFIX.a -# echo "##vso[task.setvariable variable=OPENBLAS]$pwd\openblas" + - name: Install OpenBLAS Windows + if: runner.os == 'Windows' + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + # Download and get the path to "openblas.a". We cannot copy it + # to $PYTHON_EXE's directory since that is on a different drive which + # mingw does not like. Instead copy it to a directory and set OPENBLAS, + # since OPENBLAS will be picked up by the openblas discovery + $target = $(python tools/openblas_support.py) + mkdir openblas + echo "Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a" + cp $target openblas/openblas$env:OPENBLAS_SUFFIX.a + echo "##vso[task.setvariable variable=OPENBLAS]$pwd\openblas" - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "cp27-* cp34-* pp*" + CIBW_SKIP: "cp27-* cp34-* pp* *win32" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" From 123bfbc86199b425b4b1b07976f22efc42c0f2cd Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:33:28 -0400 Subject: [PATCH 10/66] Update openblas install workflow --- .github/workflows/release.yml | 33 ++-- tools/openblas_support.py | 300 ++++++++++++---------------------- 2 files changed, 118 insertions(+), 215 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbf484cf..5efd6d98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,26 +23,28 @@ jobs: - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==1.5.5 - - - name: Install Visual C++ for Python 2.7 + python -m pip install cibuildwheel==1.6.1 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.0.1 if: runner.os == 'Windows' - run: | - choco install vcpython27 -f -y - name: Install OpenBLAS Windows if: runner.os == 'Windows' shell: pwsh run: | - $ErrorActionPreference = "Stop" - # Download and get the path to "openblas.a". We cannot copy it - # to $PYTHON_EXE's directory since that is on a different drive which - # mingw does not like. Instead copy it to a directory and set OPENBLAS, - # since OPENBLAS will be picked up by the openblas discovery - $target = $(python tools/openblas_support.py) - mkdir openblas - echo "Copying $target to openblas/openblas$env:OPENBLAS_SUFFIX.a" - cp $target openblas/openblas$env:OPENBLAS_SUFFIX.a - echo "##vso[task.setvariable variable=OPENBLAS]$pwd\openblas" + $pyversion = python -c "import sys; print(sys.version.split()[0])" + Write-Host "Python Version: $pyversion" + function Download-OpenBLAS($ilp64) { + $target_name = "openblas.a" } + $target = "$(HOME)\openblaslib\$target_name" + Write-Host "target path: $target" + $old_value = $env:NPY_USE_BLAS_ILP64 + $env:NPY_USE_BLAS_ILP64 = $ilp64 + $openblas = python tools/openblas_support.py + $env:NPY_USE_BLAS_ILP64 = $old_value + cp $openblas $target + } + mkdir $(OPENBLAS) + Download-OpenBLAS('0') - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -52,6 +54,7 @@ jobs: CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" CIBW_TEST_COMMAND: "nosetests {project}/test" + CIBW_ENVIRONMENT_WINDOWS: "OPENBLAS=$(HOME)\openblaslib" CIBW_TEST_REQUIRES: nose - uses: actions/upload-artifact@v2 with: diff --git a/tools/openblas_support.py b/tools/openblas_support.py index fa105de7..4c57f160 100644 --- a/tools/openblas_support.py +++ b/tools/openblas_support.py @@ -1,100 +1,44 @@ -# This script was forked from the numpy repo: -# https://github.com/numpy/numpy/blob/cfb7a9c5366241c39c9b20383370bce619c815b8/tools/openblas_support.py - -import glob -import hashlib import os -import platform import sys +import glob import shutil -import tarfile import textwrap -import zipfile +import platform +import hashlib from tempfile import mkstemp, gettempdir from urllib.request import urlopen, Request from urllib.error import HTTPError +import zipfile +import tarfile -OPENBLAS_V = '0.3.10' -# Temporary build of OpenBLAS to test a fix for dynamic detection of CPU -OPENBLAS_LONG = 'v0.3.9-452-g349b722d' -BASE_LOC = 'https://anaconda.org/multibuild-wheels-staging/openblas-libs' -BASEURL = f'{BASE_LOC}/{OPENBLAS_LONG}/download' -ARCHITECTURES = ['', 'windows', 'darwin', 'aarch64', 'x86_64', - 'i686', 'ppc64le', 's390x'] +OPENBLAS_V = 'v0.3.9' +OPENBLAS_LONG = 'v0.3.9' +BASE_LOC = '' +ANACONDA = 'https://anaconda.org/multibuild-wheels-staging/openblas-libs' +ARCHITECTURES = ['', 'windows', 'darwin', 'aarch64', 'x86', 'ppc64le', 's390x'] sha256_vals = { - "openblas-v0.3.7-527-g79fd006c-win_amd64-gcc_7_1_0.zip": - "7249d68c02e6b6339e06edfeab1fecddf29ee1e67a3afaa77917c320c43de840", - "openblas64_-v0.3.7-527-g79fd006c-win_amd64-gcc_7_1_0.zip": - "6488e0961a5926e47242f63b63b41cfdd661e6f1d267e8e313e397cde4775c17", - "openblas-v0.3.7-527-g79fd006c-win32-gcc_7_1_0.zip": - "5fb0867ca70b1d0fdbf68dd387c0211f26903d74631420e4aabb49e94aa3930d", - "openblas-v0.3.7-527-g79fd006c-macosx_10_9_x86_64-gf_1becaaa.tar.gz": - "69434bd626bbc495da9ce8c36b005d140c75e3c47f94e88c764a199e820f9259", - "openblas64_-v0.3.7-527-g79fd006c-macosx_10_9_x86_64-gf_1becaaa.tar.gz": - "093f6d953e3fa76a86809be67bd1f0b27656671b5a55b233169cfaa43fd63e22", - "openblas-v0.3.7-527-g79fd006c-manylinux2014_aarch64.tar.gz": - "42676c69dc48cd6e412251b39da6b955a5a0e00323ddd77f9137f7c259d35319", - "openblas64_-v0.3.7-527-g79fd006c-manylinux2014_aarch64.tar.gz": - "5aec167af4052cf5e9e3e416c522d9794efabf03a2aea78b9bb3adc94f0b73d8", - "openblas-v0.3.7-527-g79fd006c-manylinux2010_x86_64.tar.gz": - "fa67c6cc29d4cc5c70a147c80526243239a6f95fc3feadcf83a78176cd9c526b", - "openblas64_-v0.3.7-527-g79fd006c-manylinux2010_x86_64.tar.gz": - "9ad34e89a5307dcf5823bf5c020580d0559a0c155fe85b44fc219752e61852b0", - "openblas-v0.3.7-527-g79fd006c-manylinux2010_i686.tar.gz": - "0b8595d316c8b7be84ab1f1d5a0c89c1b35f7c987cdaf61d441bcba7ab4c7439", - "openblas-v0.3.7-527-g79fd006c-manylinux2014_ppc64le.tar.gz": - "3e1c7d6472c34e7210e3605be4bac9ddd32f613d44297dc50cf2d067e720c4a9", - "openblas64_-v0.3.7-527-g79fd006c-manylinux2014_ppc64le.tar.gz": - "a0885873298e21297a04be6cb7355a585df4fa4873e436b4c16c0a18fc9073ea", - "openblas-v0.3.7-527-g79fd006c-manylinux2014_s390x.tar.gz": - "79b454320817574e20499d58f05259ed35213bea0158953992b910607b17f240", - "openblas64_-v0.3.7-527-g79fd006c-manylinux2014_s390x.tar.gz": - "9fddbebf5301518fc4a5d2022a61886544a0566868c8c014359a1ee6b17f2814", - "openblas-v0.3.7-527-g79fd006c-manylinux1_i686.tar.gz": - "24fb92684ec4676185fff5c9340f50c3db6075948bcef760e9c715a8974e4680", - "openblas-v0.3.7-527-g79fd006c-manylinux1_x86_64.tar.gz": - "ebb8236b57a1b4075fd5cdc3e9246d2900c133a42482e5e714d1e67af5d00e62", - "openblas-v0.3.10-win_amd64-gcc_7_1_0.zip": - "e5356a2aa4aa7ed9233b2ca199fdd445f55ba227f004ebc63071dfa2426e9b09", - "openblas64_-v0.3.10-win_amd64-gcc_7_1_0.zip": - "aea3f9c8bdfe0b837f0d2739a6c755b12b6838f6c983e4ede71b4e1b576e6e77", - "openblas-v0.3.10-win32-gcc_7_1_0.zip": - "af1ad3172b23f7c6ef2234151a71d3be4d92010dad4dfb25d07cf5a20f009202", - "openblas64_-v0.3.10-macosx_10_9_x86_64-gf_1becaaa.tar.gz": - "38b61c58d63048731d6884fea7b63f8cbd610e85b138c6bac0e39fd77cd4699b", - "openblas-v0.3.10-manylinux2014_aarch64.tar.gz": - "c4444b9836ec26f7772fae02851961bf73177ff2aa436470e56fab8a1ef8d405", - "openblas-v0.3.10-manylinux2010_x86_64.tar.gz": - "cb7988c4a015aece9c49b1169f51c4ac2287fb9aab8114c8ab67792138ffc85e", - "openblas-v0.3.10-manylinux2010_i686.tar.gz": - "dc637801dd80ebd6394ea8b4a97f8858e4224870ea9214de08bebbdddd8e206e", - "openblas-v0.3.10-manylinux1_x86_64.tar.gz": - "ec1f9e9b2a62d5cb9e2634b88ee2da7cb6b07702d5a0e8b190d680a31adfa23a", - "openblas-v0.3.10-manylinux1_i686.tar.gz": - "b13d9d14e6bd452c0fbadb5cd5fda05b98b1e14043edb13ead90694d4cc07f0e", - "openblas-v0.3.10-manylinux2014_ppc64le.tar.gz": - "1cbc8176986099cf0cbb8f64968d5a14880d602d4b3c59a91d75b69b8760cde3", - "openblas-v0.3.10-manylinux2014_s390x.tar.gz": - "fa6722f0b12507ab0a65f38501ed8435b573df0adc0b979f47cdc4c9e9599475", - "openblas-v0.3.10-macosx_10_9_x86_64-gf_1becaaa.tar.gz": - "c6940b5133e687ae7a4f9c7c794f6a6d92b619cf41e591e5db07aab5da118199", - "openblas64_-v0.3.10-manylinux2014_s390x.tar.gz": - "e0347dd6f3f3a27d2f5e76d382e8a4a68e2e92f5f6a10e54ef65c7b14b44d0e8", - "openblas64_-v0.3.10-manylinux2014_ppc64le.tar.gz": - "4b96a51ac767ec0aabb821c61bcd3420e82e987fc93f7e1f85aebb2a845694eb", - "openblas64_-v0.3.10-manylinux2010_x86_64.tar.gz": - "f68fea21fbc73d06b7566057cad2ed8c7c0eb71fabf9ed8a609f86e5bc60ce5e", - "openblas64_-v0.3.10-manylinux2014_aarch64.tar.gz": - "15e6eed8cb0df8b88e52baa136ffe1769c517e9de7bcdfd81ec56420ae1069e9", - "openblas64_-v0.3.10-win_amd64-gcc_7_1_0.zip": - "aea3f9c8bdfe0b837f0d2739a6c755b12b6838f6c983e4ede71b4e1b576e6e77", +'openblas64_-v0.3.9-macosx_10_9_x86_64-gf_1becaaa.tar.gz': +'53f606a7da75d390287f1c51b2af7866b8fe7553a26d2474f827daf0e5c8a886', +'openblas64_-v0.3.9-manylinux1_x86_64.tar.gz': +'6fe5b1e2a4baa16833724bcc94a80b22e9c99fc1b9a2ddbce4f1f82a8002d906', +'openblas64_-v0.3.9-win_amd64-gcc_7_1_0.zip': +'15d24a66c5b22cc7b3120e831658f491c7a063804c33813235044a6f8b56686d', +'openblas-v0.3.9-macosx_10_9_x86_64-gf_1becaaa.tar.gz': +'8221397b9cfb8cb22f3efb7f228ef901e13f9fd89c7d7d0cb7b8a79b0610bf33', +'openblas-v0.3.9-manylinux1_i686.tar.gz': +'31abf8eccb697a320a998ce0f59045edc964602f815d78690c5a23839819261c', +'openblas-v0.3.9-manylinux1_x86_64.tar.gz': +'d9c39acbafae9b1daef19c2738ec938109a59e9322f93eb9a3c50869d220deff', +'openblas-v0.3.9-win32-gcc_7_1_0.zip': +'69a7dc265e8a8e45b358637d11cb1710ce88c4456634c7ce37d429b1d9bc9aaa', +'openblas-v0.3.9-win_amd64-gcc_7_1_0.zip': +'0cea06f4a2afebaa6255854f73f237802fc6b58eaeb1a8b1c22d87cc399e0d48', +'openblas-v0.3.9-manylinux2014_aarch64.tar.gz': +'10d5ef5e9e19af5c199b59a17f43763e0c85ecf13cbc8f2d91e076f7847cdb5e' } - IS_32BIT = sys.maxsize < 2**32 - - def get_arch(): if platform.system() == 'Windows': ret = 'windows' @@ -103,13 +47,12 @@ def get_arch(): else: ret = platform.uname().machine # What do 32 bit machines report? - # If they are a docker, they can report x86_64 - if 'x86' in ret and IS_32BIT: - ret = 'i686' - assert ret in ARCHITECTURES, f'invalid architecture {ret}' + # If they are a docker, they report x86_64 or i686 + if 'x86' in ret or ret == 'i686': + ret = 'x86' + assert ret in ARCHITECTURES return ret - def get_ilp64(): if os.environ.get("NPY_USE_BLAS_ILP64", "0") == "0": return None @@ -117,72 +60,57 @@ def get_ilp64(): raise RuntimeError("NPY_USE_BLAS_ILP64 set on 32-bit arch") return "64_" - -def get_manylinux(arch): - if arch in ('x86_64', 'i686'): - default = '2010' - else: - default = '2014' - ret = os.environ.get("MB_ML_VER", default) - # XXX For PEP 600 this can be a glibc version - assert ret in ('1', '2010', '2014'), f'invalid MB_ML_VER {ret}' - return ret - - -def download_openblas(target, arch, ilp64, is_32bit): - ml_ver = get_manylinux(arch) +def download_openblas(target, arch, ilp64): fnsuffix = {None: "", "64_": "64_"}[ilp64] filename = '' - headers = {'User-Agent': - ('Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 ; ' - '(KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.3')} - if arch in ('aarch64', 'ppc64le', 's390x', 'x86_64', 'i686'): - suffix = f'manylinux{ml_ver}_{arch}.tar.gz' - filename = f'{BASEURL}/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' + if arch in ('aarch64', 'ppc64le', 's390x'): + suffix = f'manylinux2014_{arch}.tar.gz' + filename = f'{ANACONDA}/{OPENBLAS_LONG}/download/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' + typ = 'tar.gz' typ = 'tar.gz' elif arch == 'darwin': suffix = 'macosx_10_9_x86_64-gf_1becaaa.tar.gz' - filename = f'{BASEURL}/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' + filename = f'{ANACONDA}/{OPENBLAS_LONG}/download/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' typ = 'tar.gz' elif arch == 'windows': - if is_32bit: + if IS_32BIT: suffix = 'win32-gcc_7_1_0.zip' else: suffix = 'win_amd64-gcc_7_1_0.zip' - filename = f'{BASEURL}/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' + filename = f'{ANACONDA}/{OPENBLAS_LONG}/download/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' typ = 'zip' + elif 'x86' in arch: + if IS_32BIT: + suffix = 'manylinux1_i686.tar.gz' + else: + suffix = 'manylinux1_x86_64.tar.gz' + filename = f'{ANACONDA}/{OPENBLAS_LONG}/download/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' + typ = 'tar.gz' if not filename: return None - req = Request(url=filename, headers=headers) + print("Downloading:", filename, file=sys.stderr) try: - response = urlopen(req) - except HTTPError: - print(f'Could not download "{filename}"', file=sys.stderr) - raise - length = response.getheader('content-length') - if response.status != 200: - print(f'Could not download "{filename}"', file=sys.stderr) + with open(target, 'wb') as fid: + # anaconda.org download location guards against + # scraping so trick it with a fake browser header + # see: https://medium.com/@speedforcerun/python-crawler-http-error-403-forbidden-1623ae9ba0f + headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.3'} + req = Request(url=filename, headers=headers) + fid.write(urlopen(req).read()) + with open(target, 'rb') as binary_to_check: + data = binary_to_check.read() + sha256_returned = hashlib.sha256(data).hexdigest() + sha256_expected = sha256_vals[os.path.basename(filename)] + if sha256_returned != sha256_expected: + raise ValueError('sha256 hash mismatch for downloaded OpenBLAS') + + except HTTPError as e: + print(f'Could not download "{filename}"') + print(f'Error message: {e}') return None - print(f"Downloading {length} from {filename}", file=sys.stderr) - data = response.read() - # Verify hash - key = os.path.basename(filename) - sha256_returned = hashlib.sha256(data).hexdigest() - if 0: - if key not in sha256_vals: - raise ValueError( - f'\nkey "{key}" with hash "{sha256_returned}" not in sha256_vals\n') - sha256_expected = sha256_vals[key] - if sha256_returned != sha256_expected: - # print(f'\nkey "{key}" with hash "{sha256_returned}" mismatch\n') - raise ValueError(f'sha256 hash mismatch for filename {filename}') - print("Saving to file", file=sys.stderr) - with open(target, 'wb') as fid: - fid.write(data) return typ - -def setup_openblas(arch=get_arch(), ilp64=get_ilp64(), is_32bit=IS_32BIT): +def setup_openblas(arch=get_arch(), ilp64=get_ilp64()): ''' Download and setup an openblas library for building. If successful, the configuration script will find it automatically. @@ -196,25 +124,24 @@ def setup_openblas(arch=get_arch(), ilp64=get_ilp64(), is_32bit=IS_32BIT): _, tmp = mkstemp() if not arch: raise ValueError('unknown architecture') - typ = download_openblas(tmp, arch, ilp64, is_32bit) + typ = download_openblas(tmp, arch, ilp64) if not typ: return '' if arch == 'windows': if not typ == 'zip': - return f'expecting to download zipfile on windows, not {typ}' + return 'expecting to download zipfile on windows, not %s' % str(typ) return unpack_windows_zip(tmp) else: if not typ == 'tar.gz': return 'expecting to download tar.gz, not %s' % str(typ) return unpack_targz(tmp) - def unpack_windows_zip(fname): with zipfile.ZipFile(fname, 'r') as zf: # Get the openblas.a file, but not openblas.dll.a nor openblas.dev.a lib = [x for x in zf.namelist() if OPENBLAS_LONG in x and - x.endswith('a') and not x.endswith('dll.a') and - not x.endswith('dev.a')] + x.endswith('a') and not x.endswith('dll.a') and + not x.endswith('dev.a')] if not lib: return 'could not find libopenblas_%s*.a ' \ 'in downloaded zipfile' % OPENBLAS_LONG @@ -223,7 +150,6 @@ def unpack_windows_zip(fname): fid.write(zf.read(lib[0])) return target - def unpack_targz(fname): target = os.path.join(gettempdir(), 'openblas') if not os.path.exists(target): @@ -234,7 +160,6 @@ def unpack_targz(fname): extract_tarfile_to(zf, target, prefix) return target - def extract_tarfile_to(tarfileobj, target_path, archive_path): """Extract TarFile contents under archive_path/ to target_path/""" @@ -258,7 +183,6 @@ def get_members(): tarfileobj.extractall(target_path, members=get_members()) - def make_init(dirname): ''' Create a _distributor_init.py file for OpenBlas @@ -272,12 +196,12 @@ def make_init(dirname): and is created as part of the scripts that build the wheel. ''' import os + from ctypes import WinDLL import glob if os.name == 'nt': # convention for storing / loading the DLL from # numpy/.libs/, if present try: - from ctypes import WinDLL basedir = os.path.dirname(__file__) except: pass @@ -286,60 +210,39 @@ def make_init(dirname): DLL_filenames = [] if os.path.isdir(libs_dir): for filename in glob.glob(os.path.join(libs_dir, - '*openblas*dll')): + '*openblas*dll')): # NOTE: would it change behavior to load ALL # DLLs at this path vs. the name restriction? WinDLL(os.path.abspath(filename)) DLL_filenames.append(filename) - if len(DLL_filenames) > 1: - import warnings - warnings.warn("loaded more than 1 DLL from .libs:" - "\\n%s" % "\\n".join(DLL_filenames), - stacklevel=1) + if len(DLL_filenames) > 1: + import warnings + warnings.warn("loaded more than 1 DLL from .libs:\\n%s" % + "\\n".join(DLL_filenames), + stacklevel=1) """)) - def test_setup(arches): ''' Make sure all the downloadable files exist and can be opened ''' def items(): - """ yields all combinations of arch, ilp64, is_32bit - """ for arch in arches: - yield arch, None, False - if arch not in ('i686',): - yield arch, '64_', False - if arch in ('windows',): - yield arch, None, True - if arch in ('i686', 'x86_64'): - oldval = os.environ.get('MB_ML_VER', None) - os.environ['MB_ML_VER'] = '1' - yield arch, None, False - # Once we create x86_64 and i686 manylinux2014 wheels... - # os.environ['MB_ML_VER'] = '2014' - # yield arch, None, False - if oldval: - os.environ['MB_ML_VER'] = oldval - else: - os.environ.pop('MB_ML_VER') + yield arch, None + if arch in ('x86', 'darwin', 'windows'): + yield arch, '64_' - errs = [] - for arch, ilp64, is_32bit in items(): + for arch, ilp64 in items(): if arch == '': continue - if arch not in arches: - continue + target = None try: try: - target = setup_openblas(arch, ilp64, is_32bit) - except Exception as e: - print(f'Could not setup {arch} with ilp64 {ilp64}, ' - f'32bit {is_32bit}:') - print(e) - errs.append(e) - continue + target = setup_openblas(arch, ilp64) + except Exception: + print(f'Could not setup {arch}') + raise if not target: raise RuntimeError(f'Could not setup {arch}') print(target) @@ -356,19 +259,17 @@ def items(): os.unlink(target) else: shutil.rmtree(target) - if errs: - raise errs[0] - def test_version(expected_version, ilp64=get_ilp64()): """ Assert that expected OpenBLAS version is - actually available via NumPy + actually available via SciPy """ - import numpy + import scipy + import scipy.linalg import ctypes - dll = ctypes.CDLL(numpy.core._multiarray_umath.__file__) + dll = ctypes.CDLL(scipy.linalg.cython_blas.__file__) if ilp64 == "64_": get_config = dll.openblas_get_config64_ else: @@ -376,11 +277,12 @@ def test_version(expected_version, ilp64=get_ilp64()): get_config.restype = ctypes.c_char_p res = get_config() print('OpenBLAS get_config returned', str(res)) - if not expected_version: - expected_version = OPENBLAS_V - check_str = b'OpenBLAS %s' % expected_version.encode() - print(check_str) - assert check_str in res, f'{expected_version} not found in {res}' + check_str = b'OpenBLAS %s' % expected_version[0].encode() + assert check_str in res + + if 'dev' not in expected_version[0]: + assert b'dev' not in res + if ilp64: assert b"USE64BITINT" in res else: @@ -393,13 +295,11 @@ def test_version(expected_version, ilp64=get_ilp64()): description='Download and expand an OpenBLAS archive for this ' 'architecture') parser.add_argument('--test', nargs='*', default=None, - help='Test different architectures. "all", or any of ' - f'{ARCHITECTURES}') - parser.add_argument('--check_version', nargs='?', default='', - help='Check provided OpenBLAS version string ' - 'against available OpenBLAS') + help='Test different architectures. "all", or any of %s' % ARCHITECTURES) + parser.add_argument('--check_version', nargs=1, default=None, + help='Check provided OpenBLAS version string against available OpenBLAS') args = parser.parse_args() - if args.check_version != '': + if args.check_version is not None: test_version(args.check_version) elif args.test is None: print(setup_openblas()) From 8c60a64d4cbce4e0d8cc14b248384f4231f5814d Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:34:18 -0400 Subject: [PATCH 11/66] Fix syntax issue --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5efd6d98..30c3f445 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -54,7 +54,7 @@ jobs: CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" CIBW_TEST_COMMAND: "nosetests {project}/test" - CIBW_ENVIRONMENT_WINDOWS: "OPENBLAS=$(HOME)\openblaslib" + CIBW_ENVIRONMENT_WINDOWS: "OPENBLAS=$(HOME)/openblaslib" CIBW_TEST_REQUIRES: nose - uses: actions/upload-artifact@v2 with: From 6ecb9fcae07ce6a4baf47dc09016ec5b46e1deb3 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:36:04 -0400 Subject: [PATCH 12/66] Fix typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30c3f445..11cd9a95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: $pyversion = python -c "import sys; print(sys.version.split()[0])" Write-Host "Python Version: $pyversion" function Download-OpenBLAS($ilp64) { - $target_name = "openblas.a" } + $target_name = "openblas.a" $target = "$(HOME)\openblaslib\$target_name" Write-Host "target path: $target" $old_value = $env:NPY_USE_BLAS_ILP64 From db785c2cd39fa80e4b1b5e3d28d9a36a06f98795 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:37:54 -0400 Subject: [PATCH 13/66] Fix another typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11cd9a95..6f35119a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,7 +43,7 @@ jobs: $env:NPY_USE_BLAS_ILP64 = $old_value cp $openblas $target } - mkdir $(OPENBLAS) + mkdir $(HOME)\openblaslib Download-OpenBLAS('0') - name: Build wheels run: | From bc8e0dfb8e8fad9cd7dffeeae7a64a07dac24b13 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:49:47 -0400 Subject: [PATCH 14/66] Tweak things again --- .github/workflows/release.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f35119a..a0a55c39 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,9 +33,9 @@ jobs: run: | $pyversion = python -c "import sys; print(sys.version.split()[0])" Write-Host "Python Version: $pyversion" - function Download-OpenBLAS($ilp64) { - $target_name = "openblas.a" - $target = "$(HOME)\openblaslib\$target_name" + function Download-OpenBLAS($ilp64) { + if ($ilp64 -eq '1') { $target_name = "openblas64_.a" } else { $target_name = "openblas.a" } + $target = "$(OPENBLAS)\$target_name" Write-Host "target path: $target" $old_value = $env:NPY_USE_BLAS_ILP64 $env:NPY_USE_BLAS_ILP64 = $ilp64 @@ -43,8 +43,11 @@ jobs: $env:NPY_USE_BLAS_ILP64 = $old_value cp $openblas $target } - mkdir $(HOME)\openblaslib + mkdir $(OPENBLAS) Download-OpenBLAS('0') + env: + OPENBLAS: {{ HOME }}\openblaslib + OPENBLAS64_: {{ HOME }}\openblaslib - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -54,8 +57,8 @@ jobs: CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" CIBW_TEST_COMMAND: "nosetests {project}/test" - CIBW_ENVIRONMENT_WINDOWS: "OPENBLAS=$(HOME)/openblaslib" CIBW_TEST_REQUIRES: nose + CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS={{ HOME }}/openblaslib" - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl From caf9a4a83f82358eb817c7519666e41a356040e2 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:50:41 -0400 Subject: [PATCH 15/66] Switch env to variables --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a0a55c39..c79513e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: } mkdir $(OPENBLAS) Download-OpenBLAS('0') - env: + variables: OPENBLAS: {{ HOME }}\openblaslib OPENBLAS64_: {{ HOME }}\openblaslib - name: Build wheels From daf69ca81ee7511eec80c1428b2e66b29ae9d1a6 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:51:52 -0400 Subject: [PATCH 16/66] move things around --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c79513e1..0096a6e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,9 @@ jobs: uses: microsoft/setup-msbuild@v1.0.1 if: runner.os == 'Windows' - name: Install OpenBLAS Windows + env: + OPENBLAS: {{ HOME }}\openblaslib + OPENBLAS64_: {{ HOME }}\openblaslib if: runner.os == 'Windows' shell: pwsh run: | @@ -45,9 +48,6 @@ jobs: } mkdir $(OPENBLAS) Download-OpenBLAS('0') - variables: - OPENBLAS: {{ HOME }}\openblaslib - OPENBLAS64_: {{ HOME }}\openblaslib - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse From da7e70597a819786940b4213e703aa35a124503c Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:52:50 -0400 Subject: [PATCH 17/66] Fix sytanx errors --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0096a6e6..1acb0254 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,8 +29,8 @@ jobs: if: runner.os == 'Windows' - name: Install OpenBLAS Windows env: - OPENBLAS: {{ HOME }}\openblaslib - OPENBLAS64_: {{ HOME }}\openblaslib + OPENBLAS: ${{ HOME }}\openblaslib + OPENBLAS64_: ${{ HOME }}\openblaslib if: runner.os == 'Windows' shell: pwsh run: | @@ -58,7 +58,7 @@ jobs: CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS={{ HOME }}/openblaslib" + CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS=${{ HOME }}/openblaslib" - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl From 5e28315d5669ddb7e045b98154b9915580aec26e Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:54:01 -0400 Subject: [PATCH 18/66] Swap HOME for GITHUB_WORKSPACE --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1acb0254..bb8bda07 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,8 +29,8 @@ jobs: if: runner.os == 'Windows' - name: Install OpenBLAS Windows env: - OPENBLAS: ${{ HOME }}\openblaslib - OPENBLAS64_: ${{ HOME }}\openblaslib + OPENBLAS: ${{ GITHUB_WORKSPACE }}\openblaslib + OPENBLAS64_: ${{ GITHUB_WORKSPACE }}\openblaslib if: runner.os == 'Windows' shell: pwsh run: | @@ -58,7 +58,7 @@ jobs: CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS=${{ HOME }}/openblaslib" + CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS=${{ GITHUB_WORKSPACE }}/openblaslib" - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl From 9f6f7b165b4461824fd307fef2a942a15bc5d438 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:55:02 -0400 Subject: [PATCH 19/66] Just work from repo root --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb8bda07..a7717c10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,8 +29,8 @@ jobs: if: runner.os == 'Windows' - name: Install OpenBLAS Windows env: - OPENBLAS: ${{ GITHUB_WORKSPACE }}\openblaslib - OPENBLAS64_: ${{ GITHUB_WORKSPACE }}\openblaslib + OPENBLAS: openblaslib + OPENBLAS64_: openblaslib if: runner.os == 'Windows' shell: pwsh run: | @@ -58,7 +58,7 @@ jobs: CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS=${{ GITHUB_WORKSPACE }}/openblaslib" + CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS={project}/openblaslib" - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl From 477dcd427d3d8353eb3cd88ba028957be0ef8d5e Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 13:57:49 -0400 Subject: [PATCH 20/66] Simplify pwsh script to install openblas --- .github/workflows/release.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7717c10..58b6b29f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,26 +28,17 @@ jobs: uses: microsoft/setup-msbuild@v1.0.1 if: runner.os == 'Windows' - name: Install OpenBLAS Windows - env: - OPENBLAS: openblaslib - OPENBLAS64_: openblaslib if: runner.os == 'Windows' shell: pwsh run: | $pyversion = python -c "import sys; print(sys.version.split()[0])" + mkdir openblaslib Write-Host "Python Version: $pyversion" - function Download-OpenBLAS($ilp64) { - if ($ilp64 -eq '1') { $target_name = "openblas64_.a" } else { $target_name = "openblas.a" } - $target = "$(OPENBLAS)\$target_name" - Write-Host "target path: $target" - $old_value = $env:NPY_USE_BLAS_ILP64 - $env:NPY_USE_BLAS_ILP64 = $ilp64 - $openblas = python tools/openblas_support.py - $env:NPY_USE_BLAS_ILP64 = $old_value - cp $openblas $target - } - mkdir $(OPENBLAS) - Download-OpenBLAS('0') + $target_name = "openblas.a" + $target = "openblaslib\$target_name" + Write-Host "target path: $target" + $openblas = python tools/openblas_support.py + cp $openblas $target - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse From 7c5f8fc980a64dc24200d948c0e8ccaeaa9aa7d8 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 14:02:27 -0400 Subject: [PATCH 21/66] Remove msbuild usage, need gcc --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 58b6b29f..d34d40f8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,9 +24,6 @@ jobs: - name: Install cibuildwheel run: | python -m pip install cibuildwheel==1.6.1 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.0.1 - if: runner.os == 'Windows' - name: Install OpenBLAS Windows if: runner.os == 'Windows' shell: pwsh From 518c2523fd557706e4972c109cb35234b64e9927 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 14:07:13 -0400 Subject: [PATCH 22/66] Add gcc to windows env --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d34d40f8..0eb5b1eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,6 +36,10 @@ jobs: Write-Host "target path: $target" $openblas = python tools/openblas_support.py cp $openblas $target + - uses: msys2/setup-msys2@v2 + if: runner.os == 'Windows' + with: + install: gcc make - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse From 5881d3918b529dabfc41a1b91504fa82a2b7986c Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 14:08:09 -0400 Subject: [PATCH 23/66] Fix whitespace --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0eb5b1eb..b5e7dae9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,10 +36,10 @@ jobs: Write-Host "target path: $target" $openblas = python tools/openblas_support.py cp $openblas $target - - uses: msys2/setup-msys2@v2 - if: runner.os == 'Windows' - with: - install: gcc make + - uses: msys2/setup-msys2@v2 + if: runner.os == 'Windows' + with: + install: gcc make - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse From 7a9b526131f1d60c13f34e263c05894d0d70aff6 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 14:15:59 -0400 Subject: [PATCH 24/66] Use vcpython27 --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5e7dae9..3a4d3f8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,10 +36,10 @@ jobs: Write-Host "target path: $target" $openblas = python tools/openblas_support.py cp $openblas $target - - uses: msys2/setup-msys2@v2 + - name: Install Visual C++ for Python 2.7 if: runner.os == 'Windows' - with: - install: gcc make + run: | + choco install vcpython27 -f -y - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse From 544deffbc215a647277f082125331076cad3e681 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 14:30:22 -0400 Subject: [PATCH 25/66] Split out windows wheels --- .github/workflows/release.yml | 53 +++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a4d3f8d..2a49389d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, windows-latest, macos-latest] + os: [ubuntu-18.04, macos-latest] steps: - uses: actions/checkout@v2 @@ -24,8 +24,37 @@ jobs: - name: Install cibuildwheel run: | python -m pip install cibuildwheel==1.6.1 + - name: Build wheels + run: | + python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_SKIP: "cp27-* cp34-* pp* *win32" + CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" + CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" + CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" + CIBW_TEST_COMMAND: "nosetests {project}/test" + CIBW_TEST_REQUIRES: nose + CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS={project}/openblaslib CC=gcc USE_LAPACK=1" + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + build_wheels_windows: + name: Build wheels on ${{ matrix.os }} + runs-on: windows-latest + strategy: + matrix: + arch: [x64, x86] + python-version: [3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.arch }} - name: Install OpenBLAS Windows - if: runner.os == 'Windows' shell: pwsh run: | $pyversion = python -c "import sys; print(sys.version.split()[0])" @@ -37,20 +66,14 @@ jobs: $openblas = python tools/openblas_support.py cp $openblas $target - name: Install Visual C++ for Python 2.7 - if: runner.os == 'Windows' run: | choco install vcpython27 -f -y - - name: Build wheels - run: | - python -m cibuildwheel --output-dir wheelhouse - env: - CIBW_SKIP: "cp27-* cp34-* pp* *win32" - CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" - CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" - CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" - CIBW_TEST_COMMAND: "nosetests {project}/test" - CIBW_TEST_REQUIRES: nose - CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS={project}/openblaslib" + - name: Build Wheel + if: matrix.arch == 'x64' + run: python setup.py install --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib"' + - name: Build Wheel + if: matrix.arch == 'x86' + run: python setup.py install --scs 'CC="gcc.exe -m32" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib"' - uses: actions/upload-artifact@v2 with: - path: ./wheelhouse/*.whl + path: ./dist/*.whl From 8d25e33f8f86096e90795ef8c18b654c5747b8ac Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 14:31:53 -0400 Subject: [PATCH 26/66] Fix title --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a49389d..009f3c7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: with: path: ./wheelhouse/*.whl build_wheels_windows: - name: Build wheels on ${{ matrix.os }} + name: Build wheels on windows Python-${{ matrix.python-version }} ${{ matrix.arch }} runs-on: windows-latest strategy: matrix: From 290f639d0323ab96115c0d89c8cb97a27cf6f075 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 14:40:23 -0400 Subject: [PATCH 27/66] Add tests --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 009f3c7e..33200a49 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,12 +68,34 @@ jobs: - name: Install Visual C++ for Python 2.7 run: | choco install vcpython27 -f -y + - uses: msys2/setup-msys2@v2 + if: matrix.arch == 'x64' + with: + msystem: ${{ matrix.msystem }} + install: git base-devel mingw-w64-x86_64-toolchain + - uses: msys2/setup-msys2@v2 + if: matrix.arch == 'x86' + with: + msystem: ${{ matrix.msystem }} + install: git base-devel mingw-w64-i686-toolchain - name: Build Wheel + shell: msys2 {0} if: matrix.arch == 'x64' - run: python setup.py install --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib"' + run: python setup.py install --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' - name: Build Wheel + shell: msys2 {0} if: matrix.arch == 'x86' - run: python setup.py install --scs 'CC="gcc.exe -m32" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib"' + run: python setup.py install --scs 'CC="gcc.exe -m32" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' + - name: Run tests + run: | + set -e + mkdir test_dir + cd test_dir + virtualenv test-env + test-env/bin/pip install ../dist/*whl + test-env/bin/pip install -U nose + test-env/bin/nosetests ../tests + cd .. - uses: actions/upload-artifact@v2 with: path: ./dist/*.whl From c1eb0c6161aa4d04dd4a22310285ab6c94dc1ac4 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 14:45:35 -0400 Subject: [PATCH 28/66] Fix msys vars --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33200a49..88a31e46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,12 +71,12 @@ jobs: - uses: msys2/setup-msys2@v2 if: matrix.arch == 'x64' with: - msystem: ${{ matrix.msystem }} + msystem: MINGW64 install: git base-devel mingw-w64-x86_64-toolchain - uses: msys2/setup-msys2@v2 if: matrix.arch == 'x86' with: - msystem: ${{ matrix.msystem }} + msystem: MINGW32 install: git base-devel mingw-w64-i686-toolchain - name: Build Wheel shell: msys2 {0} From 3a661c033b052978f0e57b864bc8eb8b50b2fce2 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 14:59:32 -0400 Subject: [PATCH 29/66] Exclude python 3.9 for now --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88a31e46..39c96194 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: run: | python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "cp27-* cp34-* pp* *win32" + CIBW_SKIP: "cp27-* cp34-* pp* cp39* *win32" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" From 3d854b7a5d7b58bb0dd7b80a5f38679d41cfe889 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 15:08:45 -0400 Subject: [PATCH 30/66] Add update to msys install --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39c96194..ec6c7703 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,11 +73,13 @@ jobs: with: msystem: MINGW64 install: git base-devel mingw-w64-x86_64-toolchain + update: true - uses: msys2/setup-msys2@v2 if: matrix.arch == 'x86' with: msystem: MINGW32 install: git base-devel mingw-w64-i686-toolchain + update: true - name: Build Wheel shell: msys2 {0} if: matrix.arch == 'x64' From 37b0f20249769545dd993a2a3110214e8b7bb956 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 7 Oct 2020 15:28:08 -0400 Subject: [PATCH 31/66] Remove msys2 --- .github/workflows/release.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec6c7703..df7b9342 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,18 +68,6 @@ jobs: - name: Install Visual C++ for Python 2.7 run: | choco install vcpython27 -f -y - - uses: msys2/setup-msys2@v2 - if: matrix.arch == 'x64' - with: - msystem: MINGW64 - install: git base-devel mingw-w64-x86_64-toolchain - update: true - - uses: msys2/setup-msys2@v2 - if: matrix.arch == 'x86' - with: - msystem: MINGW32 - install: git base-devel mingw-w64-i686-toolchain - update: true - name: Build Wheel shell: msys2 {0} if: matrix.arch == 'x64' From 9600cb1c4ce0d048153026bec48f9fd7e09c2d2e Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 08:00:31 -0400 Subject: [PATCH 32/66] Remove msys2 shell --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df7b9342..718064e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,11 +69,9 @@ jobs: run: | choco install vcpython27 -f -y - name: Build Wheel - shell: msys2 {0} if: matrix.arch == 'x64' run: python setup.py install --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' - name: Build Wheel - shell: msys2 {0} if: matrix.arch == 'x86' run: python setup.py install --scs 'CC="gcc.exe -m32" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' - name: Run tests From 2c2b33818031e308c0d462201ac9c98704480d3f Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 08:13:21 -0400 Subject: [PATCH 33/66] Set shell to bash for test step on windows wheel job --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 718064e7..094620ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,6 +75,7 @@ jobs: if: matrix.arch == 'x86' run: python setup.py install --scs 'CC="gcc.exe -m32" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' - name: Run tests + shell: bash run: | set -e mkdir test_dir From 0f36b67b61f6bcd944f10c4bc69b78502df41b4a Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 08:18:57 -0400 Subject: [PATCH 34/66] Install deps --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 094620ab..cff6a97e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,6 +68,8 @@ jobs: - name: Install Visual C++ for Python 2.7 run: | choco install vcpython27 -f -y + - name: Install Deps + run: pip install wheel virtualenv numpy scipy - name: Build Wheel if: matrix.arch == 'x64' run: python setup.py install --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' From 258562bffd655bbd55da7bbce11166fd72e4dbd9 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 08:35:58 -0400 Subject: [PATCH 35/66] Scripts on windows not bin --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cff6a97e..e9202aa1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,9 +83,9 @@ jobs: mkdir test_dir cd test_dir virtualenv test-env - test-env/bin/pip install ../dist/*whl - test-env/bin/pip install -U nose - test-env/bin/nosetests ../tests + test-env/Scripts/pip install ../dist/*whl + test-env/Scripts/pip install -U nose + test-env/Scripts/nosetests ../tests cd .. - uses: actions/upload-artifact@v2 with: From 86b43a055d83dd6684b05d04310f39ac7e1d500b Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 08:51:41 -0400 Subject: [PATCH 36/66] Simplify test step --- .github/workflows/release.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e9202aa1..822f1586 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,13 +80,10 @@ jobs: shell: bash run: | set -e - mkdir test_dir - cd test_dir virtualenv test-env - test-env/Scripts/pip install ../dist/*whl - test-env/Scripts/pip install -U nose - test-env/Scripts/nosetests ../tests - cd .. + test-env/Scripts/pip install dist/*whl + test-env/Scripts/pip install nose + test-env/Scripts/nosetests tests - uses: actions/upload-artifact@v2 with: path: ./dist/*.whl From 86ba61a37f85d589b3d6a87618bac8f8fac59f1f Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 08:52:38 -0400 Subject: [PATCH 37/66] Actually build wheel --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 822f1586..93a7db9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,10 +72,10 @@ jobs: run: pip install wheel virtualenv numpy scipy - name: Build Wheel if: matrix.arch == 'x64' - run: python setup.py install --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' + run: python setup.py bdist_wheel --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' - name: Build Wheel if: matrix.arch == 'x86' - run: python setup.py install --scs 'CC="gcc.exe -m32" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' + run: python setup.py bdist_wheel --scs 'CC="gcc.exe -m32" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' - name: Run tests shell: bash run: | From 95b85232f4c44153f9549198fa3c7fc3868ab34a Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 08:57:26 -0400 Subject: [PATCH 38/66] Fix test path on windows job --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93a7db9c..ea971968 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,7 +83,7 @@ jobs: virtualenv test-env test-env/Scripts/pip install dist/*whl test-env/Scripts/pip install nose - test-env/Scripts/nosetests tests + test-env/Scripts/nosetests test - uses: actions/upload-artifact@v2 with: path: ./dist/*.whl From 353fa34f4134dde4b2d0f7c7c6ab927f971dada3 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 10:26:00 -0400 Subject: [PATCH 39/66] Try using conda to build wheels for windows --- .github/workflows/release.yml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea971968..fa4e815f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,27 +49,15 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - uses: actions/setup-python@v2 - name: Install Python + - uses: goanpeca/setup-miniconda@v1 with: + activate-environment: scs + auto-update-conda: true + channels: conda-forge python-version: ${{ matrix.python-version }} architecture: ${{ matrix.arch }} - - name: Install OpenBLAS Windows - shell: pwsh - run: | - $pyversion = python -c "import sys; print(sys.version.split()[0])" - mkdir openblaslib - Write-Host "Python Version: $pyversion" - $target_name = "openblas.a" - $target = "openblaslib\$target_name" - Write-Host "target path: $target" - $openblas = python tools/openblas_support.py - cp $openblas $target - - name: Install Visual C++ for Python 2.7 - run: | - choco install vcpython27 -f -y - name: Install Deps - run: pip install wheel virtualenv numpy scipy + run: conda install numpy scipy nose virtualenv - name: Build Wheel if: matrix.arch == 'x64' run: python setup.py bdist_wheel --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' From b89239c024b2b14821500d008fd77a9aad53ca0f Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 11:11:13 -0400 Subject: [PATCH 40/66] Fix whitespace --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa4e815f..5f81cc99 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - uses: goanpeca/setup-miniconda@v1 + - uses: goanpeca/setup-miniconda@v1 with: activate-environment: scs auto-update-conda: true From c53b0c3f55f194442e524e7ff5134aa3018b6e42 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 11:13:47 -0400 Subject: [PATCH 41/66] Set miniconda version too --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f81cc99..25913840 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,7 @@ jobs: - uses: goanpeca/setup-miniconda@v1 with: activate-environment: scs + miniconda-version: 4.8.3 auto-update-conda: true channels: conda-forge python-version: ${{ matrix.python-version }} From 56057c49dfe25ba3d6f318c3a67bbe179a25914f Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 11:30:08 -0400 Subject: [PATCH 42/66] Try to fix miniconda 32bit --- .github/workflows/release.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25913840..7891668b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,13 +50,21 @@ jobs: with: submodules: true - uses: goanpeca/setup-miniconda@v1 + if: matrix.arch == 'x64' + with: + activate-environment: scs + auto-update-conda: true + channels: conda-forge + python-version: ${{ matrix.python-version }} + - uses: goanpeca/setup-miniconda@v1 + if: matrix.arch == 'x86' with: activate-environment: scs - miniconda-version: 4.8.3 + miniconda-version: Miniconda3-latest-Windows-x86.exe auto-update-conda: true channels: conda-forge python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.arch }} + architecture: x86 - name: Install Deps run: conda install numpy scipy nose virtualenv - name: Build Wheel From c8fb93d755758683f2f9bc63d8ce9b7ed85e442a Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 8 Oct 2020 12:13:28 -0400 Subject: [PATCH 43/66] Fix version string --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7891668b..873dc3a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: if: matrix.arch == 'x86' with: activate-environment: scs - miniconda-version: Miniconda3-latest-Windows-x86.exe + miniconda-version: "latest" auto-update-conda: true channels: conda-forge python-version: ${{ matrix.python-version }} From 6ac6842dd2c29189ef2ef43023b1860148652aea Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 9 Oct 2020 10:45:52 -0400 Subject: [PATCH 44/66] Pip install virtualenv --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 873dc3a7..1d696890 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: x86 - name: Install Deps - run: conda install numpy scipy nose virtualenv + run: conda install numpy scipy nose - name: Build Wheel if: matrix.arch == 'x64' run: python setup.py bdist_wheel --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' @@ -77,6 +77,7 @@ jobs: shell: bash run: | set -e + pip install virtualenv virtualenv test-env test-env/Scripts/pip install dist/*whl test-env/Scripts/pip install nose From edcf40bbf1f161e0247f86e594b8241838294f96 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 9 Dec 2020 07:45:11 -0500 Subject: [PATCH 45/66] Try using conda env instead of virtualenv --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d696890..024522f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,11 +77,11 @@ jobs: shell: bash run: | set -e - pip install virtualenv - virtualenv test-env - test-env/Scripts/pip install dist/*whl - test-env/Scripts/pip install nose - test-env/Scripts/nosetests test + conda create test-env + activate test-env + pip install dist/*whl + pip install nose + nosetests test - uses: actions/upload-artifact@v2 with: path: ./dist/*.whl From 703ab7b0e9a0867207485da98e9bfc485104f3c7 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 9 Dec 2020 08:01:54 -0500 Subject: [PATCH 46/66] Bump ci versions --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 024522f2..2e983386 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==1.6.1 + python -m pip install cibuildwheel==1.7.1 - name: Build wheels run: | python -m cibuildwheel --output-dir wheelhouse @@ -32,6 +32,8 @@ jobs: CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest + CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS={project}/openblaslib CC=gcc USE_LAPACK=1" @@ -49,14 +51,14 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - uses: goanpeca/setup-miniconda@v1 + - uses: conda-incubator/setup-miniconda@v2 if: matrix.arch == 'x64' with: activate-environment: scs auto-update-conda: true channels: conda-forge python-version: ${{ matrix.python-version }} - - uses: goanpeca/setup-miniconda@v1 + - uses: conda-incubator/setup-miniconda@v2 if: matrix.arch == 'x86' with: activate-environment: scs From 1f151251f17163fb086d48f30b74bbd906dd8330 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 9 Dec 2020 08:23:17 -0500 Subject: [PATCH 47/66] Try to use more conda --- .github/workflows/release.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e983386..bc50561c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,14 +76,27 @@ jobs: if: matrix.arch == 'x86' run: python setup.py bdist_wheel --scs 'CC="gcc.exe -m32" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' - name: Run tests - shell: bash + shell: bash -l {0} run: | set -e - conda create test-env - activate test-env + conda create -y -n test-env python=${{ matrix.python-version }} + source activate test-env pip install dist/*whl pip install nose nosetests test + if: matrix.arch == 'x64' + - name: Run tests + shell: bash -l {0} + run: | + set -e + conda create -y -n test-env python=${{ matrix.python-version }} + source activate test-env + pip install dist/*whl + pip install nose + nosetests test + env: + - CONDA_FORCE_32BIT: 1 + if: matrix.arch == 'x86' - uses: actions/upload-artifact@v2 with: path: ./dist/*.whl From 625f49be6dafee72206b8d4cb6ea22e02609f3ef Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 9 Dec 2020 08:24:15 -0500 Subject: [PATCH 48/66] Fix syntax error --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc50561c..d7aff2bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,7 +95,7 @@ jobs: pip install nose nosetests test env: - - CONDA_FORCE_32BIT: 1 + CONDA_FORCE_32BIT: 1 if: matrix.arch == 'x86' - uses: actions/upload-artifact@v2 with: From bdbe5659f70cc3bfdffe6dfe05d13be7107bdb9a Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 9 Dec 2020 08:29:27 -0500 Subject: [PATCH 49/66] Fix conda syntax --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7aff2bb..48b407c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,7 +80,7 @@ jobs: run: | set -e conda create -y -n test-env python=${{ matrix.python-version }} - source activate test-env + conda activate test-env pip install dist/*whl pip install nose nosetests test @@ -90,7 +90,7 @@ jobs: run: | set -e conda create -y -n test-env python=${{ matrix.python-version }} - source activate test-env + condae activate test-env pip install dist/*whl pip install nose nosetests test From e1bb5b3a4a56eec4ebc2bc03ba50dfaa0344fde6 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 9 Dec 2020 08:35:21 -0500 Subject: [PATCH 50/66] Fix typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48b407c7..09cd1d63 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -90,7 +90,7 @@ jobs: run: | set -e conda create -y -n test-env python=${{ matrix.python-version }} - condae activate test-env + conda activate test-env pip install dist/*whl pip install nose nosetests test From 58d60563d3da20a99edaf1811743d96dde851bf2 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 9 Dec 2020 08:43:56 -0500 Subject: [PATCH 51/66] Add Python 3.9 to builds --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09cd1d63..be336b67 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: run: | python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "cp27-* cp34-* pp* cp39* *win32" + CIBW_SKIP: "cp27-* cp34-* pp* *win32" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" @@ -46,7 +46,7 @@ jobs: strategy: matrix: arch: [x64, x86] - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 with: From 6560254191f0e22eb0b9d6c9681781dc7852d0b0 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 9 Dec 2020 09:50:29 -0500 Subject: [PATCH 52/66] Remove 3.9 windows jobs --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be336b67..330219b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: strategy: matrix: arch: [x64, x86] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 with: From 3df87ab58464aa992089170cc4359ab2f096224c Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 3 May 2021 15:09:50 -0400 Subject: [PATCH 53/66] Add conda mkl --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 330219b8..bc4f41c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: strategy: matrix: arch: [x64, x86] - python-version: [3.6, 3.7, 3.8] + python-version: [3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 with: @@ -68,7 +68,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: x86 - name: Install Deps - run: conda install numpy scipy nose + run: conda install numpy scipy nose mkl - name: Build Wheel if: matrix.arch == 'x64' run: python setup.py bdist_wheel --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' From c0d8a824f76f4de7297f5c5d867cd3b8fe1cb5a9 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 3 May 2021 15:11:55 -0400 Subject: [PATCH 54/66] Add miniconda version --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc4f41c7..1f78c391 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,6 +58,7 @@ jobs: auto-update-conda: true channels: conda-forge python-version: ${{ matrix.python-version }} + miniconda-version: "latest" - uses: conda-incubator/setup-miniconda@v2 if: matrix.arch == 'x86' with: From 441c72137741e08cca1a8a098c9b7fe1fc083f04 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 3 May 2021 15:15:55 -0400 Subject: [PATCH 55/66] Use explicit version for win32 miniconda version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1f78c391..9c046275 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,7 @@ jobs: if: matrix.arch == 'x86' with: activate-environment: scs - miniconda-version: "latest" + miniconda-version: "4.5.12" auto-update-conda: true channels: conda-forge python-version: ${{ matrix.python-version }} From 35a652279f3167fdf2e725c0bf90d6718746f91e Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 3 May 2021 15:27:40 -0400 Subject: [PATCH 56/66] Pivot to cibuildwheel action --- .github/workflows/release.yml | 77 ++--------------------------------- 1 file changed, 3 insertions(+), 74 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c046275..56d347f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,24 +9,14 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-18.04, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v2 with: submodules: true - - - uses: actions/setup-python@v2 - name: Install Python - with: - python-version: '3.7' - - - name: Install cibuildwheel - run: | - python -m pip install cibuildwheel==1.7.1 - name: Build wheels - run: | - python -m cibuildwheel --output-dir wheelhouse + uses: joerick/cibuildwheel@v1.11.0 env: CIBW_SKIP: "cp27-* cp34-* pp* *win32" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" @@ -36,68 +26,7 @@ jobs: CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS={project}/openblaslib CC=gcc USE_LAPACK=1" + CIBW_ENVIRONMENT_WINDOWS: "CC=gcc USE_LAPACK=1" - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl - build_wheels_windows: - name: Build wheels on windows Python-${{ matrix.python-version }} ${{ matrix.arch }} - runs-on: windows-latest - strategy: - matrix: - arch: [x64, x86] - python-version: [3.6, 3.7, 3.8, 3.9] - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - uses: conda-incubator/setup-miniconda@v2 - if: matrix.arch == 'x64' - with: - activate-environment: scs - auto-update-conda: true - channels: conda-forge - python-version: ${{ matrix.python-version }} - miniconda-version: "latest" - - uses: conda-incubator/setup-miniconda@v2 - if: matrix.arch == 'x86' - with: - activate-environment: scs - miniconda-version: "4.5.12" - auto-update-conda: true - channels: conda-forge - python-version: ${{ matrix.python-version }} - architecture: x86 - - name: Install Deps - run: conda install numpy scipy nose mkl - - name: Build Wheel - if: matrix.arch == 'x64' - run: python setup.py bdist_wheel --scs 'CC="gcc.exe -m64" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' - - name: Build Wheel - if: matrix.arch == 'x86' - run: python setup.py bdist_wheel --scs 'CC="gcc.exe -m32" USE_LAPACK=1 BLASLDFLAGS="-Lopenblaslib -lopenblas"' - - name: Run tests - shell: bash -l {0} - run: | - set -e - conda create -y -n test-env python=${{ matrix.python-version }} - conda activate test-env - pip install dist/*whl - pip install nose - nosetests test - if: matrix.arch == 'x64' - - name: Run tests - shell: bash -l {0} - run: | - set -e - conda create -y -n test-env python=${{ matrix.python-version }} - conda activate test-env - pip install dist/*whl - pip install nose - nosetests test - env: - CONDA_FORCE_32BIT: 1 - if: matrix.arch == 'x86' - - uses: actions/upload-artifact@v2 - with: - path: ./dist/*.whl From 91f1e172a509afced099db9bc63c90d54ba2ccf2 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 3 May 2021 15:48:39 -0400 Subject: [PATCH 57/66] Add pyproject.toml to preinstall build reqs --- .github/workflows/release.yml | 3 +-- pyproject.toml | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56d347f2..1bd24d05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,10 +18,9 @@ jobs: - name: Build wheels uses: joerick/cibuildwheel@v1.11.0 env: - CIBW_SKIP: "cp27-* cp34-* pp* *win32" + CIBW_SKIP: "cp27-* cp34-* cp35-* pp* *win32" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" - CIBW_BEFORE_BUILD_WINDOWS: "pip install -U numpy scipy" CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest CIBW_TEST_COMMAND: "nosetests {project}/test" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..3a567e98 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = [ + "setuptools", + "wheel", + "oldest-supported-numpy", +] +build-backend = "setuptools.build_meta" From ab9d2f2b47c4a96289dce35aacf1282c55414714 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Sat, 15 May 2021 09:34:26 -0400 Subject: [PATCH 58/66] Use scipy openblas script --- .github/workflows/release.yml | 4 +--- tools/openblas_support.py | 37 ++++++++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) mode change 100644 => 100755 tools/openblas_support.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1bd24d05..aa713cbc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,11 +21,9 @@ jobs: CIBW_SKIP: "cp27-* cp34-* cp35-* pp* *win32" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" - CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2010_x86_64:latest - CIBW_MANYLINUX_I686_IMAGE: quay.io/pypa/manylinux2010_i686:latest + CIBW_BEFORE_ALL_WINDOWS: "python {package}/tools/openblas_support.py" CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - CIBW_ENVIRONMENT_WINDOWS: "CC=gcc USE_LAPACK=1" - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl diff --git a/tools/openblas_support.py b/tools/openblas_support.py old mode 100644 new mode 100755 index 4c57f160..42031e55 --- a/tools/openblas_support.py +++ b/tools/openblas_support.py @@ -1,3 +1,34 @@ +# Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + import os import sys import glob @@ -24,15 +55,15 @@ '6fe5b1e2a4baa16833724bcc94a80b22e9c99fc1b9a2ddbce4f1f82a8002d906', 'openblas64_-v0.3.9-win_amd64-gcc_7_1_0.zip': '15d24a66c5b22cc7b3120e831658f491c7a063804c33813235044a6f8b56686d', -'openblas-v0.3.9-macosx_10_9_x86_64-gf_1becaaa.tar.gz': +'openblas-v0.3.9-macosx_10_9_x86_64-gf_1becaaa.tar.gz': '8221397b9cfb8cb22f3efb7f228ef901e13f9fd89c7d7d0cb7b8a79b0610bf33', -'openblas-v0.3.9-manylinux1_i686.tar.gz': +'openblas-v0.3.9-manylinux1_i686.tar.gz': '31abf8eccb697a320a998ce0f59045edc964602f815d78690c5a23839819261c', 'openblas-v0.3.9-manylinux1_x86_64.tar.gz': 'd9c39acbafae9b1daef19c2738ec938109a59e9322f93eb9a3c50869d220deff', 'openblas-v0.3.9-win32-gcc_7_1_0.zip': '69a7dc265e8a8e45b358637d11cb1710ce88c4456634c7ce37d429b1d9bc9aaa', -'openblas-v0.3.9-win_amd64-gcc_7_1_0.zip': +'openblas-v0.3.9-win_amd64-gcc_7_1_0.zip': '0cea06f4a2afebaa6255854f73f237802fc6b58eaeb1a8b1c22d87cc399e0d48', 'openblas-v0.3.9-manylinux2014_aarch64.tar.gz': '10d5ef5e9e19af5c199b59a17f43763e0c85ecf13cbc8f2d91e076f7847cdb5e' From ab6c99a45e15415cb9239931d1836a90dce76408 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Sat, 15 May 2021 10:04:11 -0400 Subject: [PATCH 59/66] Use env vars --- .github/workflows/release.yml | 1 + tools/openblas_support.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa713cbc..cc861467 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_BEFORE_ALL_WINDOWS: "python {package}/tools/openblas_support.py" + CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS=./lib BLAS_LAPACK_LIBS=openblas" CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - uses: actions/upload-artifact@v2 diff --git a/tools/openblas_support.py b/tools/openblas_support.py index 42031e55..8c5bab42 100755 --- a/tools/openblas_support.py +++ b/tools/openblas_support.py @@ -176,7 +176,12 @@ def unpack_windows_zip(fname): if not lib: return 'could not find libopenblas_%s*.a ' \ 'in downloaded zipfile' % OPENBLAS_LONG - target = os.path.join(gettempdir(), 'openblas.a') + target_dir = os.path.join( + os.path.dirname(os.path.dirname(os.path.abspath(__file__))), + 'lib') + if not os.path.isdir(target_dir): + os.makedirs(target_dir) + target = os.path.join(target_dir, 'openblas.a') with open(target, 'wb') as fid: fid.write(zf.read(lib[0])) return target From ca99e38bdc025ea0dfbd82034b2183cc4aa72c5f Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Sat, 15 May 2021 10:11:00 -0400 Subject: [PATCH 60/66] Tweak path --- .github/workflows/release.yml | 2 +- tools/openblas_support.py | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc861467..b7ea083f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" CIBW_BEFORE_ALL_WINDOWS: "python {package}/tools/openblas_support.py" - CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS=./lib BLAS_LAPACK_LIBS=openblas" + CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS=/Users/RUNNER~1/AppData/Local/Temp BLAS_LAPACK_LIBS=openblas" CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - uses: actions/upload-artifact@v2 diff --git a/tools/openblas_support.py b/tools/openblas_support.py index 8c5bab42..6c5607ed 100755 --- a/tools/openblas_support.py +++ b/tools/openblas_support.py @@ -176,12 +176,7 @@ def unpack_windows_zip(fname): if not lib: return 'could not find libopenblas_%s*.a ' \ 'in downloaded zipfile' % OPENBLAS_LONG - target_dir = os.path.join( - os.path.dirname(os.path.dirname(os.path.abspath(__file__))), - 'lib') - if not os.path.isdir(target_dir): - os.makedirs(target_dir) - target = os.path.join(target_dir, 'openblas.a') + target = os.path.join(gettempdir(), 'openblas.lib') with open(target, 'wb') as fid: fid.write(zf.read(lib[0])) return target From 1dcfa669a75fb613fa5ab98ab904ab9b994a8ca0 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 18 May 2021 08:18:59 -0400 Subject: [PATCH 61/66] Remove failed attempt to use prebuilt openblas for windows --- .github/workflows/release.yml | 4 +- tools/openblas_support.py | 341 ---------------------------------- 2 files changed, 1 insertion(+), 344 deletions(-) delete mode 100755 tools/openblas_support.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7ea083f..d2cd1c45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,11 +18,9 @@ jobs: - name: Build wheels uses: joerick/cibuildwheel@v1.11.0 env: - CIBW_SKIP: "cp27-* cp34-* cp35-* pp* *win32" + CIBW_SKIP: "cp27-* cp34-* cp35-* pp*" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" - CIBW_BEFORE_ALL_WINDOWS: "python {package}/tools/openblas_support.py" - CIBW_ENVIRONMENT_WINDOWS: "BLAS_LAPACK_LIB_PATHS=/Users/RUNNER~1/AppData/Local/Temp BLAS_LAPACK_LIBS=openblas" CIBW_TEST_COMMAND: "nosetests {project}/test" CIBW_TEST_REQUIRES: nose - uses: actions/upload-artifact@v2 diff --git a/tools/openblas_support.py b/tools/openblas_support.py deleted file mode 100755 index 6c5607ed..00000000 --- a/tools/openblas_support.py +++ /dev/null @@ -1,341 +0,0 @@ -# Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import os -import sys -import glob -import shutil -import textwrap -import platform -import hashlib - -from tempfile import mkstemp, gettempdir -from urllib.request import urlopen, Request -from urllib.error import HTTPError -import zipfile -import tarfile - -OPENBLAS_V = 'v0.3.9' -OPENBLAS_LONG = 'v0.3.9' -BASE_LOC = '' -ANACONDA = 'https://anaconda.org/multibuild-wheels-staging/openblas-libs' -ARCHITECTURES = ['', 'windows', 'darwin', 'aarch64', 'x86', 'ppc64le', 's390x'] -sha256_vals = { -'openblas64_-v0.3.9-macosx_10_9_x86_64-gf_1becaaa.tar.gz': -'53f606a7da75d390287f1c51b2af7866b8fe7553a26d2474f827daf0e5c8a886', -'openblas64_-v0.3.9-manylinux1_x86_64.tar.gz': -'6fe5b1e2a4baa16833724bcc94a80b22e9c99fc1b9a2ddbce4f1f82a8002d906', -'openblas64_-v0.3.9-win_amd64-gcc_7_1_0.zip': -'15d24a66c5b22cc7b3120e831658f491c7a063804c33813235044a6f8b56686d', -'openblas-v0.3.9-macosx_10_9_x86_64-gf_1becaaa.tar.gz': -'8221397b9cfb8cb22f3efb7f228ef901e13f9fd89c7d7d0cb7b8a79b0610bf33', -'openblas-v0.3.9-manylinux1_i686.tar.gz': -'31abf8eccb697a320a998ce0f59045edc964602f815d78690c5a23839819261c', -'openblas-v0.3.9-manylinux1_x86_64.tar.gz': -'d9c39acbafae9b1daef19c2738ec938109a59e9322f93eb9a3c50869d220deff', -'openblas-v0.3.9-win32-gcc_7_1_0.zip': -'69a7dc265e8a8e45b358637d11cb1710ce88c4456634c7ce37d429b1d9bc9aaa', -'openblas-v0.3.9-win_amd64-gcc_7_1_0.zip': -'0cea06f4a2afebaa6255854f73f237802fc6b58eaeb1a8b1c22d87cc399e0d48', -'openblas-v0.3.9-manylinux2014_aarch64.tar.gz': -'10d5ef5e9e19af5c199b59a17f43763e0c85ecf13cbc8f2d91e076f7847cdb5e' -} - -IS_32BIT = sys.maxsize < 2**32 -def get_arch(): - if platform.system() == 'Windows': - ret = 'windows' - elif platform.system() == 'Darwin': - ret = 'darwin' - else: - ret = platform.uname().machine - # What do 32 bit machines report? - # If they are a docker, they report x86_64 or i686 - if 'x86' in ret or ret == 'i686': - ret = 'x86' - assert ret in ARCHITECTURES - return ret - -def get_ilp64(): - if os.environ.get("NPY_USE_BLAS_ILP64", "0") == "0": - return None - if IS_32BIT: - raise RuntimeError("NPY_USE_BLAS_ILP64 set on 32-bit arch") - return "64_" - -def download_openblas(target, arch, ilp64): - fnsuffix = {None: "", "64_": "64_"}[ilp64] - filename = '' - if arch in ('aarch64', 'ppc64le', 's390x'): - suffix = f'manylinux2014_{arch}.tar.gz' - filename = f'{ANACONDA}/{OPENBLAS_LONG}/download/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' - typ = 'tar.gz' - typ = 'tar.gz' - elif arch == 'darwin': - suffix = 'macosx_10_9_x86_64-gf_1becaaa.tar.gz' - filename = f'{ANACONDA}/{OPENBLAS_LONG}/download/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' - typ = 'tar.gz' - elif arch == 'windows': - if IS_32BIT: - suffix = 'win32-gcc_7_1_0.zip' - else: - suffix = 'win_amd64-gcc_7_1_0.zip' - filename = f'{ANACONDA}/{OPENBLAS_LONG}/download/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' - typ = 'zip' - elif 'x86' in arch: - if IS_32BIT: - suffix = 'manylinux1_i686.tar.gz' - else: - suffix = 'manylinux1_x86_64.tar.gz' - filename = f'{ANACONDA}/{OPENBLAS_LONG}/download/openblas{fnsuffix}-{OPENBLAS_LONG}-{suffix}' - typ = 'tar.gz' - if not filename: - return None - print("Downloading:", filename, file=sys.stderr) - try: - with open(target, 'wb') as fid: - # anaconda.org download location guards against - # scraping so trick it with a fake browser header - # see: https://medium.com/@speedforcerun/python-crawler-http-error-403-forbidden-1623ae9ba0f - headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.3'} - req = Request(url=filename, headers=headers) - fid.write(urlopen(req).read()) - with open(target, 'rb') as binary_to_check: - data = binary_to_check.read() - sha256_returned = hashlib.sha256(data).hexdigest() - sha256_expected = sha256_vals[os.path.basename(filename)] - if sha256_returned != sha256_expected: - raise ValueError('sha256 hash mismatch for downloaded OpenBLAS') - - except HTTPError as e: - print(f'Could not download "{filename}"') - print(f'Error message: {e}') - return None - return typ - -def setup_openblas(arch=get_arch(), ilp64=get_ilp64()): - ''' - Download and setup an openblas library for building. If successful, - the configuration script will find it automatically. - - Returns - ------- - msg : str - path to extracted files on success, otherwise indicates what went wrong - To determine success, do ``os.path.exists(msg)`` - ''' - _, tmp = mkstemp() - if not arch: - raise ValueError('unknown architecture') - typ = download_openblas(tmp, arch, ilp64) - if not typ: - return '' - if arch == 'windows': - if not typ == 'zip': - return 'expecting to download zipfile on windows, not %s' % str(typ) - return unpack_windows_zip(tmp) - else: - if not typ == 'tar.gz': - return 'expecting to download tar.gz, not %s' % str(typ) - return unpack_targz(tmp) - -def unpack_windows_zip(fname): - with zipfile.ZipFile(fname, 'r') as zf: - # Get the openblas.a file, but not openblas.dll.a nor openblas.dev.a - lib = [x for x in zf.namelist() if OPENBLAS_LONG in x and - x.endswith('a') and not x.endswith('dll.a') and - not x.endswith('dev.a')] - if not lib: - return 'could not find libopenblas_%s*.a ' \ - 'in downloaded zipfile' % OPENBLAS_LONG - target = os.path.join(gettempdir(), 'openblas.lib') - with open(target, 'wb') as fid: - fid.write(zf.read(lib[0])) - return target - -def unpack_targz(fname): - target = os.path.join(gettempdir(), 'openblas') - if not os.path.exists(target): - os.mkdir(target) - with tarfile.open(fname, 'r') as zf: - # Strip common prefix from paths when unpacking - prefix = os.path.commonpath(zf.getnames()) - extract_tarfile_to(zf, target, prefix) - return target - -def extract_tarfile_to(tarfileobj, target_path, archive_path): - """Extract TarFile contents under archive_path/ to target_path/""" - - target_path = os.path.abspath(target_path) - - def get_members(): - for member in tarfileobj.getmembers(): - if archive_path: - norm_path = os.path.normpath(member.name) - if norm_path.startswith(archive_path + os.path.sep): - member.name = norm_path[len(archive_path)+1:] - else: - continue - - dst_path = os.path.abspath(os.path.join(target_path, member.name)) - if os.path.commonpath([target_path, dst_path]) != target_path: - # Path not under target_path, probably contains ../ - continue - - yield member - - tarfileobj.extractall(target_path, members=get_members()) - -def make_init(dirname): - ''' - Create a _distributor_init.py file for OpenBlas - ''' - with open(os.path.join(dirname, '_distributor_init.py'), 'wt') as fid: - fid.write(textwrap.dedent(""" - ''' - Helper to preload windows dlls to prevent dll not found errors. - Once a DLL is preloaded, its namespace is made available to any - subsequent DLL. This file originated in the numpy-wheels repo, - and is created as part of the scripts that build the wheel. - ''' - import os - from ctypes import WinDLL - import glob - if os.name == 'nt': - # convention for storing / loading the DLL from - # numpy/.libs/, if present - try: - basedir = os.path.dirname(__file__) - except: - pass - else: - libs_dir = os.path.abspath(os.path.join(basedir, '.libs')) - DLL_filenames = [] - if os.path.isdir(libs_dir): - for filename in glob.glob(os.path.join(libs_dir, - '*openblas*dll')): - # NOTE: would it change behavior to load ALL - # DLLs at this path vs. the name restriction? - WinDLL(os.path.abspath(filename)) - DLL_filenames.append(filename) - if len(DLL_filenames) > 1: - import warnings - warnings.warn("loaded more than 1 DLL from .libs:\\n%s" % - "\\n".join(DLL_filenames), - stacklevel=1) - """)) - -def test_setup(arches): - ''' - Make sure all the downloadable files exist and can be opened - ''' - def items(): - for arch in arches: - yield arch, None - if arch in ('x86', 'darwin', 'windows'): - yield arch, '64_' - - for arch, ilp64 in items(): - if arch == '': - continue - - target = None - try: - try: - target = setup_openblas(arch, ilp64) - except Exception: - print(f'Could not setup {arch}') - raise - if not target: - raise RuntimeError(f'Could not setup {arch}') - print(target) - if arch == 'windows': - if not target.endswith('.a'): - raise RuntimeError("Not .a extracted!") - else: - files = glob.glob(os.path.join(target, "lib", "*.a")) - if not files: - raise RuntimeError("No lib/*.a unpacked!") - finally: - if target is not None: - if os.path.isfile(target): - os.unlink(target) - else: - shutil.rmtree(target) - -def test_version(expected_version, ilp64=get_ilp64()): - """ - Assert that expected OpenBLAS version is - actually available via SciPy - """ - import scipy - import scipy.linalg - import ctypes - - dll = ctypes.CDLL(scipy.linalg.cython_blas.__file__) - if ilp64 == "64_": - get_config = dll.openblas_get_config64_ - else: - get_config = dll.openblas_get_config - get_config.restype = ctypes.c_char_p - res = get_config() - print('OpenBLAS get_config returned', str(res)) - check_str = b'OpenBLAS %s' % expected_version[0].encode() - assert check_str in res - - if 'dev' not in expected_version[0]: - assert b'dev' not in res - - if ilp64: - assert b"USE64BITINT" in res - else: - assert b"USE64BITINT" not in res - - -if __name__ == '__main__': - import argparse - parser = argparse.ArgumentParser( - description='Download and expand an OpenBLAS archive for this ' - 'architecture') - parser.add_argument('--test', nargs='*', default=None, - help='Test different architectures. "all", or any of %s' % ARCHITECTURES) - parser.add_argument('--check_version', nargs=1, default=None, - help='Check provided OpenBLAS version string against available OpenBLAS') - args = parser.parse_args() - if args.check_version is not None: - test_version(args.check_version) - elif args.test is None: - print(setup_openblas()) - else: - if len(args.test) == 0 or 'all' in args.test: - test_setup(ARCHITECTURES) - else: - test_setup(args.test) From 2bcb646f4d995950103cece70e3b9d623edfb293 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 18 May 2021 08:22:23 -0400 Subject: [PATCH 62/66] Use pytest for tests now --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2cd1c45..ec46b25b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,8 +21,8 @@ jobs: CIBW_SKIP: "cp27-* cp34-* cp35-* pp*" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" CIBW_BEFORE_ALL_MACOS: "brew install openblas lapack" - CIBW_TEST_COMMAND: "nosetests {project}/test" - CIBW_TEST_REQUIRES: nose + CIBW_TEST_COMMAND: "pytest {project}/test" + CIBW_TEST_REQUIRES: pytest - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl From 5e164782e34235a22dd9eb7ca13548860b8ee8f3 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 7 Jun 2021 13:42:29 -0400 Subject: [PATCH 63/66] Try building wheels for windows like windows ci test job --- .github/workflows/release.yml | 53 +++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec46b25b..a64f2d85 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,14 +9,14 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v2 with: submodules: true - name: Build wheels - uses: joerick/cibuildwheel@v1.11.0 + uses: pypa/cibuildwheel@v1.11.1 env: CIBW_SKIP: "cp27-* cp34-* cp35-* pp*" CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel liblapack-dev" @@ -26,3 +26,52 @@ jobs: - uses: actions/upload-artifact@v2 with: path: ./wheelhouse/*.whl + build_wheels_windows: + name: Build wheels on windows Python-${{ matrix.python-version }} ${{ matrix.arch }} + runs-on: windows-latest + strategy: + matrix: + arch: [x64] #, x86] + python-version: [3.6, 3.7, 3.8, 3.9] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - uses: conda-incubator/setup-miniconda@v2 + if: matrix.arch == 'x64' + with: + activate-environment: scs + auto-update-conda: true + channels: conda-forge,anaconda + python-version: ${{ matrix.python-version }} + miniconda-version: "latest" + - uses: conda-incubator/setup-miniconda@v2 + if: matrix.arch == 'x86' + with: + activate-environment: scs + miniconda-version: "4.5.12" + auto-update-conda: true + channels: conda-forge,ana + python-version: ${{ matrix.python-version }} + architecture: x86 + - name: Install Deps + run: conda install numpy scipy nose mkl openblas lapack + - name: Build Wheel + run: python setup.py bdist_wheel + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.arch }} + - name: Run tests + shell: bash -l {0} + run: | + set -e + which python + pip install dist/*whl + pip install pytest + pytest + - uses: actions/upload-artifact@v2 + with: + path: ./dist/*.whl From 6b51fbeb7b1226cba3c2de431169c213c7e22770 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 7 Jun 2021 13:54:47 -0400 Subject: [PATCH 64/66] Try not using conda for windows whell test phase --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a64f2d85..12c387fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.arch }} - name: Run tests - shell: bash -l {0} + shell: bash run: | set -e which python From 70e29f1eb4473aefdefa06649ddcf029fa965d41 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 7 Jun 2021 14:05:27 -0400 Subject: [PATCH 65/66] Try adding delvewheel to bundle DLLs --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 12c387fe..d0923ae7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,6 +59,12 @@ jobs: run: conda install numpy scipy nose mkl openblas lapack - name: Build Wheel run: python setup.py bdist_wheel + - name: Repair Wheel + shell: bash -l {0} + run: | + set -e + pip install delvewheel + delvewheel repair dist/*whl - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: @@ -69,7 +75,7 @@ jobs: run: | set -e which python - pip install dist/*whl + pip install wheelhouse/*whl pip install pytest pytest - uses: actions/upload-artifact@v2 From 8383754ed4c7946f6fd73ec0fd2f36be1c0d3137 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 7 Jun 2021 14:11:46 -0400 Subject: [PATCH 66/66] Fix pyproject.toml --- pyproject.toml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 965e3297..3a567e98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,7 @@ [build-system] requires = [ - "numpy==1.17; python_version=='3.5'", - "numpy==1.17; python_version=='3.6'", - "numpy==1.17; python_version=='3.7'", - "numpy==1.17; python_version=='3.8'", - "numpy==1.19; python_version=='3.9'", - "setuptools", - "wheel", + "setuptools", + "wheel", + "oldest-supported-numpy", ] build-backend = "setuptools.build_meta"