From 0115e037f9099a22e39b342fec190af3db4cdf55 Mon Sep 17 00:00:00 2001 From: Antoine Meillet Date: Mon, 5 Jul 2021 11:39:44 +0200 Subject: [PATCH 1/3] Continue CI/CD workflow when a step errors out Allow failures on the `build-publish` job to prevent transient or PyPI errors to give false negatives. --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7b9fa93..572c424 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -34,6 +34,7 @@ jobs: name: Build and publish Python distributions to TestPyPI and PyPI runs-on: ubuntu-latest needs: run-tests # only run when tests where successful + continue-on-error: true steps: - uses: actions/checkout@v2 From 6dab5f246977dc134d6b7faad5a56968f71f5002 Mon Sep 17 00:00:00 2001 From: Antoine Meillet Date: Mon, 5 Jul 2021 11:51:08 +0200 Subject: [PATCH 2/3] Only publish to PyPI when commit is pushed to master --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 572c424..795d59a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,6 +35,7 @@ jobs: runs-on: ubuntu-latest needs: run-tests # only run when tests where successful continue-on-error: true + if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v2 From 4cb195e4ea69eeeb30503bdcc3e5de083e135c60 Mon Sep 17 00:00:00 2001 From: Antoine Meillet Date: Mon, 5 Jul 2021 12:03:06 +0200 Subject: [PATCH 3/3] Use `setuptools_scm` As we build each commit to deploy on TestPyPI, we need each build to have a different verison number to avoid the "unique filename" issue. --- pyproject.toml | 4 ++++ setup.py | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0f99ba9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,4 @@ +[build-system] +requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"] + +[tool.setuptools_scm] diff --git a/setup.py b/setup.py index f59937c..b96b527 100644 --- a/setup.py +++ b/setup.py @@ -36,4 +36,6 @@ url="https://github.com/napalm-automation-community/napalm-servertech-pro2", include_package_data=True, install_requires=reqs, + use_scm_version=True, + setup_requires=["setuptools_scm"], )