matrix:
  # Finish when first job fails
  fast_finish: true

notifications:
  - provider: Email
    to:
      - abbasi.sal@gmail.com
    on_build_success: true
    on_build_failure: true
    on_build_status_changed: true

environment:
  global:
    PYTHON: "C:\\conda"
    CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd"
    PYTHON_ARCH: "64" 

  matrix:
    - PYTHON_VERSION: "3.7"

platform:
  -x64

install:
  - if "%PYTHON_VERSION%" == "3.7" set "BASE_PYTHON_VERSION=3"
  - if "%PYTHON_ARCH%" == "64" set "ARCH_LABEL=-x64"
  # These are already installed on appveyor.  Update them.
  - set "CONDA_ROOT=C:\Miniconda%BASE_PYTHON_VERSION%%ARCH_LABEL%"
  # we can't "activate root" with sufficiently-old conda which appveyor has (?)
  # - "%CONDA_ROOT%\\Scripts\\activate root"
  - set "PATH=%CONDA_ROOT%;%CONDA_ROOT%\Scripts;%CONDA_ROOT%\Library\bin;%PATH%"
  - set PATH
  - echo CONDA_PREFIX %CONDA_PREFIX%
  - conda config --set always_yes yes
  # Use the latest conda
  - conda install -n root -q conda --no-pin
  # activate with newer conda, may set different variables
  - "%CONDA_ROOT%\\Scripts\\activate root"
  - echo CONDA_PREFIX %CONDA_PREFIX%
  - conda info -a
  - conda create -c conda-forge -q -n test-environment python=%PYTHON_VERSION% pybind11 pandas numpy matplotlib pytest ipython sortedcontainers libzip hdf5 h5py statsmodels boost-cpp mypy flake8 plotly ipywidgets

# Not a .NET project, we build in the install step instead
build: false

test_script:
  - echo CONDA_PREFIX %CONDA_PREFIX%
  - "%CONDA_ROOT%\\Scripts\\activate test-environment"
  - echo CONDA_PREFIX %CONDA_PREFIX%
  - echo PATH %PATH%
  - conda list
  - conda info -a
  - python -c "import sys; print(sys.version)"
  - python -c "import sys; print(sys.executable)"
  - python -c "import sys; print(sys.prefix)"
  - python --version
  - pip install scipy
  - python setup.py build_ext --inplace
  - python -m pytest pyqstrat
  - mypy --ignore-missing-imports pyqstrat/
  - flake8 --ignore W291,W293,E701 --max-line-length=160 pyqstrat/




