summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-10-24 16:31:31 +0300
committerGiampaolo Rodola <g.rodola@gmail.com>2020-10-24 16:31:31 +0300
commitb5867a85362f9cb8c02ecf1668aa2dd2ffee6d0e (patch)
tree88b07f8123a7d57135682360bc5eef7a659ae421 /setup.py
parent6d42d4949faa2acd0a8e4f55f6472f641ee90199 (diff)
downloadpsutil-b5867a85362f9cb8c02ecf1668aa2dd2ffee6d0e.tar.gz
script to convert README for PYPI
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 615f6d7b..3a8dab59 100755
--- a/setup.py
+++ b/setup.py
@@ -14,6 +14,7 @@ import platform
import re
import shutil
import struct
+import subprocess
import sys
import tempfile
import warnings
@@ -98,9 +99,15 @@ macros.append(('PSUTIL_VERSION', int(VERSION.replace('.', ''))))
def get_description():
- README = os.path.join(HERE, 'README.rst')
- with open(README, 'r') as f:
- return f.read()
+ script = os.path.join(HERE, "scripts", "internal", "convert_readme.py")
+ readme = os.path.join(HERE, 'README.rst')
+ p = subprocess.Popen([sys.executable, script, readme],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if p.returncode != 0:
+ raise RuntimeError(stderr)
+ assert not stderr, stderr
+ return stdout.decode('utf8')
@contextlib.contextmanager