From 138828d8ea8a3463ca937715d120c6918a5252c7 Mon Sep 17 00:00:00 2001 From: Joshua Sant'Anna <45068597+dataJSA@users.noreply.github.com> Date: Wed, 11 Oct 2023 06:56:42 +0200 Subject: [PATCH] chore: Remove sha from package version (PEP 440) --- docs/source/conf.py | 8 ++++---- setup.py | 16 +++------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 44e7639..111c23f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,14 +20,14 @@ # sys.path.insert(0, os.path.abspath('.')) import os import sys -import pyro_risks -import sphinx_rtd_theme from datetime import datetime +import sphinx_rtd_theme from docutils import nodes -from sphinx.util.docfields import TypedField from sphinx import addnodes +from sphinx.util.docfields import TypedField +import pyro_risks sys.path.insert(0, os.path.abspath("../../pyro_risks")) # -- Project information ----------------------------------------------------- @@ -39,7 +39,7 @@ # The full version, including alpha/beta/rc tags version = pyro_risks.__version__ -release = pyro_risks.__version__ + "-git" +release = pyro_risks.__version__ # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index 9f1571c..b902859 100644 --- a/setup.py +++ b/setup.py @@ -11,28 +11,18 @@ import os import subprocess -from setuptools import setup, find_packages + +from setuptools import find_packages, setup package_name = "pyro_risks" with open(os.path.join(package_name, "version.py")) as version_file: version = version_file.read().strip() -sha = "Unknown" cwd = os.path.dirname(os.path.abspath(__file__)) -try: - sha = ( - subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=cwd) - .decode("ascii") - .strip() - ) -except Exception: - pass - if os.getenv("BUILD_VERSION"): version = os.getenv("BUILD_VERSION") -elif sha != "Unknown": - version += "+" + sha[:7] + print("Building wheel {}-{}".format(package_name, version))