A couple of setup.py fixes (#5338)
* setup: fix long description read in python2 * setup: fix git_get_sha in python3 Fix #5317
This commit is contained in:
parent
976e815a6e
commit
81bd5cc4c3
7
setup.py
7
setup.py
|
|
@ -4,6 +4,7 @@ from __future__ import division
|
|||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import io
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
|
|
@ -16,14 +17,14 @@ PACKAGE_FILE = os.path.join(PACKAGE_DIR, 'package.json')
|
|||
with open(PACKAGE_FILE) as package_file:
|
||||
version_string = json.load(package_file)['version']
|
||||
|
||||
with open('README.md', encoding='utf-8') as f:
|
||||
with io.open('README.md', encoding='utf-8') as f:
|
||||
long_description = f.read()
|
||||
|
||||
|
||||
def get_git_sha():
|
||||
try:
|
||||
s = str(subprocess.check_output(['git', 'rev-parse', 'HEAD']))
|
||||
return s.strip()
|
||||
s = subprocess.check_output(['git', 'rev-parse', 'HEAD'])
|
||||
return s.decode().strip()
|
||||
except Exception:
|
||||
return ''
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue