setproctitle 1.3.4__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ """Allow customization of the process title."""
2
+
3
+ import os
4
+ import sys
5
+ import logging
6
+
7
+ logger = logging.getLogger("setproctitle")
8
+
9
+ __version__ = "1.3.4"
10
+
11
+ __all__ = [
12
+ "setproctitle",
13
+ "getproctitle",
14
+ "setthreadtitle",
15
+ "getthreadtitle",
16
+ ]
17
+
18
+
19
+ def setproctitle(title: str) -> None:
20
+ logger.debug("setproctitle C module not available")
21
+ return None
22
+
23
+
24
+ def getproctitle() -> str:
25
+ logger.debug("setproctitle C module not available")
26
+ return " ".join(sys.argv)
27
+
28
+
29
+ def setthreadtitle(title: str) -> None:
30
+ logger.debug("setproctitle C module not available")
31
+ return None
32
+
33
+
34
+ def getthreadtitle() -> str:
35
+ logger.debug("setproctitle C module not available")
36
+ return ""
37
+
38
+
39
+ try:
40
+ from . import _setproctitle # type: ignore
41
+ except ImportError as e:
42
+ # Emulate SPT_DEBUG showing process info in the C module.
43
+ if os.environ.get("SPT_DEBUG", ""):
44
+ logging.basicConfig()
45
+ logger.setLevel(logging.DEBUG)
46
+ logger.debug("failed to import setproctitle: %s", e)
47
+ else:
48
+ setproctitle = _setproctitle.setproctitle # noqa: F811
49
+ getproctitle = _setproctitle.getproctitle # noqa: F811
50
+ setthreadtitle = _setproctitle.setthreadtitle # noqa: F811
51
+ getthreadtitle = _setproctitle.getthreadtitle # noqa: F811
52
+
53
+
54
+ # Call getproctitle to initialize structures and avoid problems caused
55
+ # by fork() on macOS (see #113).
56
+ if sys.platform == "darwin":
57
+ getproctitle()
setproctitle/py.typed ADDED
File without changes
@@ -0,0 +1,367 @@
1
+ Metadata-Version: 2.1
2
+ Name: setproctitle
3
+ Version: 1.3.4
4
+ Summary: A Python module to customize the process title
5
+ Home-page: https://github.com/dvarrazzo/py-setproctitle
6
+ Download-URL: http://pypi.python.org/pypi/setproctitle/
7
+ Author: Daniele Varrazzo
8
+ Author-email: daniele.varrazzo@gmail.com
9
+ License: BSD-3-Clause
10
+ Platform: GNU/Linux
11
+ Platform: BSD
12
+ Platform: MacOS X
13
+ Platform: Windows
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: BSD License
17
+ Classifier: Programming Language :: C
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Operating System :: POSIX :: Linux
26
+ Classifier: Operating System :: POSIX :: BSD
27
+ Classifier: Operating System :: MacOS :: MacOS X
28
+ Classifier: Operating System :: Microsoft :: Windows
29
+ Classifier: Topic :: Software Development
30
+ Requires-Python: >=3.8
31
+ Description-Content-Type: text/x-rst
32
+ Provides-Extra: test
33
+ Requires-Dist: pytest ; extra == 'test'
34
+
35
+ A Python module to customize the process title
36
+ ==============================================
37
+
38
+ .. image:: https://github.com/dvarrazzo/py-setproctitle/workflows/Tests/badge.svg
39
+ :target: https://github.com/dvarrazzo/py-setproctitle/actions?query=workflow%3ATests
40
+ :alt: Tests
41
+
42
+ :author: Daniele Varrazzo
43
+
44
+ The ``setproctitle`` module allows a process to change its title (as displayed
45
+ by system tools such as ``ps``, ``top`` or MacOS Activity Monitor).
46
+
47
+ Changing the title is mostly useful in multi-process systems, for example
48
+ when a master process is forked: changing the children's title allows to
49
+ identify the task each process is busy with. The technique is used by
50
+ PostgreSQL_ and the `OpenSSH Server`_ for example.
51
+
52
+ The procedure is hardly portable across different systems. PostgreSQL provides
53
+ a good `multi-platform implementation`__: this package was born as a wrapper
54
+ around PostgreSQL code.
55
+
56
+ - `Homepage <https://github.com/dvarrazzo/py-setproctitle>`__
57
+ - `Download <http://pypi.python.org/pypi/setproctitle/>`__
58
+ - `Bug tracker <https://github.com/dvarrazzo/py-setproctitle/issues>`__
59
+
60
+
61
+ .. _PostgreSQL: http://www.postgresql.org
62
+ .. _OpenSSH Server: http://www.openssh.com/
63
+ .. __: http://doxygen.postgresql.org/ps__status_8c_source.html
64
+
65
+
66
+ Installation
67
+ ------------
68
+
69
+ ``setproctitle`` is a C extension: in order to build it you will need a C
70
+ compiler and the Python development support (the ``python-dev`` or
71
+ ``python3-dev`` package in most Linux distributions). No further external
72
+ dependencies are required.
73
+
74
+ You can use ``pip`` to install the module::
75
+
76
+ pip install setproctitle
77
+
78
+ You can use ``pip -t`` or ``virtualenv`` for local installations, ``sudo pip``
79
+ for a system-wide one... the usual stuff. Read pip_ or virtualenv_ docs for
80
+ all the details.
81
+
82
+ .. _pip: https://pip.readthedocs.org/
83
+ .. _virtualenv: https://virtualenv.readthedocs.org/
84
+
85
+
86
+ Usage
87
+ -----
88
+
89
+ .. note::
90
+ You should import and use the module (even just calling ``getproctitle()``)
91
+ pretty early in your program lifetime: code writing env vars `may
92
+ interfere`__ with the module initialisation.
93
+
94
+ .. __: https://github.com/dvarrazzo/py-setproctitle/issues/42
95
+
96
+
97
+ The ``setproctitle`` module exports the following functions:
98
+
99
+ ``setproctitle(title)``
100
+ Set *title* as the title for the current process.
101
+
102
+ ``getproctitle()``
103
+ Return the current process title.
104
+
105
+ The process title is usually visible in files such as ``/proc/PID/cmdline``,
106
+ ``/proc/PID/status``, ``/proc/PID/comm``, depending on the operating system
107
+ and kernel version. These information are used by user-space tools such as
108
+ ``ps`` and ``top``.
109
+
110
+
111
+ ``setthreadtitle(title)``
112
+ Set *title* as the title for the current thread.
113
+
114
+ ``getthreadtitle()``
115
+ Get the current thread title.
116
+
117
+ The thread title is exposed by some operating systems as the file
118
+ ``/proc/PID/task/TID/comm``, which is used by certain tools such as ``htop``.
119
+
120
+
121
+ Environment variables
122
+ ~~~~~~~~~~~~~~~~~~~~~
123
+
124
+ A few environment variables can be used to customize the module behavior:
125
+
126
+ ``SPT_NOENV``
127
+ Avoid clobbering ``/proc/PID/environ``.
128
+
129
+ On many platforms, setting the process title will clobber the
130
+ ``environ`` memory area. ``os.environ`` will work as expected from within
131
+ the Python process, but the content of the file ``/proc/PID/environ`` will
132
+ be overwritten. If you require this file not to be broken you can set the
133
+ ``SPT_NOENV`` environment variable to any non-empty value: in this case
134
+ the maximum length for the title will be limited to the length of the
135
+ command line.
136
+
137
+ ``SPT_DEBUG``
138
+ Print debug information on ``stderr``.
139
+
140
+ If the module doesn't work as expected you can set this variable to a
141
+ non-empty value to generate information useful for debugging. Note that
142
+ the most useful information is printed when the module is imported, not
143
+ when the functions are called.
144
+
145
+
146
+ Module status
147
+ -------------
148
+
149
+ The module can be currently compiled and effectively used on the following
150
+ platforms:
151
+
152
+ - GNU/Linux
153
+ - BSD
154
+ - MacOS X
155
+ - Windows
156
+
157
+ Note that on Windows there is no way to change the process string:
158
+ what the module does is to create a *Named Object* whose value can be read
159
+ using a tool such as `Process Explorer`_ (contribution of a more useful tool
160
+ to be used together with ``setproctitle`` would be well accepted).
161
+
162
+ The module can probably work on HP-UX, but I haven't found any to test with.
163
+ It is unlikely that it can work on Solaris instead.
164
+
165
+ .. _Process Explorer: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
166
+
167
+ Releases history
168
+ ----------------
169
+
170
+ Version 1.3.4
171
+ -------------
172
+
173
+ - Add support for Python 3.13 (issue #139).
174
+ - Drop support for Python 3.7.
175
+
176
+
177
+ Version 1.3.3
178
+ -------------
179
+
180
+ - Add support for Python 3.12.
181
+ - Fix package metadata to include Python 3.11, 3.12.
182
+
183
+
184
+ Version 1.3.2
185
+ -------------
186
+
187
+ - Restore import-time initialization of macOS to avoid crash on thread+fork
188
+ (issue #113).
189
+
190
+
191
+ Version 1.3.1
192
+ -------------
193
+
194
+ - Fixed segfault on macOS 12.5 in forked processes (issue #111).
195
+ Note that, as a workaround, Activity Monitor will show the title of the
196
+ parent.
197
+
198
+
199
+ Version 1.3.0
200
+ -------------
201
+
202
+ - Added fallback no-op implementation if building the extension fails.
203
+ - Added support for displaying title as the process name in MacOS Activity
204
+ Monitor (issue #10).
205
+ - Fixed "Symbol not found: _Py_GetArgcArgv" error when using Xcode provided
206
+ Python (issues #82, #103).
207
+ - Fixed FreeBSD support, broken in 1.2 (issue #94).
208
+ - Added package type annotations (issue #101).
209
+ - Dropped support for Python 3.6.
210
+
211
+
212
+ Version 1.2.3
213
+ -------------
214
+
215
+ - Added Python 3.10 packages (issue #102).
216
+ - Added Wheel packages for macOS (issue #96).
217
+ - Package build moved to cibuildwheel, other wheels provided (issue #47).
218
+
219
+
220
+ Version 1.2.2
221
+ -------------
222
+
223
+ - Fixed Windows build (issues #89, #90).
224
+ - Added wheel packages for Windows (issues #47, #90).
225
+ - Added wheel packages for aarch64 (issue #95).
226
+
227
+
228
+ Version 1.2.1
229
+ -------------
230
+
231
+ - Fixed segfault after ``os.environ.clear()`` (issue #88).
232
+
233
+
234
+ Version 1.2
235
+ ~~~~~~~~~~~
236
+
237
+ - added ``getthreadtitle()`` and ``setthreadtitle()``.
238
+ - Initialisation of the module moved to the first usage: importing the module
239
+ doesn't cause side effects.
240
+ - Manage much longer command lines (issue #52)
241
+ - Improved build on BSD, dropped ancient versions (issue #67).
242
+ - Fixed build for Python 3.8 (issues #66, #72)
243
+ - Added support for Python 3.9
244
+ - Dropped support for Python < 3.6
245
+
246
+
247
+ Version 1.1.10
248
+ ~~~~~~~~~~~~~~
249
+
250
+ - Fixed building with certain ``prctl.h`` implementations (issue #44).
251
+ - Use ``setuptools`` if available (issue #48).
252
+
253
+
254
+ Version 1.1.9
255
+ ~~~~~~~~~~~~~
256
+
257
+ - Fixed build on VC (issues #20, #33).
258
+ - Added ``MANIFEST.in`` to the source distribution to help with RPM building
259
+ (issue #30).
260
+
261
+
262
+ Version 1.1.8
263
+ ~~~~~~~~~~~~~
264
+
265
+ - Added support for Python "diehard" 2.4 (pull request #3).
266
+ - Fixed build on Mac OS X 10.9 Maverick (issue #27).
267
+
268
+
269
+ Version 1.1.7
270
+ ~~~~~~~~~~~~~
271
+
272
+ - Added PyPy support, courtesy of Ozan Turksever - http://www.logsign.net
273
+ (pull request #2).
274
+
275
+
276
+ Version 1.1.6
277
+ ~~~~~~~~~~~~~
278
+
279
+ - The module can be compiled again on Windows (issue #21).
280
+
281
+
282
+ Version 1.1.5
283
+ ~~~~~~~~~~~~~
284
+
285
+ - No module bug, but a packaging issue: files ``README`` and ``HISTORY``
286
+ added back into the distribution.
287
+
288
+
289
+ Version 1.1.4
290
+ ~~~~~~~~~~~~~
291
+
292
+ - The module works correctly in embedded Python.
293
+ - ``setproctitle()`` accepts a keyword argument.
294
+ - Debug output support always compiled in: the variable ``SPT_DEBUG`` can be
295
+ used to emit debug log.
296
+
297
+
298
+ Version 1.1.3
299
+ ~~~~~~~~~~~~~
300
+
301
+ - Don't clobber environ if the variable ``SPT_NOENV`` is set (issue #16).
302
+
303
+
304
+ Version 1.1.2
305
+ ~~~~~~~~~~~~~
306
+
307
+ - Find the setproctitle include file on OpenBSD (issue #11).
308
+ - Skip test with unicode if the file system encoding wouldn't make it pass
309
+ (issue #13).
310
+
311
+
312
+ Version 1.1.1
313
+ ~~~~~~~~~~~~~
314
+
315
+ - Fixed segfault when the module is imported under mod_wsgi (issue #9).
316
+
317
+
318
+ Version 1.1
319
+ ~~~~~~~~~~~
320
+
321
+ - The module works correctly with Python 3.
322
+
323
+
324
+ Version 1.0.1
325
+ ~~~~~~~~~~~~~
326
+
327
+ - ``setproctitle()`` works even when Python messes up with argv, e.g. when run
328
+ with the -m option (issue #8).
329
+
330
+
331
+ Version 1.0
332
+ ~~~~~~~~~~~
333
+
334
+ No major change since the previous version. The module has been heavily used
335
+ in production environment without any problem reported, so it's time to declare
336
+ it stable.
337
+
338
+
339
+ Version 0.4
340
+ ~~~~~~~~~~~
341
+
342
+ - Module works on BSD (tested on FreeBSD 7.2).
343
+
344
+ - Module works on Windows. Many thanks to `Develer`_ for providing a neat `GCC
345
+ package for Windows with Python integration`__ that made the Windows porting
346
+ painless.
347
+
348
+ .. _Develer: http://www.develer.com/
349
+ .. __: http://www.develer.com/oss/GccWinBinaries
350
+
351
+
352
+ Version 0.3
353
+ ~~~~~~~~~~~
354
+
355
+ - Module works on Mac OS X 10.2. Reported working on OS X 10.6 too.
356
+
357
+
358
+ Version 0.2
359
+ ~~~~~~~~~~~
360
+
361
+ - Added ``prctl()`` call on Linux >= 2.6.9 to update ``/proc/self/status``.
362
+
363
+
364
+ Version 0.1
365
+ ~~~~~~~~~~~
366
+
367
+ - Initial public release.
@@ -0,0 +1,7 @@
1
+ setproctitle/__init__.py,sha256=Cf__fwHdluE8-dturKg4iYsH4ZI7qZwHBeAdqmny1vI,1466
2
+ setproctitle/_setproctitle.cp313-win_amd64.pyd,sha256=16YyJj-8lIFbt3VmFu098JOkr3mNmeYUPwfFPSVK83g,14336
3
+ setproctitle/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ setproctitle-1.3.4.dist-info/METADATA,sha256=wXNJgLcNc28frfMy3jvx-32xxD1N-08Y0chko8EzngI,10461
5
+ setproctitle-1.3.4.dist-info/WHEEL,sha256=Cv3kb_0eCrY3e81u1ru5JoyzKr1NHqAjZwmUAZze2Cc,101
6
+ setproctitle-1.3.4.dist-info/top_level.txt,sha256=khlu2SuNEK2Ct594XhMTT62ll8p0oFza-4dmzUFTBhQ,13
7
+ setproctitle-1.3.4.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.5.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-win_amd64
5
+
@@ -0,0 +1 @@
1
+ setproctitle