summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2022-11-11 07:29:43 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2022-11-11 07:29:43 -0800
commitc0aadb18038f2ce29dbdd9cc11be072b15fd34eb (patch)
treed4817f6d162f192f1bacaab0b5155895fb2fe1ba
parent8543b11cc8f9575c28dc748931e590219accf6f9 (diff)
downloadpsutil-c0aadb18038f2ce29dbdd9cc11be072b15fd34eb.tar.gz
fix long_description on Windows (see: #2168)
-rw-r--r--.github/workflows/build.yml6
-rw-r--r--Makefile6
-rwxr-xr-xscripts/internal/convert_readme.py6
-rwxr-xr-xsetup.py12
4 files changed, 12 insertions, 18 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 502ecb5a..1d9999f8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -22,7 +22,7 @@ name: build
jobs:
# Linux + macOS + Windows Python 3
py3:
- name: ${{ matrix.os }}-py3
+ name: py3-${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
@@ -62,7 +62,7 @@ jobs:
# psutil tests do not like running from a virtualenv with python>=3.7 so
# not using cibuildwheel for those. run them "manually" with this job.
windows-py3-test:
- name: windows-py3-test-${{ matrix.python }}-${{ matrix.architecture }}
+ name: py3-windows-test-${{ matrix.python }}-${{ matrix.architecture }}
needs: py3
runs-on: windows-2019
timeout-minutes: 20
@@ -105,7 +105,7 @@ jobs:
# Linux + macOS + Python 2
linux-macos-py2:
- name: ${{ matrix.os }}-py2
+ name: py2-${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
diff --git a/Makefile b/Makefile
index a5ee28e2..930325dd 100644
--- a/Makefile
+++ b/Makefile
@@ -254,7 +254,7 @@ git-tag-release: ## Git-tag a new release.
sdist: ## Create tar.gz source distribution.
${MAKE} generate-manifest
$(PYTHON) setup.py sdist
- $(PYTHON) -m twine check dist/*.tar.gz
+ $(PYTHON) -m twine check --strict dist/*.tar.gz
# --- others
@@ -276,7 +276,7 @@ pre-release: ## Check if we're ready to produce a new release.
${MAKE} download-wheels-appveyor
${MAKE} print-hashes
${MAKE} print-wheels
- $(PYTHON) -m twine check dist/*
+ $(PYTHON) -m twine check --strict dist/*
$(PYTHON) -c \
"from psutil import __version__ as ver; \
doc = open('docs/index.rst').read(); \
@@ -286,7 +286,7 @@ pre-release: ## Check if we're ready to produce a new release.
assert 'XXXX' not in history, 'XXXX in HISTORY.rst';"
release: ## Create a release (down/uploads tar.gz, wheels, git tag release).
- $(PYTHON) -m twine check dist/*
+ $(PYTHON) -m twine check --strict dist/*
$(PYTHON) -m twine upload dist/* # upload tar.gz and Windows wheels on PyPI
${MAKE} git-tag-release
diff --git a/scripts/internal/convert_readme.py b/scripts/internal/convert_readme.py
index bd00cf23..d96c6c5d 100755
--- a/scripts/internal/convert_readme.py
+++ b/scripts/internal/convert_readme.py
@@ -48,11 +48,7 @@ def main():
data = f.read()
data = re.sub(r".. raw:: html\n+\s+<div align[\s\S]*?/div>", summary, data)
data = re.sub(r"Sponsors\n========[\s\S]*?Example usages", funding, data)
- if len(sys.argv) > 2:
- with open(sys.argv[2], "wb") as f:
- f.write(data.encode("utf8"))
- else:
- print(data)
+ print(data)
if __name__ == '__main__':
diff --git a/setup.py b/setup.py
index 31777b9d..29039aad 100755
--- a/setup.py
+++ b/setup.py
@@ -118,18 +118,16 @@ else:
py_limited_api = {}
-def get_description():
+def get_long_description():
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=subprocess.PIPE, stderr=subprocess.PIPE,
+ universal_newlines=True)
stdout, stderr = p.communicate()
if p.returncode != 0:
raise RuntimeError(stderr)
- data = stdout.decode('utf8')
- if WINDOWS:
- data = data.replace('\r\n', '\n')
- return data
+ return stdout
@contextlib.contextmanager
@@ -388,7 +386,7 @@ def main():
version=VERSION,
cmdclass=cmdclass,
description=__doc__ .replace('\n', ' ').strip() if __doc__ else '',
- long_description=get_description(),
+ long_description=get_long_description(),
long_description_content_type='text/x-rst',
keywords=[
'ps', 'top', 'kill', 'free', 'lsof', 'netstat', 'nice', 'tty',