From a23412612111c7a5ea6765d9827e8bc5049e97b0 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 6 Oct 2021 06:49:16 -0500 Subject: [PATCH] Requirements update, further attempts at gitlab pylint --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++---------- requirements.txt | 2 ++ 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af8c48a..43b276a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,16 +7,11 @@ default: - python3 -m pip install -r requirements.txt - apk --purge del .build-deps -stages: # List of stages for jobs, and their order of execution - - build - - test +stages: # List of stages for jobs, and their order of execution + - Test + - Build Wheel + -build-job: # This job runs in the build stage, which runs first. - stage: build - script: - - echo "Attempting to build distribution wheel" - - python -m build --wheel - - echo "Wheel successfully built!" # unit-test-job: # This job runs in the test stage. # stage: test # It only starts when the job in the build stage completes successfully. @@ -25,7 +20,21 @@ build-job: # This job runs in the build stage, which runs first. # - sleep 60 # - echo "Code coverage is 90%" -lint-test-job: # This job also runs in the test stage. +pylint: + stage: Static Analysis + before_script: + - pip install pylint-exit anybadge + script: + - mkdir ./pylint + - pylint --output-format=text asyncdb | tee ./pylint/pylint.log || pylint-exit "${?}" + - PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log) + - anybadge --label=Pylint --file=pylint/pylint.svg --value=$PYLINT_SCORE 2=red 4=orange 8=yellow 10=green + - echo "Pylint score is "${PYLINT_SCORE}" + artifacts: + paths: + - ./pylint/ + +lint-test-job: # This job also runs in the test stage. stage: test before_script: - pip install pylint pylint-exit anybadge @@ -39,3 +48,10 @@ lint-test-job: # This job also runs in the test stage. paths: - ./pylint/ + +build-job: # This job runs in the build stage, which runs first. + stage: Build Wheel + script: + - echo "Attempting to build distribution wheel" + - python -m build --wheel + - echo "Wheel successfully built!" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index daa1756..ac05af9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,3 +16,5 @@ toml==0.10.2 tomli==1.2.1 typing-extensions==3.10.0.2 wrapt==1.12.1 +pytest==6.2.5 +