diff --git a/.github/workflows/tests-win.yml b/.github/workflows/tests-win.yml new file mode 100644 index 00000000..b7b8819a --- /dev/null +++ b/.github/workflows/tests-win.yml @@ -0,0 +1,47 @@ +name: CI +on: + push: + paths: + - '.github/**' + - '**/*.pyx' + - '**/*.cpp' +jobs: + windows-ci: + name: "Win - tests - Python ${{ matrix.PYTHON_VERSION }}" + runs-on: windows-latest + env: + CI: True + ***REMOVED***: ${{ secrets.***REMOVED*** }} + ***REMOVED***: ${{ secrets.***REMOVED*** }} + strategy: + fail-fast: true + matrix: + PYTHON_VERSION: ['3.7'] + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout branch + uses: actions/checkout@v2.1.0 + with: + ref: ${{ github.head_ref }} + - name: Create .condarc + shell: pwsh + run: | + ((Get-Content -path .github/workflows/.condarc) -replace '***REMOVED***', '${{ secrets.***REMOVED*** }}') | Set-Content .github/workflows/.condarc + ((Get-Content -path .github/workflows/.condarc) -replace '***REMOVED***', '${{ secrets.***REMOVED*** }}') | Set-Content .github/workflows/.condarc + - uses: conda-incubator/setup-miniconda@723ab12c1d66bb893c5ac701f8e387f00b24549e + with: + python-version: ${{ matrix.PYTHON_VERSION }} + miniforge-variant: Mambaforge + miniforge-version: 4.10.0-0 + use-mamba: true + condarc-file: .github/workflows/.condarc + environment-file: environment-win.yml + activate-environment: quantcore.matrix + - name: Run Unit Tests + shell: pwsh + run: | + python -m pip install -e . --no-deps -vv --no-use-pep517 --disable-pip-version-check + pytest tests --doctest-modules src/ diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 87f507da..057c7b32 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,7 +7,7 @@ Changelog ========= -2.0.1 - UNRELEASED +2.0.1 - 2021-06-20 ------------------ **Bug fix**: diff --git a/environment-win.yml b/environment-win.yml new file mode 100644 index 00000000..ced9a7e0 --- /dev/null +++ b/environment-win.yml @@ -0,0 +1,28 @@ +name: quantcore.matrix +channels: + - ***REMOVED*** + - conda-forge + - nodefaults +dependencies: + - black + - c-compiler + - cxx-compiler + - cython + - flake8 + - libblas>=0=*mkl + - make + - mako + - matplotlib-base + - mkl-include + - numpydoc + - pandas + - pip + - pre-commit + - pytest + - pytest-xdist + - seaborn-base + - setuptools_scm + - sphinx + - sphinx_rtd_theme + - sphinxcontrib-apidoc + - xsimd diff --git a/setup.py b/setup.py index 5bf50773..d04460d7 100644 --- a/setup.py +++ b/setup.py @@ -45,10 +45,15 @@ with open(out_fn, "w") as f: f.write(rendered_src) +# add numpy headers +include_dirs = [np.get_include()] + if sys.platform == "win32": allocator_libs = [] extra_compile_args = ["/openmp", "/O2"] extra_link_args = ["/openmp"] + # make sure we can find xsimd headers + include_dirs.append(os.path.join(sys.prefix, "Library", "include")) else: allocator_libs = ["jemalloc"] extra_compile_args = [ @@ -68,7 +73,7 @@ extra_compile_args.append("-march=" + architecture) extension_args = dict( - include_dirs=[np.get_include()], + include_dirs=include_dirs, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, language="c++",