diff --git a/.travis/check_pylint_diff b/.github/workflows/check_pylint_diff.sh old mode 100755 new mode 100644 similarity index 97% rename from .travis/check_pylint_diff rename to .github/workflows/check_pylint_diff.sh index 0306be4e894..b609bb89468 --- a/.travis/check_pylint_diff +++ b/.github/workflows/check_pylint_diff.sh @@ -88,8 +88,8 @@ CURRENT_COMMIT=$(git rev-parse HEAD) if [ "$ARG1" ]; then PREVIOUS_COMMIT=$(git merge-base HEAD "$ARG1") else - PREVIOUS_COMMIT=$(git show --pretty=raw HEAD | - awk '/^parent /{ print $2; exit }') + PREVIOUS_COMMIT=$(git show -s --pretty=%P "$CURRENT_COMMIT") + # PREVIOUS_COMMIT=$(git show --pretty=raw HEAD | awk '/^parent /{ print $2; exit }') fi echo diff --git a/.github/workflows/clean_up_job.yml b/.github/workflows/clean_up_job.yml new file mode 100644 index 00000000000..90c2f400990 --- /dev/null +++ b/.github/workflows/clean_up_job.yml @@ -0,0 +1,14 @@ +name: Cleanup job + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Cleanup process + uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: ${{ secrets.BIOLAB_HELPER_TOKEN }} + if: !startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' diff --git a/.github/workflows/doc_job.yml b/.github/workflows/doc_job.yml new file mode 100644 index 00000000000..2f8931bf9c2 --- /dev/null +++ b/.github/workflows/doc_job.yml @@ -0,0 +1,35 @@ +name: Documentation + +on: + # Trigger the workflow on push or pull request, but only for the master branch + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: False + matrix: + python: [3.7] + os: [ubuntu-18.04] + + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python }} + + - name: Install linux system dependencies + run: sudo apt-get install -y libxkbcommon-x11-0 + + - name: Install Tox + run: pip install tox + + - name: Build documentation + run: xvfb-run -a -s "-screen 0 1280x1024x24" tox -e build_doc diff --git a/.github/workflows/lint_job.yml b/.github/workflows/lint_job.yml new file mode 100644 index 00000000000..3a52bb59ce6 --- /dev/null +++ b/.github/workflows/lint_job.yml @@ -0,0 +1,34 @@ +name: Lint Job + +on: + # Trigger the workflow on push or pull request, but only for the master branch + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: False + matrix: + python: [3.7] + os: [ubuntu-18.04] + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '2' + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python }} + + - name: Install Tox + run: pip install tox + + - name: Run Pylint + run: tox -e pylint-ci diff --git a/.github/workflows/linux_job.yml b/.github/workflows/linux_job.yml new file mode 100644 index 00000000000..24d3c6f195c --- /dev/null +++ b/.github/workflows/linux_job.yml @@ -0,0 +1,64 @@ +name: Linux Job + +on: + # Trigger the workflow on push or pull request, but only for the master branch + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: False + matrix: + python: [3.6, 3.7] + os: [ubuntu-18.04] + + services: + postgres: + image: orangedm/postgres:11 + env: + POSTGRES_USER: postgres_user + POSTGRES_PASSWORD: postgres_password + POSTGRES_DB: postgres_db + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + SQLServer: + image: mcr.microsoft.com/mssql/server:2017-latest + env: + ACCEPT_EULA: Y + SA_PASSWORD: sqlServerPassw0rd + ports: + - 1433:1433 + + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python }} + + - name: Install linux system dependencies + run: sudo apt-get install -y libxkbcommon-x11-0 # for PyQt 5.12 + + - name: Install Tox + run: pip install tox + + - name: Run Tox + run: xvfb-run -a -s "-screen 0 1280x1024x24" tox -e coverage + env: + ORANGE_TEST_DB_URI: postgres://postgres_user:postgres_password@localhost:5432/postgres_db|mssql://SA:sqlServerPassw0rd@localhost:1433 + + - name: Upload code coverage + if: matrix.python == '3.7' + run: | + pip install codecov + codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index df2a119cd1e..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -language: python - -dist: xenial - -services: - - docker - -addons: - apt: - packages: - - libxkbcommon-x11-0 # for PyQt 5.12 - -matrix: - include: - - env: RUN_PYLINT=true - python: '3.6' - cache: {} - - env: BUILD_DOCS=true - python: '3.6' - script: source $TRAVIS_BUILD_DIR/.travis/build_doc.sh - - python: '3.6' - env: UPLOAD_COVERAGE=true - - python: '3.7' - fast_finish: true - -cache: - apt: true - pip: true - ccache: true - directories: - - $TRAVIS_BUILD_DIR/postgres - - $TRAVIS_BUILD_DIR/pyqt - -before_cache: - -before_install: - - set -e # fail on any error - - source $TRAVIS_BUILD_DIR/.travis/util.sh - -install: - - source $TRAVIS_BUILD_DIR/.travis/stage_install.sh - -script: - - source $TRAVIS_BUILD_DIR/.travis/stage_script.sh - -after_success: - - source $TRAVIS_BUILD_DIR/.travis/stage_after_success.sh diff --git a/.travis/install_mssql.sh b/.travis/install_mssql.sh deleted file mode 100755 index 81bb4a8c1ef..00000000000 --- a/.travis/install_mssql.sh +++ /dev/null @@ -1,7 +0,0 @@ -sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourStrong!Passw0rd' \ - -p 1433:1433 -d microsoft/mssql-server-linux:2017-latest - -export PYMSSQL_BUILD_WITH_BUNDLED_FREETDS=1 -pip install "pymssql<3.0" - -export ORANGE_TEST_DB_URI="${ORANGE_TEST_DB_URI}|mssql://SA:YourStrong!Passw0rd@0.0.0.0:1433" diff --git a/.travis/install_orange.sh b/.travis/install_orange.sh deleted file mode 100644 index 959f119abb6..00000000000 --- a/.travis/install_orange.sh +++ /dev/null @@ -1,31 +0,0 @@ -foldable pip install -U setuptools pip codecov - -# Don't install PyQt5 if PyQt4 is requested -[ "$PYQT4" ] && sed -i '/pyqt5/Id' requirements-doc.txt - -if [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then pip install pandas==0.20.3; fi - -pip install numba==0.41.0 llvmlite==0.26.0 - -# Install dependencies sequentially -cat requirements-core.txt \ - requirements-gui.txt \ - requirements-dev.txt \ - requirements-opt.txt \ - requirements-doc.txt | - while read dep; do - dep="${dep%%#*}" # Strip the comment - [ "$dep" ] && - foldable pip install $dep - done - -# Create a source tarball from the git checkout -foldable python setup.py sdist -# Create a binary wheel from the packed source -foldable pip wheel --no-deps -w dist dist/Orange3-*.tar.gz -# Install into a testing folder -ORANGE_DIR="$(pwd)"/build/travis-test -mkdir -p "$ORANGE_DIR" -pip install --no-deps --target "$ORANGE_DIR" dist/Orange3-*.whl - -cd $TRAVIS_BUILD_DIR diff --git a/.travis/install_postgres.sh b/.travis/install_postgres.sh deleted file mode 100644 index d024e2472c7..00000000000 --- a/.travis/install_postgres.sh +++ /dev/null @@ -1,50 +0,0 @@ -VERSION=9.5.0 -POSTGRES=$TRAVIS_BUILD_DIR/postgres/$VERSION - -if [ ! "$(ls $POSTGRES)" ]; then - mkdir -p $POSTGRES - cd $POSTGRES - - # Download PostgreSQL and extension sources - wget -O postgres.tar.bz2 https://ftp.postgresql.org/pub/source/v$VERSION/postgresql-$VERSION.tar.bz2 - tar xjf postgres.tar.bz2 --strip-components=1 - - wget http://api.pgxn.org/dist/quantile/1.1.4/quantile-1.1.4.zip - unzip quantile-1.1.4.zip - - # Build and install PostgreSQL - cd $POSTGRES - ./configure --prefix $POSTGRES - make install - - # Build and install tsm_system_time extension - cd contrib/tsm_system_time - make install - - # Add our PostgreSQL to PATH, so extensions know where to install. - export PATH=$POSTGRES/bin:$PATH - - # Install quantile extension - cd $POSTGRES/quantile-1.1.4 - make install - - cd $TRAVIS_BUILD_DIR -else - echo "Using cached PostgreSQL." -fi - -# Create a new database dir, create database test and register extensions -$POSTGRES/bin/initdb -D $TRAVIS_BUILD_DIR/db -$POSTGRES/bin/postgres -D $TRAVIS_BUILD_DIR/db -p 12345 & -# Kill postgres upon exit so Travis doesn't hang -# https://github.com/travis-ci/travis-ci/issues/6861#issuecomment-262166676 -POSTGRES_PID=$! -trap 'kill -INT $POSTGRES_PID' EXIT - -sleep 1 -$POSTGRES/bin/createdb -p 12345 test -$POSTGRES/bin/psql test -c 'CREATE EXTENSION quantile;' -p 12345 -$POSTGRES/bin/psql test -c 'CREATE EXTENSION tsm_system_time;' -p 12345 - -pip install psycopg2 -export ORANGE_TEST_DB_URI=postgres://localhost:12345/test diff --git a/.travis/install_pyqt.sh b/.travis/install_pyqt.sh deleted file mode 100644 index ef0cf224cd0..00000000000 --- a/.travis/install_pyqt.sh +++ /dev/null @@ -1,41 +0,0 @@ -if [ ! "$PYQT4" ]; then - foldable pip install sip 'pyqt5!=5.10,<5.14' # 5.10 exhibits QTBUG-65235 - # PyQt >= 5.12 distributes WebEngine separately - foldable pip install 'pyqtwebengine<5.14' - return $?; -fi - - -PYQT=$TRAVIS_BUILD_DIR/pyqt - -SIP_VERSION=4.16.9 -PYQT_VERSION=4.11.4 - -if [ ! "$(ls $PYQT)" ]; then - mkdir -p $PYQT - cd $PYQT - - wget -O sip.tar.gz http://sourceforge.net/projects/pyqt/files/sip/sip-$SIP_VERSION/sip-$SIP_VERSION.tar.gz - mkdir -p sip - tar xzf sip.tar.gz -C sip --strip-component=1 - - wget -O PyQt.tar.gz http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-$PYQT_VERSION/PyQt-x11-gpl-$PYQT_VERSION.tar.gz - mkdir -p PyQt - tar xzf PyQt.tar.gz -C PyQt --strip-components=1 - - cd $PYQT/sip - python configure.py -e $PYQT/include - make - make install - - cd $PYQT/PyQt - pwd - python configure.py --confirm-license --no-designer-plugin - make -fi - -cd $PYQT/sip -make install - -cd $PYQT/PyQt -make install diff --git a/.travis/stage_after_success.sh b/.travis/stage_after_success.sh deleted file mode 100644 index 100f59622b0..00000000000 --- a/.travis/stage_after_success.sh +++ /dev/null @@ -1,16 +0,0 @@ - -[ "$RUN_PYLINT" ] && return 0 # Nothing to do - -if [ "$BUILD_DOCS" ] && - [ $TRAVIS_REPO_SLUG = biolab/orange3 ] && - [ $TRAVIS_PULL_REQUEST = false ]; then - source $TRAVIS_BUILD_DIR/.travis/upload_doc.sh - return 0 -fi - -if [ "$UPLOAD_COVERAGE" ]; then - cp $TRAVIS_BUILD_DIR/codecov.yml . - codecov -fi - -cd $TRAVIS_BUILD_DIR diff --git a/.travis/stage_install.sh b/.travis/stage_install.sh deleted file mode 100644 index 5e08dbb5e7d..00000000000 --- a/.travis/stage_install.sh +++ /dev/null @@ -1,11 +0,0 @@ - -[ "$RUN_PYLINT" ] && return 0 # Nothing to do - -for script in \ - install_orange.sh \ - install_postgres.sh \ - install_mssql.sh \ - install_pyqt.sh -do - foldable source $TRAVIS_BUILD_DIR/.travis/$script -done diff --git a/.travis/stage_script.sh b/.travis/stage_script.sh deleted file mode 100644 index 85b13c73883..00000000000 --- a/.travis/stage_script.sh +++ /dev/null @@ -1,37 +0,0 @@ - -if [ "$RUN_PYLINT" ]; then - cd $TRAVIS_BUILD_DIR - foldable pip install -r requirements-dev.txt - foldable pip uninstall -y radon # disable radon in favor of codeclimate - cp pylintrc ~/.pylintrc - .travis/check_pylint_diff - EXIT_CODE=$? - echo "Lint check returned ${EXIT_CODE}" - return ${EXIT_CODE} -fi - -cd "$ORANGE_DIR" -python -c "from Orange.tests import *" -cp "$TRAVIS_BUILD_DIR"/.coveragerc ./ # for covereage and codecov -export PYTHONPATH="$ORANGE_DIR" PYTHONUNBUFFERED=x - -# Screen must be 24bpp lest pyqt5 crashes, see pytest-dev/pytest-qt/35 -XVFBARGS="-screen 0 1280x1024x24" - -# Raise deprecations as errors in our tests -export ORANGE_DEPRECATIONS_ERROR=y -# Need this otherwise unittest installs a warning filter that overrides -# our desire to have OrangeDeprecationWarnings raised -export PYTHONWARNINGS=module - -# Compatibility with old workflows is tested separately -catchsegv xvfb-run -a -s "$XVFBARGS" \ - python -m unittest Orange.widgets.tests.test_workflows -v - -# Skip loading of example workflows as that inflates coverage -export SKIP_EXAMPLE_WORKFLOWS=True -catchsegv xvfb-run -a -s "$XVFBARGS" \ - coverage run -m unittest -v \ - Orange.tests \ - Orange.widgets.tests -coverage combine diff --git a/.travis/upload_doc.sh b/.travis/upload_doc.sh deleted file mode 100644 index ce63a17570e..00000000000 --- a/.travis/upload_doc.sh +++ /dev/null @@ -1,18 +0,0 @@ -cd "$TRAVIS_BUILD_DIR" - -# Decrypt private key -openssl aes-256-cbc -K $encrypted_3fc26dee5a84_key -iv $encrypted_3fc26dee5a84_iv -in .travis/upload_doc_id -out .travis/key.private -d -chmod 700 .travis/key.private - -# Upload the docs -mkdir doc/orange3doc -cp -r doc/data-mining-library/build/html doc/orange3doc/data-mining-library -cp -r doc/development/build/html doc/orange3doc/development -cp -r doc/visual-programming/build/html doc/orange3doc/visual-programming -> ~/.ssh/config echo " -Host biolab.si - StrictHostKeyChecking no - User uploaddocs - IdentityFile $TRAVIS_BUILD_DIR/.travis/key.private -" -rsync -a --delete doc/orange3doc/ biolab.si:/orange3doc/ diff --git a/.travis/upload_doc_id b/.travis/upload_doc_id deleted file mode 100644 index 28d076e4f30..00000000000 Binary files a/.travis/upload_doc_id and /dev/null differ diff --git a/.travis/util.sh b/.travis/util.sh deleted file mode 100644 index d49390893fe..00000000000 --- a/.travis/util.sh +++ /dev/null @@ -1,14 +0,0 @@ - -foldable () -{ - # As documented in: - # https://github.com/travis-ci/travis-ci/issues/2158#issuecomment-42726890 - # https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719 - local _id="$RANDOM$RANDOM$RANDOM" - echo "travis_fold:start:$_id" - echo "$*" - "$@" - local _estatus="$?" - echo "travis_fold:end:$_id" - return $_estatus -} diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 3b258282962..00000000000 --- a/appveyor.yml +++ /dev/null @@ -1,71 +0,0 @@ -# https://packaging.python.org/en/latest/appveyor/ - -skip_commits: - files: - - doc/* - - .travis - - benchmark - - tutorials - -clone_depth: 30 - -matrix: - fast_finish: true - -environment: - global: - PIP_DISABLE_PIP_VERSION_CHECK: 1 - BUILD_ENV: wheel==0.29.0 pip~=19.0 - # SIP 4.19.4+ with PyQt5==5.9.1+ segfault our tests (GH-2756) - TEST_ENV: sip==4.19.6 PyQt5==5.9.2 numpy>=1.16.0 scipy scikit-learn pandas==0.21.1 "pymssql<3.0" - ORANGE_TEST_DB_URI: 'mssql://sa:Password12!@localhost:1433' - - matrix: - - PYTHON: C:\Python36-x64 - -cache: - - '%LOCALAPPDATA%\pip\cache -> appveyor.yml' - -services: - - mssql2017 - -install: - # Configure pip: Add extra links url, force binary numpy, scipy, ... - - echo [install]> pip.ini - - echo find-links =>> pip.ini - - echo https://orange.biolab.si/download/files/wheelhouse/>> pip.ini - - echo only-binary = numpy,scipy,scikit-learn>> pip.ini - - set "PIP_CONFIG_FILE=%CD%\pip.ini" - - type %PIP_CONFIG_FILE% - - - set "PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%" - - python -m ensurepip - - python -m pip install pip~=19.0 wheel~=0.29.0 - - python -m pip install %BUILD_ENV_INDEX% %BUILD_ENV% - -build_script: - - python -m pip list --format=freeze - - python setup.py clean --all - # get the package version - - for /f %%f in ('python setup.py --version') do ( set "VERSION=%%f" ) - - python -m pip wheel --no-deps -w dist ./ - -test_script: - - python -m venv --clear build\.test - - build\.test\Scripts\activate - - cd build\.test - # Pre-populate the test environment - - python -m pip install pip~=19.0 wheel~=0.29.0 - - - python -m pip install %TEST_ENV_INDEX% %TEST_ENV% - - python -m pip install -f ..\..\dist orange3==%VERSION% - - python -m pip list --format=freeze - - # Raise OrangeDeprecationWarnings as errors - - set ORANGE_DEPRECATIONS_ERROR=1 - - set PYTHONWARNINGS=module - - python -m unittest -b -v Orange.tests Orange.widgets.tests - - cd ..\.. - -artifacts: - - path: dist\*.whl diff --git a/tox.ini b/tox.ini index 5564c77035a..dc5150d9e0b 100644 --- a/tox.ini +++ b/tox.ini @@ -68,7 +68,7 @@ skip_install = true whitelist_externals = bash deps = pylint commands = - bash {toxinidir}/.travis/check_pylint_diff + bash .github/workflows/check_pylint_diff.sh [testenv:build_doc] changedir = {toxinidir}