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

Fix python setup issues #1111

Merged
merged 2 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/")