From 4bf76c99c2a60a8f5b5506c9e0825f971a296432 Mon Sep 17 00:00:00 2001 From: Neha Dimri <83694401+nehadimri1991@users.noreply.github.com> Date: Mon, 6 May 2024 15:57:19 +0200 Subject: [PATCH] github workflow for pip release --- .github/workflows/release-pypi.yml | 3 --- setup.py | 8 ++++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index f333c82c..d888ca33 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -28,8 +28,5 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - latest_tag=$(git describe --tags --abbrev=0) - git tag -a "$latest_tag" -m "Version $latest_tag" - git push origin "$latest_tag" python setup.py sdist bdist_wheel twine upload dist/* \ No newline at end of file diff --git a/setup.py b/setup.py index 63799f42..e0f7abb4 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,16 @@ from setuptools import setup, find_packages +import subprocess with open("README.md", "r") as fh: long_description = fh.read() +# Fetch latest tag +latest_tag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"]).strip().decode("utf-8") + setup( name='optihood', packages=find_packages(), - #version="0.1", + version=latest_tag, author="Institute for Solar Technology (SPF), OST Rapperswil", author_email="neha.dimri@ost.ch", description="optihood optimization framework", @@ -20,6 +24,6 @@ "License :: OSI Approved :: MIT License", "Operating System :: Microsoft :: Windows", ], - setup_requires=["setuptools-git-versioning"], + #setup_requires=["setuptools-git-versioning"], python_requires=">=3.9", ) \ No newline at end of file