From 784d23177a22e12239924277c57f329df27c52ed Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Fri, 19 May 2023 17:23:33 +0200 Subject: [PATCH 1/5] Create python-package-conda.yml --- .github/workflows/python-package-conda.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/python-package-conda.yml diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml new file mode 100644 index 0000000..72501fd --- /dev/null +++ b/.github/workflows/python-package-conda.yml @@ -0,0 +1,22 @@ +name: Python Package using Conda + +on: [push] + +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 --coverage src/odmltables From 11fc6934e76c0bc6a62d21e1ef5e4f3f53e79437 Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Fri, 19 May 2023 17:26:45 +0200 Subject: [PATCH 2/5] Update python-package-conda.yml --- .github/workflows/python-package-conda.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 72501fd..f027bf2 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -1,6 +1,13 @@ -name: Python Package using Conda +name: Run Pytest -on: [push] +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: From 7b14673f15b3e3a8472d752144f77c049d191483 Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Fri, 19 May 2023 17:27:49 +0200 Subject: [PATCH 3/5] Rename python-package-conda.yml to run_pytest.yml --- .github/workflows/{python-package-conda.yml => run_pytest.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{python-package-conda.yml => run_pytest.yml} (100%) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/run_pytest.yml similarity index 100% rename from .github/workflows/python-package-conda.yml rename to .github/workflows/run_pytest.yml From 5c949eec24ac45f4598240b3970a93987a9532e8 Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Fri, 19 May 2023 17:37:40 +0200 Subject: [PATCH 4/5] Update run_pytest.yml --- .github/workflows/run_pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_pytest.yml b/.github/workflows/run_pytest.yml index f027bf2..de66ad0 100644 --- a/.github/workflows/run_pytest.yml +++ b/.github/workflows/run_pytest.yml @@ -26,4 +26,4 @@ jobs: pip install .[test,gui] - name: Test with pytest run: | - pytest --coverage src/odmltables + pytest --cov=src/odmltables src/odmltables/ From 17943896ecb72862eb1b5476396387fb04052d56 Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Fri, 19 May 2023 18:07:03 +0200 Subject: [PATCH 5/5] Remove outdated test setup --- .travis.yml | 37 ----------- continuous_integration/install.sh | 90 --------------------------- continuous_integration/test_script.sh | 18 ------ 3 files changed, 145 deletions(-) delete mode 100644 .travis.yml delete mode 100644 continuous_integration/install.sh delete mode 100644 continuous_integration/test_script.sh 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