7
"""Prints release announce based on HISTORY.rst file content.
8
See: https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode.
17
from psutil import __version__
20
HERE = os.path.abspath(os.path.dirname(__file__))
21
ROOT = os.path.realpath(os.path.join(HERE, '..', '..'))
22
HISTORY = os.path.join(ROOT, 'HISTORY.rst')
23
PRINT_HASHES_SCRIPT = os.path.join(
24
ROOT, 'scripts', 'internal', 'print_hashes.py'
28
PRJ_VERSION = __version__
29
PRJ_URL_HOME = 'https://github.com/giampaolo/psutil'
30
PRJ_URL_DOC = 'http://psutil.readthedocs.io'
31
PRJ_URL_DOWNLOAD = 'https://pypi.org/project/psutil/#files'
33
'https://github.com/giampaolo/psutil/blob/master/HISTORY.rst'
38
I'm glad to announce the release of {prj_name} {prj_version}:
44
psutil (process and system utilities) is a cross-platform library for \
45
retrieving information on running processes and system utilization (CPU, \
46
memory, disks, network) in Python. It is useful mainly for system \
47
monitoring, profiling and limiting process resources and management of \
48
running processes. It implements many functionalities offered by command \
49
line tools such as: ps, top, lsof, netstat, ifconfig, who, df, kill, free, \
50
nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap. It \
51
currently supports Linux, Windows, macOS, Sun Solaris, FreeBSD, OpenBSD, \
52
NetBSD and AIX. Supported Python versions are 2.7 and 3.6+. PyPy is also \
63
- Home page: {prj_urlhome}
64
- Download: {prj_urldownload}
65
- Documentation: {prj_urldoc}
66
- What's new: {prj_urlwhatsnew}
75
Giampaolo - https://gmpy.dev/about
80
"""Get the most recent changes for this release by parsing
83
with open(HISTORY) as f:
91
if line.startswith('===='):
94
raise ValueError("something wrong")
100
if re.match(r"^- \d+_", line):
101
line = re.sub(r"^- (\d+)_", r"- #\1", line)
103
if line.startswith('===='):
107
raise ValueError("something wrong")
114
return "\n".join(block)
118
changes = get_changes()
120
subprocess.check_output([sys.executable, PRINT_HASHES_SCRIPT, 'dist/'])
124
text = template.format(
126
prj_version=PRJ_VERSION,
127
prj_urlhome=PRJ_URL_HOME,
128
prj_urldownload=PRJ_URL_DOWNLOAD,
129
prj_urldoc=PRJ_URL_DOC,
130
prj_urlwhatsnew=PRJ_URL_WHATSNEW,
137
if __name__ == '__main__':