Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Fix python setup issues (#1111)
Browse files Browse the repository at this point in the history
Co-authored-by: Alyona Teyber <[email protected]>
  • Loading branch information
dchassin and aivanova5 authored Mar 7, 2022
1 parent ef5126e commit 49379eb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions gldcore/link/python/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ python-install: $(top_srcdir)/gldcore/link/python/dist/gridlabd-$(notdir $(prefi
@python3 -m pip install --ignore-installed $(top_srcdir)/gldcore/link/python/dist/gridlabd-*.whl

python-clean:
@rm $(top_srcdir)/gldcore/link/python/dist/*.{whl,tar.gz}
@echo "uninstalling $(top_srcdir)/gldcore/link/python"
@python3 -m pip uninstall gridlabd -y || (echo "Use '. utilities/cleanwc' instead to clean this build."; exit 1)
1 change: 1 addition & 0 deletions gldcore/link/python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See https://docs.gridlabd.us/.
25 changes: 15 additions & 10 deletions gldcore/link/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,19 @@ def get_version(path=None):
build = int(info[2])
elif info[1] == "BRANCH":
branch = info[2].replace('"','')

from hashlib import blake2b
h = blake2b(digest_size=8)
h.update(branch.encode())
return '%d.%d.%d.%d.%d' % (major,minor,patch,build,int(h.hexdigest(),16))
except:
build = 0
# TODO: this needs to be revised to match PEP 440
return '%d.%d.%d-%d-%s' % (major,minor,patch,build,branch)

setup ( name = 'gridlabd',
version = get_version(),
description = 'HiPAS GridLAB-D',
author = 'SLAC Gismo',
author_email = 'gridlabd@gmail.com',
ext_modules = [gridlabd])
return '0.0.0'

setup (
name = 'gridlabd',
version = get_version(),
description = 'HiPAS GridLAB-D',
author = 'SLAC Gismo',
author_email = '[email protected]',
ext_modules = [gridlabd],
url = "https://www.gridlabd.us/")

0 comments on commit 49379eb

Please sign in to comment.