From f9429ace31a2f95bf9eeec0d161083965db7a900 Mon Sep 17 00:00:00 2001 From: AJ <46843456+amckenna41@users.noreply.github.com> Date: Sat, 9 Mar 2024 14:05:30 +0000 Subject: [PATCH] v1.5.3; dependancy and package manager fix --- .github/workflows/deploy_pypi.yml | 18 +++++++++++++----- .github/workflows/deploy_test_pypi.yml | 18 +++++++++++++----- tests/test_get_iso3166_2.py | 2 +- tests/test_iso3166_2_api.py | 2 +- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy_pypi.yml b/.github/workflows/deploy_pypi.yml index f99930a..abe0c80 100644 --- a/.github/workflows/deploy_pypi.yml +++ b/.github/workflows/deploy_pypi.yml @@ -4,22 +4,22 @@ name: Deploy to PyPI 📦 on: workflow_run: workflows: [Deploy to TestPyPI 📦] - types: - - completed + types: [completed] # allow for workflow to be manually initiated from the Actions tab workflow_dispatch: +# build and deploy to PyPI server if test workflow was successful or manual trigger was selected jobs: - build: + test_success: name: Deploy to PyPI 📦 runs-on: ubuntu-latest # platform: [ubuntu-latest, macos-latest, windows-latest] + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} strategy: matrix: python-version: [3.9] #deploying using one Python version on 1 runner steps: - uses: actions/checkout@v3 - # build distribution package using poetry tool and upload to the PYPi server via custom github action - name: Build and publish to PyPI uses: JRubics/poetry-publish@v2.0 @@ -37,4 +37,12 @@ jobs: run: | pip install iso3166_2 --upgrade echo -e "import iso3166_2 as iso3166_2" | python3 - echo "iso3166_2 successfully installed" \ No newline at end of file + echo "iso3166_2 successfully installed" + + # test workflow was not successful so package not deployed to PyPI server + test_failure: + name: Test workflow failure + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + steps: + - run: echo "Test workflow failure, package not deployed to PyPI server" \ No newline at end of file diff --git a/.github/workflows/deploy_test_pypi.yml b/.github/workflows/deploy_test_pypi.yml index 2030204..6ea8de7 100644 --- a/.github/workflows/deploy_test_pypi.yml +++ b/.github/workflows/deploy_test_pypi.yml @@ -4,17 +4,17 @@ name: Deploy to TestPyPI 📦 on: workflow_run: workflows: ["Building and Testing"] - types: - - completed + types: [completed] # allow for workflow to be manually initiated from the Actions tab workflow_dispatch: -#build and deploy to Test PyPI server +# build and deploy to Test PyPI server if test workflow was successful or manual trigger was selected jobs: - build: + test_success: name: Deploy to TestPyPI 📦 runs-on: ubuntu-latest # platform: [ubuntu-latest, macos-latest, windows-latest] + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} strategy: matrix: python-version: [3.9] #deploying using one Python version on 1 runner @@ -39,4 +39,12 @@ jobs: - name: Install iso3166_2 from Test PyPI run: | pip install -i https://test.pypi.org/simple/ iso3166_2 --upgrade - echo "iso3166_2 successfully installed" \ No newline at end of file + echo "iso3166_2 successfully installed" + + # test workflow was not successful so package not deployed to Test PyPI or PyPI + test_failure: + name: Test workflow failure + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' }} + steps: + - run: echo "Test workflow failure, package not deployed to Test PyPI server" \ No newline at end of file diff --git a/tests/test_get_iso3166_2.py b/tests/test_get_iso3166_2.py index c11ae7d..8a29819 100644 --- a/tests/test_get_iso3166_2.py +++ b/tests/test_get_iso3166_2.py @@ -7,7 +7,7 @@ import unittest unittest.TestLoader.sortTestMethodsUsing = None -@unittest.skip("") +# @unittest.skip("") class Get_ISO3166_2_Tests(unittest.TestCase): """ Test suite for testing get_iso3166_2.py script that pulls all the ISO 3166-2 diff --git a/tests/test_iso3166_2_api.py b/tests/test_iso3166_2_api.py index 4077be6..270099a 100644 --- a/tests/test_iso3166_2_api.py +++ b/tests/test_iso3166_2_api.py @@ -7,7 +7,7 @@ from bs4 import BeautifulSoup import unittest unittest.TestLoader.sortTestMethodsUsing = None -@unittest.skip("") +# @unittest.skip("") class ISO3166_2_API_Tests(unittest.TestCase): """ Test suite for testing ISO 3166-2 api created to accompany the iso3166-2 Python software package.