diff --git a/.coveragerc b/.coveragerc index 291b0a3..39d874e 100644 --- a/.coveragerc +++ b/.coveragerc @@ -8,4 +8,4 @@ source=py_toeplitz fail_under=98 show_missing=True skip_covered=True -omit=*_flymake.py \ No newline at end of file +omit=*_flymake.py diff --git a/.github/workflows/cygwin-python.yml b/.github/workflows/cygwin-python.yml new file mode 100644 index 0000000..7f32924 --- /dev/null +++ b/.github/workflows/cygwin-python.yml @@ -0,0 +1,115 @@ +name: Cygwin Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup cache for pip + uses: actions/cache@v2 + with: + path: | + ~/.cache/pip/ + key: ${{ runner.os }}-build-${{ hashFiles('requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Install Cygwin + id: install-cygwin + uses: cygwin/cygwin-install-action@v2 + with: + platform: x86_64 + install-dir: 'C:\cygwin' + packages: >- + python38-devel python38-numpy python38-pytest python38-hypothesis python38-cython python38-pip + python38-wheel python38-setuptools liblapack-devel libopenblas gcc-fortran gcc-g++ + - name: Clean Windows PATH + uses: egor-tensin/cleanup-path@v1 + with: + dirs: 'C:\cygwin\bin;C:\cygwin\lib\lapack' + - name: Specify python version + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + /usr/sbin/alternatives --set python /usr/bin/python3.8 + /usr/sbin/alternatives --set python3 /usr/bin/python3.8 + - name: Ask pip to use cache contents + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + mkdir -p ~/.config/pip + echo >~/.config/pip/pip.conf $'[install]\nprefer-binary = True' + - name: Install build dependencies + shell: bash.exe -eo pipefail -o igncr "{0}" + env: + BLAS: /usr/lib/libblas.dll.a + LAPACK: /usr/lib/liblapack.dll.a + NPY_LAPACK_ORDER: openblas,lapack + NPY_BLAS_ORDER: openblas,blas + NPY_BLAS_LIBS: -lblas + NPY_LAPACK_LIBS: -llapack -lblas + run: | + python3.8 -m pip install --upgrade pip wheel 'setuptools<60' + python3.8 -m pip install cython pythran pybind11 + python3.8 -m pip install 'numpy!=1.21.*' + - name: Check NumPy import + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + ls -l $(find /usr/local/lib/python3.8/site-packages/numpy/ -name \*.dll) + file $(find /usr/local/lib/python3.8/site-packages/numpy/ -name \*.dll) + cygcheck $(find /usr/local/lib/python3.8/site-packages/numpy/ -name \*.dll) + ldd $(find /usr/local/lib/python3.8/site-packages/numpy/ -name \*.dll) + python3.8 -v -c "import numpy as np; print(np.__version__)" + python3.8 -v -c "import numpy.linalg as la" + python3.8 -v -c "import numpy.linalg.lapack_lite" + - name: Install more dependencies + shell: bash.exe -eo pipefail -o igncr "{0}" + env: + BLAS: /usr/lib/libblas.dll.a + LAPACK: /usr/lib/liblapack.dll.a + NPY_LAPACK_ORDER: openblas,lapack + NPY_BLAS_ORDER: openblas,blas + NPY_BLAS_LIBS: -lblas + NPY_LAPACK_LIBS: -llapack -lblas + run: | + python3.8 -m pip install 'scipy<1.3' + python3.8 -m pip install -r requirements.txt + python3.8 -m pip install -r requirements-test.txt + - name: Build wheel + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + python3.8 setup.py bdist_wheel + - name: Install wheel + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + python3.8 -m pip install dist/py_toeplitz*.whl + - name: Check that pip installed the extensions + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + python3.8 -m pip show py_toeplitz + python3.8 -m pip show -f py_toeplitz | grep .dll + site_packages=$(python3.8 -m pip show py_toeplitz | grep Location | cut -d " " -f 2 -); + dll_list=$(for name in $(python3.8 -m pip show -f py_toeplitz | grep -F .dll); do echo ${site_packages}/${name}; done) + ls -l ${dll_list} + file ${dll_list} + ldd ${dll_list} + cygcheck ${dll_list} + for name in ${dll_list}; + do + python3.8 -c "import "$(echo ${name} | sed -E -e "s|/home.*?site-packages/||g" -e "s|/|.|g" -e "s/.cpython-3.*-x86(_64)?-cygwin.dll//g") + done + - name: Test with pytest + shell: bash.exe -eo pipefail -o igncr "{0}" + run: | + python3.8 -m pip install pytest + python3.8 -m pip install . + python3.8 setup.py check + python3.8 -m pytest + python3.8 -m pytest --pyargs py_toeplitz --doctest-modules diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 78d4bba..655bc85 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -15,7 +15,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [2.7, 3.5, 3.6, 3.7] + python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v1 diff --git a/asv.conf.json b/asv.conf.json index 889ee70..1bdf3ce 100644 --- a/asv.conf.json +++ b/asv.conf.json @@ -77,9 +77,9 @@ // "pip+emcee": [""], // emcee is only available for install with pip. // }, "matrix": { - "numpy": ["1.16.6"], - "scipy": ["1.2.3"], - "cython": ["0.29.15"], + "numpy": ["1.20.0"], + "scipy": ["1.6.0"], + "cython": ["0.29.21"], ".": [""], }, diff --git a/requirements-dev.txt b/requirements-dev.txt index c1107de..0d24446 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,3 @@ +-r requirements.txt cython>=0.16 numpy -scipy>-0.16.0 diff --git a/requirements-test.txt b/requirements-test.txt index 6509381..33e498b 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,3 +1,3 @@ +-r requirements.txt pytest-cov hypothesis[numpy]>=4.38.0 -scipy diff --git a/setup.cfg b/setup.cfg index bb243e8..ab4ca17 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,8 +41,5 @@ python_requires= >=2.7, <4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* [options.packages.find] where=src -[bdist_wheel] -universal=True - [sdist] formats=bztar,zip,gztar \ No newline at end of file