Skip to content

Commit

Permalink
Add CI for Windows. (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtilly authored Jun 20, 2021
1 parent 0a8ddf3 commit cbf3204
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 2 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/tests-win.yml
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Changelog
=========

2.0.1 - UNRELEASED
2.0.1 - 2021-06-20
------------------

**Bug fix**:
Expand Down
28 changes: 28 additions & 0 deletions environment-win.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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++",
Expand Down

0 comments on commit cbf3204

Please sign in to comment.