From 3f07e0d78f52123bb9daab62de478ee6e0521a7f Mon Sep 17 00:00:00 2001 From: Brian Marks Date: Thu, 13 Apr 2023 15:07:43 -0400 Subject: [PATCH] Fix auto-publish script and set correct version number (#16) * Attempt to fix auto-publish script * Fix directory * Fix directory * Fix directory * Fix * Remove test branch --- .github/workflows/automatic-python-publish.yml | 3 ++- setup.py | 8 +------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/automatic-python-publish.yml b/.github/workflows/automatic-python-publish.yml index aef6abe..a67ada4 100644 --- a/.github/workflows/automatic-python-publish.yml +++ b/.github/workflows/automatic-python-publish.yml @@ -48,5 +48,6 @@ jobs: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - python setup.py sdist bdist_wheel --version ${{ steps.semvers.outputs.patch }} + sed -i.bak 's/SNAPSHOT/${{ steps.semvers.outputs.patch }}/' ./setup.py + python setup.py sdist bdist_wheel twine upload dist/* diff --git a/setup.py b/setup.py index c08762e..f049e99 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,11 @@ import setuptools -import sys with open("README.md", "r") as fh: long_description = fh.read() -# Default +# Overridden by publish GH Action version = "SNAPSHOT" -if "--version" in sys.argv: - idx = sys.argv.index("--version") - sys.argv.pop(idx) - version = sys.argv.pop(idx) - print("Using version " + version) setuptools.setup(