diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..029121a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: Continuous Integration +on: + schedule: + - cron: '0 0 * * 2' + push: + branches: + - main + pull_request: + branches: + - main + paths: + - .github/workflows/ci.yml + - "exopy_pulses/**" + - "tests/**" + - setup.py + +jobs: + tests: + name: Unit tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest] + python-version: [3.7, 3.8, 3.9] + fail-fast: false + steps: + - name: Checkout branch + uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install https://github.com/Exopy/exopy/tarball/main + - name: Install project + run: | + python setup.py develop + - name: Install pytest + run: | + python -m pip install pytest pytest-cov pytest-qt pytest-timeout + python -m pip install https://github.com/MatthieuDartiailh/enaml_coverage_plugin/tarball/master + - name: Run tests (Windows) + if: matrix.os != 'ubuntu-latest' + run: python -X dev -m pytest tests --cov enaml --cov-report xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + if: matrix.os != 'windows-latest' + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: unittests + name: codecov-umbrella + fail_ci_if_error: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3c71ec7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,76 +0,0 @@ -# References https://gist.github.com/dan-blanchard/7045057 -# and https://docs.travis-ci.com/user/trusty-ci-environment/ - -sudo: false -dist: trusty - -branches: - only: - - master - -matrix: - include: - - env: PYTHON=3.6 CONDA_PY=36 QT_VERSION=5 - - env: PYTHON=3.7 CONDA_PY=37 QT_VERSION=5 - - env: PYTHON=3.8 CONDA_PY=38 QT_VERSION=5 - -before_install: - - # Install Miniconda - - travis_retry wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - chmod +x miniconda.sh - - ./miniconda.sh -b -p ~/anaconda - - export PATH=~/anaconda/bin:$PATH - - # Setup environment - - travis_retry conda update --yes conda - - conda config --set always_yes yes - - conda config --append channels conda-forge - - conda config --append channels exopy - - conda install conda-build anaconda-client -q - - conda info -a - - travis_retry conda create -n travisci --yes python=$PYTHON pip - - source activate travisci - - CONDA_INSTALL="conda install -q" - - PIP_INSTALL="pip install -q" - - # Setup conda build output directory - - cd ~ - - mkdir conda-bld-out - - cd conda-bld-out - - export CONDA_BLD_PATH=$(pwd) - - # Install ecpy dependencies - - $CONDA_INSTALL pyqt=$QT_VERSION numpy exopy - - # Intall test tools - - $CONDA_INSTALL pytest - - $PIP_INSTALL pytest-cov pytest-timeout pytest-qt - - $PIP_INSTALL https://github.com/MatthieuDartiailh/enaml_coverage_plugin/tarball/master - - # Install codecov report tools - - $PIP_INSTALL codecov - -install: - - # Install exopy_pulses - - cd $TRAVIS_BUILD_DIR - - conda build conda -q # Package building does run only very minimal tests - - conda install exopy_pulses --use-local --yes -q - - cd ~ - -before_script: - # I need a (fake) display on Travis so I need to start a X server. - - export DISPLAY=:99.0 - - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render - -script: - # Run the exopy_pulses test suite - - cd ~ - - export COVERAGE_DATAFILE=$TRAVIS_BUILD_DIR/.coverage - - "pytest $TRAVIS_BUILD_DIR/tests -v --log-cli-level CRITICAL --cov exopy_pulses --cov-report xml:$TRAVIS_BUILD_DIR/coverage.xml --cov-config $TRAVIS_BUILD_DIR/.coveragerc" - -after_success: - - cd $TRAVIS_BUILD_DIR - - codecov - - if [ "$TRAVIS_PULL_REQUEST" = false ]; then bash continuous-integration/deploy.sh; fi diff --git a/conda/bld.bat b/conda/bld.bat deleted file mode 100644 index 3f3fa9a..0000000 --- a/conda/bld.bat +++ /dev/null @@ -1,5 +0,0 @@ -python setup.py install --single-version-externally-managed --record=/dev/null -if errorlevel 1 exit 1 - -del %SCRIPTS%\enaml-run.exe* -if errorlevel 1 exit 1 diff --git a/conda/build.sh b/conda/build.sh deleted file mode 100644 index 452c2a7..0000000 --- a/conda/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -$PYTHON setup.py install --single-version-externally-managed --record=/dev/null - -rm $PREFIX/bin/easy_* diff --git a/conda/meta.yaml b/conda/meta.yaml deleted file mode 100644 index 302eec1..0000000 --- a/conda/meta.yaml +++ /dev/null @@ -1,32 +0,0 @@ -package: - name: exopy_pulses - version: {{ environ.get('GIT_DESCRIBE_TAG', '') + - ( '' if environ.get('GIT_DESCRIBE_NUMBER', '0') == '0' else - ('.post' + environ.get('GIT_DESCRIBE_NUMBER', '0' ) - ) - )}} - -source: - path: .. - -build: - number: {{ environ.get('GIT_DESCRIBE_NUMBER', 1) }} - preserve_egg_dir: True - -requirements: - build: - - python - run: - - python - - exopy >=0.2.0.dev - - numpy - -test: - imports: - - exopy_pulses - -about: - home: https://github.com/Exopy/exopy_pulses - license: BSD - license_file: LICENSE - summary: Pulse sequences generation for Exopy diff --git a/continuous-integration/anaconda-push.py b/continuous-integration/anaconda-push.py deleted file mode 100644 index 87b6ba7..0000000 --- a/continuous-integration/anaconda-push.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -"""Push all conda packages found in a directory to anaconda.org - -""" -import os -import glob -import subprocess -import traceback - - -def upload(): - """Invoke anaconda client to upload conda packages. - - """ - token = os.environ['ANACONDA_TOKEN'] - cmd = ['anaconda', '-t', token, 'upload', '--force'] - packages = [] - for anchor in ('noarch', 'linux-64', 'osx-64', 'win-32', 'win-64'): - packages.extend(glob.glob(anchor + '/*.tar.bz2')) - print('Found packages are :\n', packages) - cmd.extend(packages) - try: - subprocess.check_call(cmd) - except subprocess.CalledProcessError: - traceback.print_exc() - -if __name__ == '__main__': - upload() diff --git a/continuous-integration/deploy.sh b/continuous-integration/deploy.sh deleted file mode 100644 index ed88755..0000000 --- a/continuous-integration/deploy.sh +++ /dev/null @@ -1,8 +0,0 @@ -set -e -cd $TRAVIS_BUILD_DIR -PACK="$(conda build conda --output)" -conda convert $PACK -p osx-64 -p win-64 --quiet -o $CONDA_BLD_PATH -conda convert $PACK -p win-32 --quiet -o $CONDA_BLD_PATH -cd $CONDA_BLD_PATH -source deactivate -python $TRAVIS_BUILD_DIR/continuous-integration/anaconda-push.py diff --git a/exopy_pulses/testing/fixtures.py b/exopy_pulses/testing/fixtures.py index acc9996..39e4200 100644 --- a/exopy_pulses/testing/fixtures.py +++ b/exopy_pulses/testing/fixtures.py @@ -35,7 +35,7 @@ pytests_plugin = str('exopy.testing.fixtures'), -@pytest.yield_fixture +@pytest.fixture def pulses_workbench(monkeypatch, app_dir): """Setup the workbench in such a way that the pulses manager can be tested. diff --git a/exopy_pulses/testing/workspace/fixtures.py b/exopy_pulses/testing/workspace/fixtures.py index de5607b..ae33f81 100644 --- a/exopy_pulses/testing/workspace/fixtures.py +++ b/exopy_pulses/testing/workspace/fixtures.py @@ -21,7 +21,7 @@ pytests_plugin = str('exopy_pulses.testing.fixtures'), -@pytest.yield_fixture +@pytest.fixture def pulses_workspace(pulses_workbench, exopy_qtbot): """Create a measure workspace. diff --git a/setup.py b/setup.py index 89e1864..d5ea0ac 100644 --- a/setup.py +++ b/setup.py @@ -37,9 +37,9 @@ def long_description(): 'Natural Language :: English', 'Operating System :: OS Independent', 'Topic :: Scientific/Engineering :: Physics', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', ], zip_safe=False, python_requires='>=3.6',