Skip to content

Commit

Permalink
chore: Remove sha from package version (PEP 440)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsakv committed Oct 11, 2023
1 parent 7e48dc8 commit 138828d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------------------------------------------------
Expand All @@ -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 ---------------------------------------------------
Expand Down
16 changes: 3 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down

0 comments on commit 138828d

Please sign in to comment.