From 97135f2e838ca60414c5bae2e1745b0ed7dc1dbc Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 8 Apr 2024 13:25:23 +0100 Subject: [PATCH 1/4] Updating conditional boolean check. --- .../check-version-pyproject-toml-version-module/action.yml | 2 +- .github/actions/check-version-release/action.yml | 2 +- .github/actions/check-version/action.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/check-version-pyproject-toml-version-module/action.yml b/.github/actions/check-version-pyproject-toml-version-module/action.yml index bd824f2..95c34b2 100644 --- a/.github/actions/check-version-pyproject-toml-version-module/action.yml +++ b/.github/actions/check-version-pyproject-toml-version-module/action.yml @@ -30,7 +30,7 @@ runs: PYPROJECT_EQUALS_PACKAGE_VERSION=$(python -c "from packaging.version import Version; print(Version('${PYPROJECT_VERSION}') == Version('${PACKAGE_VERSION}'))") echo "PYPROJECT_EQUALS_PACKAGE_VERSION=${PYPROJECT_EQUALS_PACKAGE_VERSION}" - if [[ PYPROJECT_EQUALS_PACKAGE_VERSION ]]; then + if [[ "$PYPROJECT_EQUALS_PACKAGE_VERSION" == True ]]; then echo "The pyproject.toml version is the same as the version in the package __init__.py module." else echo "The pyproject.toml version is NOT the same as the version in the package __init__.py module." diff --git a/.github/actions/check-version-release/action.yml b/.github/actions/check-version-release/action.yml index efb8d02..8cbc757 100644 --- a/.github/actions/check-version-release/action.yml +++ b/.github/actions/check-version-release/action.yml @@ -27,7 +27,7 @@ runs: PYPROJECT_EQUALS_GITHUB_RELEASE=$(python -c "from packaging.version import Version; print(Version('${PYPROJECT_VERSION}') == Version('${GITHUB_RELEASE_VERSION}'))") echo "PYPROJECT_EQUALS_GITHUB_RELEASE=${PYPROJECT_EQUALS_GITHUB_RELEASE}" - if [[ PYPROJECT_EQUALS_GITHUB_RELEASE ]]; then + if [[ "$PYPROJECT_EQUALS_GITHUB_RELEASE" == True ]]; then echo "The pyproject.toml version is equal to the latest GitHub release." else echo "The pyproject.toml version is NOT equal to the the latest GitHub release." diff --git a/.github/actions/check-version/action.yml b/.github/actions/check-version/action.yml index 4d741c9..e8f2036 100644 --- a/.github/actions/check-version/action.yml +++ b/.github/actions/check-version/action.yml @@ -27,7 +27,7 @@ runs: PYPROJECT_GREATER_THAN_GITHUB_RELEASE=$(python -c "from packaging.version import Version; print(Version('${PYPROJECT_VERSION}') > Version('${GITHUB_RELEASE_VERSION}'))") echo "PYPROJECT_GREATER_THAN_GITHUB_RELEASE=${PYPROJECT_GREATER_THAN_GITHUB_RELEASE}" - if [[ PYPROJECT_GREATER_THAN_GITHUB_RELEASE ]]; then + if [[ "$PYPROJECT_GREATER_THAN_GITHUB_RELEASE" == True ]]; then echo "The pyproject.toml version is greater than the latest GitHub release." else echo "The pyproject.toml version is not greater than the latest GitHub release." From 042fa6e46f9c8c1f7bcfcb9ad91178af26f13c4d Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 8 Apr 2024 13:28:47 +0100 Subject: [PATCH 2/4] Refactoring to run tests after the other parallel steps as I believe this was affecting the vespa response times. --- .github/workflows/main.yml | 3 ++- .github/workflows/publish.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6272dbd..22b46aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,6 +44,7 @@ jobs: test: runs-on: ubuntu-latest + needs: [precommit-checks, fixme-checks, package-version-checks, package-pyproject-version-checks] steps: - name: Check out repository code uses: actions/checkout@v4 @@ -53,8 +54,8 @@ jobs: test-publish: runs-on: ubuntu-latest + needs: [test] timeout-minutes: 10 - needs: [precommit-checks, fixme-checks, package-version-checks, package-pyproject-version-checks, test] steps: - name: Check out repository code uses: actions/checkout@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 304d787..7a63c92 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -43,6 +43,7 @@ jobs: test: runs-on: ubuntu-latest + needs: [precommit-checks, fixme-checks, package-version-checks, package-pyproject-version-checks] steps: - name: Check out repository code uses: actions/checkout@v4 @@ -52,8 +53,8 @@ jobs: publish: runs-on: ubuntu-latest + needs: [test] timeout-minutes: 10 - needs: [precommit-checks, fixme-checks, package-version-checks, package-pyproject-version-checks, test] steps: - name: Check out repository code uses: actions/checkout@v4 From cce36524a4b5eb9197310e83c12244674a853521 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 8 Apr 2024 13:34:56 +0100 Subject: [PATCH 3/4] Bumping the version. --- pyproject.toml | 2 +- src/cpr_sdk/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 152bf89..f9fa539 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "cpr_sdk" -version = "1.0.1" +version = "1.0.2" description = "" authors = ["CPR Tech "] readme = "README.md" diff --git a/src/cpr_sdk/version.py b/src/cpr_sdk/version.py index 004b583..cc9e155 100644 --- a/src/cpr_sdk/version.py +++ b/src/cpr_sdk/version.py @@ -1,6 +1,6 @@ _MAJOR = "1" _MINOR = "0" -_PATCH = "1" +_PATCH = "2" _SUFFIX = "" VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR) From e175980fe9111422b3324f31cefceeb11e4665c4 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 8 Apr 2024 14:41:43 +0100 Subject: [PATCH 4/4] Removing unrequired code. --- .../action.yml | 38 ------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/actions/check-version-pyproject-toml-version-module/action.yml diff --git a/.github/actions/check-version-pyproject-toml-version-module/action.yml b/.github/actions/check-version-pyproject-toml-version-module/action.yml deleted file mode 100644 index 95c34b2..0000000 --- a/.github/actions/check-version-pyproject-toml-version-module/action.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: check-pyproject-package-versions-match -description: Check that the pyproject.toml version is the same as the version in the version.py module - -runs: - using: composite - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Install poetry - shell: bash - run: | - pipx install poetry==1.7.1 - - - name: Install python or load from cache with dependencies - uses: actions/setup-python@v5 - with: - python-version: "3.10" - cache: "poetry" - - - shell: bash - run: | - pip install packaging==24.0 - PACKAGE_VERSION=$(python -c "from src import cpr_sdk; print(cpr_sdk.__version__)") - echo "PACKAGE_VERSION=${PACKAGE_VERSION}" - - PYPROJECT_VERSION=$(poetry version | cut -d' ' -f2) - echo "PYPROJECT_VERSION=${PYPROJECT_VERSION}" - - PYPROJECT_EQUALS_PACKAGE_VERSION=$(python -c "from packaging.version import Version; print(Version('${PYPROJECT_VERSION}') == Version('${PACKAGE_VERSION}'))") - echo "PYPROJECT_EQUALS_PACKAGE_VERSION=${PYPROJECT_EQUALS_PACKAGE_VERSION}" - - if [[ "$PYPROJECT_EQUALS_PACKAGE_VERSION" == True ]]; then - echo "The pyproject.toml version is the same as the version in the package __init__.py module." - else - echo "The pyproject.toml version is NOT the same as the version in the package __init__.py module." - exit 1 - fi