diff --git a/.github/workflows/run_pytest.yml b/.github/workflows/run_pytest.yml new file mode 100644 index 0000000..de66ad0 --- /dev/null +++ b/.github/workflows/run_pytest.yml @@ -0,0 +1,29 @@ +name: Run Pytest + +on: + pull_request: + branches: [master] + types: [synchronize, opened, reopened, ready_for_review] + + # run checks on any change of master, including merge of PRs + push: + branches: [master] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + max-parallel: 1 + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v3 + with: + python-version: '3.11' + - name: Install package and dependencies + run: | + pip install .[test,gui] + - name: Test with pytest + run: | + pytest --cov=src/odmltables src/odmltables/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8b19d30..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -dist: trusty -language: python -sudo: true - -addons: - apt: - packages: - - libatlas3gf-base - - libatlas-dev - - libatlas-base-dev - - liblapack-dev - - gfortran - - python-scipy - -python: - - 3.6 - -env: - matrix: - # This environment tests for python 3 packages with conda - - DISTRIB="conda" PYTHON_VERSION="3.6" - NUMPY_VERSION="1.13.3" XLWT_VERSION="1.3.0" XLRD_VERSION="1.1.0" - COVERAGE="true" -# # This environment tests for python 3.9 packages with conda -# - DISTRIB="conda_min" PYTHON_VERSION="3.9" -# NUMPY_VERSION="1.13.3" XLWT_VERSION="1.3.0" XLRD_VERSION="1.1.0" -# COVERAGE="true" - # basic Ubuntu build environment - - DISTRIB="ubuntu" PYTHON_VERSION="3.6" INSTALL_ATLAS="true" - NUMPY_VERSION="1.13.3" XLWT_VERSION="1.3.0" XLRD_VERSION="1.1.0" - COVERAGE="true" - -install: source continuous_integration/install.sh -script: bash continuous_integration/test_script.sh -after_success: - - if [[ "$COVERAGE" == "true" ]]; then coveralls || echo "failed"; fi -cache: apt diff --git a/continuous_integration/install.sh b/continuous_integration/install.sh deleted file mode 100644 index 65a6ac9..0000000 --- a/continuous_integration/install.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# Based on a script from scikit-learn - -# This script is meant to be called by the "install" step defined in -# .travis.yml. See http://docs.travis-ci.com/ for more details. -# The behavior of the script is controlled by environment variabled defined -# in the .travis.yml in the top level folder of the project. - -set -e - -# Fix the compilers to workaround avoid having the Python 3.4 build -# lookup for g++44 unexpectedly. -export CC=gcc -export CXX=g++ - -if [[ "$DISTRIB" == "conda" ]]; then - # Deactivate the travis-provided virtual environment and setup a - # conda-based environment instead - deactivate - - # Use the miniconda installer for faster download / install of conda - # itself - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \ - -O miniconda.sh - chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda - export PATH=/home/travis/miniconda/bin:$PATH - conda config --set always_yes yes - conda update --yes conda - - # Configure the conda environment and put it in the path using the - # provided versions - conda create -n testenv --yes python=$PYTHON_VERSION pip nose coverage lxml pyyaml\ - numpy=$NUMPY_VERSION xlwt=$XLWT_VERSION xlrd=$XLRD_VERSION - source activate testenv - conda install libgfortran=1 - - # remove this once odml1.4 is on pypi - conda install -c conda-forge rdflib - -elif [[ "$DISTRIB" == "conda_min" ]]; then - # Deactivate the travis-provided virtual environment and setup a - # conda-based environment instead - deactivate - - # Use the miniconda installer for faster download / install of conda - # itself - wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \ - -O miniconda.sh - chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda - export PATH=/home/travis/miniconda/bin:$PATH - conda config --set always_yes yes - conda update --yes conda - - # Configure the conda environment and put it in the path using the - # provided versions - conda create -n testenv --yes python=$PYTHON_VERSION pip nose coverage lxml pyyaml \ - numpy=$NUMPY_VERSION xlwt=$XLWT_VERSION xlrd=$XLRD_VERSION - source activate testenv - - # remove this once odml1.4 is on pypi - conda install -c conda-forge rdflib - - if [[ "$COVERAGE" == "true" ]]; then - pip install coveralls - fi -elif [[ "$DISTRIB" == "ubuntu" ]]; then - # deactivate - # Create a new virtualenv using system site packages for numpy - # virtualenv testenv - # source testenv/bin/activate - pip install nose - pip install coverage - pip install quantities - pip install numpy==$NUMPY_VERSION - pip install xlwt==$XLWT_VERSION - pip install xlrd==$XLRD_VERSION - pip install lxml - pip install pyyaml - pip install rdflib - - #TODO: remove pip installations which are already covered by setup.py - -fi - - -if [[ "$COVERAGE" == "true" ]]; then - pip install coveralls -fi - -python setup.py install diff --git a/continuous_integration/test_script.sh b/continuous_integration/test_script.sh deleted file mode 100644 index cb17433..0000000 --- a/continuous_integration/test_script.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# Based on a script from scikit-learn - -# This script is meant to be called by the "script" step defined in -# .travis.yml. See http://docs.travis-ci.com/ for more details. -# The behavior of the script is controlled by environment variables defined -# in the .travis.yml in the top level folder of the project. - -set -e - -python --version -python -c "import numpy; print('numpy %s' % numpy.__version__)" - -if [[ "$COVERAGE" == "true" ]]; then - nosetests --with-coverage --cover-package=odmltables -else - nosetests -fi