From 78bda3049992e8b1501a66c5ebc886720646197a Mon Sep 17 00:00:00 2001 From: Thomas Nipen Date: Mon, 11 Mar 2024 14:02:56 +0100 Subject: [PATCH] Cleanup CI-pipelines for testing --- .github/workflows/codeql-analysis.yml | 72 --------------------------- .github/workflows/python-package.yml | 11 ++-- makefile | 7 +-- run_coveralls.py | 14 ------ setup.py | 4 +- 5 files changed, 11 insertions(+), 97 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 run_coveralls.py diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 445d8d8..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,72 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "master" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "master" ] - schedule: - - cron: '19 4 * * 0' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 1b74b4b..3d05766 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.7] steps: - uses: actions/checkout@v2 @@ -25,19 +25,20 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - sudo apt install libgeos-dev libproj-dev + # sudo apt install libgeos-dev libproj-dev python -m pip install --upgrade pip python -m pip install flake8 nose - name: Install package run: | - python -m pip install . --only-binary=:all: + python -m pip install .[test] --only-binary=:all: - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 verif scripts --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with nose run: | - nosetests + coverage run --source verif -m unittest discover + coverage report --precision 2 diff --git a/makefile b/makefile index ae6be64..cba3a57 100644 --- a/makefile +++ b/makefile @@ -8,6 +8,7 @@ nothing: VERSION=$(shell grep __version__ verif/version.py | cut -d"=" -f2 | sed s"/ //g" | sed s"/'//g") test: coverage run --source verif -m unittest discover + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics coverage: test coverage report --precision 2 @@ -18,12 +19,12 @@ coverage: test dist: echo $(VERSION) rm -rf dist - python3.8 setup.py sdist - python3.8 setup.py bdist_wheel + python3 setup.py sdist + python3 setup.py bdist_wheel @ echo "Next, run 'twine upload dist/*'" clean: - python setup.py clean + python3 setup.py clean rm -rf build/ find . -name '*.pyc' -delete rm -rf deb_dist diff --git a/run_coveralls.py b/run_coveralls.py deleted file mode 100644 index e5bbe4f..0000000 --- a/run_coveralls.py +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/env/python - -# From: https://stackoverflow.com/a/33012308 -# Runs coveralls if Travis CI is detected - -import os -from subprocess import call - -if __name__ == '__main__': - if 'TRAVIS' in os.environ: - rc = call('coveralls') - raise SystemExit(rc) - else: - print("Travis was not detected -> Skipping coveralls") diff --git a/setup.py b/setup.py index e9a6e15..e7784f9 100644 --- a/setup.py +++ b/setup.py @@ -82,10 +82,8 @@ # for example: # $ pip install -e .[dev,test] extras_require={ - # 'dev': ['check-manifest'], - 'test': ['coverage', 'pep8', 'pylint'], + 'test': ['coverage', 'pep8', 'pylint', 'flake8'], 'cartopy': ['cartopy'], - # 'test': ['pytest'], }, test_suite="verif.tests",