Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #26 from giampaolo/master
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/giampaolo/psutil:
  fix long_description on Windows (see: giampaolo#2168)
  make.bat: use default 'python' exe; get rid of hard-coded python path
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

ddelange committed Nov 11, 2022
2 parents 3d598ac + c0aadb1 commit cf2bc13
Showing 5 changed files with 18 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -100,7 +100,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
@@ -143,7 +143,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:
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

16 changes: 7 additions & 9 deletions make.bat
Original file line number Diff line number Diff line change
@@ -3,28 +3,26 @@
rem ==========================================================================
rem Shortcuts for various tasks, emulating UNIX "make" on Windows.
rem It is primarily intended as a shortcut for compiling / installing
rem psutil ("make.bat build", "make.bat install") and running tests
rem ("make.bat test").
rem psutil and running tests. E.g.:
rem
rem make build
rem make install
rem make test
rem
rem This script is modeled after my Windows installation which uses:
rem - Visual studio 2008 for Python 2.7
rem - Visual studio 2010 for Python 3.4+
rem ...therefore it might not work on your Windows installation.
rem
rem By default C:\Python27\python.exe is used.
rem To compile for a specific Python version run:
rem set PYTHON=C:\Python34\python.exe & make.bat build
rem
rem To use a different test script:
rem set PYTHON=C:\Python34\python.exe & set TSCRIPT=foo.py & make.bat test
rem set TSCRIPT=foo.py & make.bat test
rem ==========================================================================

if "%PYTHON%" == "" (
if exist "C:\Python38-64\python.exe" (
set PYTHON=C:\Python38-64\python.exe
) else (
set PYTHON=C:\Python27\python.exe
)
set PYTHON=python
)

if "%TSCRIPT%" == "" (
6 changes: 1 addition & 5 deletions scripts/internal/convert_readme.py
Original file line number Diff line number Diff line change
@@ -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__':
12 changes: 5 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -118,18 +118,16 @@ def get_version():
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',

0 comments on commit cf2bc13

Please sign in to comment.