From 8218f75ad01aa160640556294361a2a17c004d65 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 3 Aug 2022 17:08:02 +0200 Subject: [PATCH 1/3] Add long_description Signed-off-by: Petr "Stone" Hracek --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 72c676d..be9a6f3 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,10 @@ # Authors: Petr Hracek from setuptools import setup, find_packages +from pathlib import Path + +this_directory = Path(__file__).parent +long_description = (this_directory / "README.md").read_text() def get_requirements(): @@ -37,6 +41,8 @@ def get_requirements(): setup( name="container-ci-suite", description='A python3 container CI tool for testing images.', + long_description=long_description, + long_description_content_type='text/markdown', version="0.0.3", keywords='tool,containers,images,tests', packages=find_packages(exclude=["tests"]), From 2a6f77b01d1a37209b58fb5db8a8ed38dda51890 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 3 Aug 2022 17:14:00 +0200 Subject: [PATCH 2/3] Fix pre-commit-issues Signed-off-by: Petr "Stone" Hracek --- .github/workflows/pre-commit-tests.yml | 39 -------------------------- requirements.txt | 2 +- tests/test_git.py | 5 ++-- tox.ini | 2 +- 4 files changed, 4 insertions(+), 44 deletions(-) diff --git a/.github/workflows/pre-commit-tests.yml b/.github/workflows/pre-commit-tests.yml index 1d17b9c..f31397b 100644 --- a/.github/workflows/pre-commit-tests.yml +++ b/.github/workflows/pre-commit-tests.yml @@ -6,7 +6,6 @@ on: - master jobs: sanity: - name: Sanity tests runs-on: ubuntu-20.04 steps: - name: Checkout repo @@ -25,23 +24,6 @@ jobs: sudo apt-get update && sudo apt-get -y install curl jq make git shellcheck python3 python3-pip pip3 install pre-commit - - name: Create status check to pending - id: pending - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - cat << EOF > pending.json - { - "sha": "${{ steps.sha.outputs.SHA }}", - "state": "pending", - "context": "Sanity tests" - } - EOF - echo "https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/${{ steps.sha.outputs.SHA}} " - curl -X POST -H "Authorization: Bearer $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/${{ steps.sha.outputs.SHA }} \ - --data @pending.json - - name: Run Sanity pre-commit tests continue-on-error: true id: pre_commit_tests @@ -49,24 +31,3 @@ jobs: set +e make pre-commit-check echo ::set-output name=exit_status::$? - - - name: Switch to final state - run: | - echo "Result from pre_commit_tests is ${{ steps.pre_commit_tests.outputs.exit_status }}" - if [[ ${{ steps.pre_commit_tests.outputs.exit_status }} == 0 ]]; then - FINAL_STATE="success" - else - FINAL_STATE="failure" - fi - cat << EOF > final.json - { - "sha": "${{ steps.sha.outputs.SHA }}", - "state": "${FINAL_STATE}", - "context": "pre-commit-tests", - "description": "Build finished" - } - EOF - cat final.json - curl -X POST -H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/${{ steps.sha.outputs.SHA }} \ - --data @final.json diff --git a/requirements.txt b/requirements.txt index 2c36afe..edde097 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ pytest flexmock -GitPython \ No newline at end of file +GitPython diff --git a/tests/test_git.py b/tests/test_git.py index 277f82a..269d6f9 100644 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -19,7 +19,8 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import pytest + + import os from pathlib import Path @@ -28,8 +29,6 @@ from container_ci_suite.git import Git -from tests.spellbook import TESTS_DIR - class TestContainerCISuiteGit(object): diff --git a/tox.ini b/tox.ini index c6e54fa..67fb9e6 100644 --- a/tox.ini +++ b/tox.ini @@ -7,4 +7,4 @@ commands = python3 -m pytest --color=yes -v --showlocals tests/ deps = pytest flexmock - GitPython \ No newline at end of file + GitPython From ea2653fa3c57726e172139ad7cf74751b286ba4a Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 3 Aug 2022 17:18:25 +0200 Subject: [PATCH 3/3] Fix calling pre-commit hook Signed-off-by: Petr "Stone" Hracek --- .github/workflows/pre-commit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-tests.yml b/.github/workflows/pre-commit-tests.yml index f31397b..6ebb818 100644 --- a/.github/workflows/pre-commit-tests.yml +++ b/.github/workflows/pre-commit-tests.yml @@ -29,5 +29,5 @@ jobs: id: pre_commit_tests run: | set +e - make pre-commit-check + pre-commit run --all echo ::set-output name=exit_status::$?