setproctitle 1.3.8__cp315-cp315-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.8"
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,410 @@
1
+ Metadata-Version: 2.4
2
+ Name: setproctitle
3
+ Version: 1.3.8
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: Programming Language :: C
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Programming Language :: Python :: 3.15
26
+ Classifier: Operating System :: POSIX :: Linux
27
+ Classifier: Operating System :: POSIX :: BSD
28
+ Classifier: Operating System :: MacOS :: MacOS X
29
+ Classifier: Operating System :: Microsoft :: Windows
30
+ Classifier: Topic :: Software Development
31
+ Requires-Python: >=3.8
32
+ Description-Content-Type: text/x-rst
33
+ License-File: LICENSE
34
+ Provides-Extra: test
35
+ Requires-Dist: pytest; extra == "test"
36
+ Dynamic: author
37
+ Dynamic: author-email
38
+ Dynamic: classifier
39
+ Dynamic: description
40
+ Dynamic: description-content-type
41
+ Dynamic: download-url
42
+ Dynamic: home-page
43
+ Dynamic: license
44
+ Dynamic: license-file
45
+ Dynamic: platform
46
+ Dynamic: provides-extra
47
+ Dynamic: requires-python
48
+ Dynamic: summary
49
+
50
+ A Python module to customize the process title
51
+ ==============================================
52
+
53
+ .. image:: https://github.com/dvarrazzo/py-setproctitle/workflows/Tests/badge.svg
54
+ :target: https://github.com/dvarrazzo/py-setproctitle/actions?query=workflow%3ATests
55
+ :alt: Tests
56
+
57
+ :author: Daniele Varrazzo
58
+
59
+ The ``setproctitle`` module allows a process to change its title (as displayed
60
+ by system tools such as ``ps``, ``top`` or MacOS Activity Monitor).
61
+
62
+ Changing the title is mostly useful in multi-process systems, for example
63
+ when a master process is forked: changing the children's title allows to
64
+ identify the task each process is busy with. The technique is used by
65
+ PostgreSQL_ and the `OpenSSH Server`_ for example.
66
+
67
+ The procedure is hardly portable across different systems. PostgreSQL provides
68
+ a good `multi-platform implementation`__: this package was born as a wrapper
69
+ around PostgreSQL code.
70
+
71
+ - `Homepage <https://github.com/dvarrazzo/py-setproctitle>`__
72
+ - `Download <http://pypi.python.org/pypi/setproctitle/>`__
73
+ - `Bug tracker <https://github.com/dvarrazzo/py-setproctitle/issues>`__
74
+
75
+
76
+ .. _PostgreSQL: http://www.postgresql.org
77
+ .. _OpenSSH Server: http://www.openssh.com/
78
+ .. __: http://doxygen.postgresql.org/ps__status_8c_source.html
79
+
80
+
81
+ Installation
82
+ ------------
83
+
84
+ ``setproctitle`` is a C extension: in order to build it you will need a C
85
+ compiler and the Python development support (the ``python-dev`` or
86
+ ``python3-dev`` package in most Linux distributions). No further external
87
+ dependencies are required.
88
+
89
+ You can use ``pip`` to install the module::
90
+
91
+ pip install setproctitle
92
+
93
+ You can use ``pip -t`` or ``virtualenv`` for local installations, ``sudo pip``
94
+ for a system-wide one... the usual stuff. Read pip_ or virtualenv_ docs for
95
+ all the details.
96
+
97
+ .. _pip: https://pip.readthedocs.org/
98
+ .. _virtualenv: https://virtualenv.readthedocs.org/
99
+
100
+
101
+ Usage
102
+ -----
103
+
104
+ .. note::
105
+ You should import and use the module (even just calling ``getproctitle()``)
106
+ pretty early in your program lifetime: code writing env vars `may
107
+ interfere`__ with the module initialisation.
108
+
109
+ .. __: https://github.com/dvarrazzo/py-setproctitle/issues/42
110
+
111
+
112
+ The ``setproctitle`` module exports the following functions:
113
+
114
+ ``setproctitle(title)``
115
+ Set *title* as the title for the current process.
116
+
117
+ ``getproctitle()``
118
+ Return the current process title.
119
+
120
+ The process title is usually visible in files such as ``/proc/PID/cmdline``,
121
+ ``/proc/PID/status``, ``/proc/PID/comm``, depending on the operating system
122
+ and kernel version. These information are used by user-space tools such as
123
+ ``ps`` and ``top``.
124
+
125
+
126
+ ``setthreadtitle(title)``
127
+ Set *title* as the title for the current thread.
128
+
129
+ ``getthreadtitle()``
130
+ Get the current thread title.
131
+
132
+ The thread title is exposed by some operating systems as the file
133
+ ``/proc/PID/task/TID/comm``, which is used by certain tools such as ``htop``.
134
+
135
+
136
+ Environment variables
137
+ ~~~~~~~~~~~~~~~~~~~~~
138
+
139
+ A few environment variables can be used to customize the module behavior:
140
+
141
+ ``SPT_NOENV``
142
+ Avoid clobbering ``/proc/PID/environ``.
143
+
144
+ On many platforms, setting the process title will clobber the
145
+ ``environ`` memory area. ``os.environ`` will work as expected from within
146
+ the Python process, but the content of the file ``/proc/PID/environ`` will
147
+ be overwritten. If you require this file not to be broken you can set the
148
+ ``SPT_NOENV`` environment variable to any non-empty value: in this case
149
+ the maximum length for the title will be limited to the length of the
150
+ command line.
151
+
152
+ ``SPT_DEBUG``
153
+ Print debug information on ``stderr``.
154
+
155
+ If the module doesn't work as expected you can set this variable to a
156
+ non-empty value to generate information useful for debugging. Note that
157
+ the most useful information is printed when the module is imported, not
158
+ when the functions are called.
159
+
160
+
161
+ Module status
162
+ -------------
163
+
164
+ The module can be currently compiled and effectively used on the following
165
+ platforms:
166
+
167
+ - GNU/Linux
168
+ - BSD
169
+ - MacOS X
170
+ - Windows
171
+
172
+ Note that on Windows there is no way to change the process string:
173
+ what the module does is to create a *Named Object* whose value can be read
174
+ using a tool such as `Process Explorer`_ (contribution of a more useful tool
175
+ to be used together with ``setproctitle`` would be well accepted).
176
+
177
+ The module can probably work on HP-UX, but I haven't found any to test with.
178
+ It is unlikely that it can work on Solaris instead.
179
+
180
+ .. _Process Explorer: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
181
+
182
+ Releases history
183
+ ----------------
184
+
185
+ Version 1.3.8
186
+ -------------
187
+
188
+ - Add support for Python 3.15.
189
+ - Fix segfault calling setproctitle() after clearenv() on Python 3.15
190
+ (issue #157).
191
+ - Add support for riscv64 (issue #156).
192
+
193
+
194
+ Version 1.3.7
195
+ -------------
196
+
197
+ - Add support for Python 3.14 (issue #152).
198
+
199
+
200
+ Version 1.3.6
201
+ -------------
202
+
203
+ - Add support for free-threading (issue #147).
204
+
205
+
206
+ Version 1.3.5
207
+ -------------
208
+
209
+ - Fix bouncing Dock icon on macOS (issue #143).
210
+ - Fix building on C23 compilers (issue #145).
211
+
212
+
213
+ Version 1.3.4
214
+ -------------
215
+
216
+ - Add support for Python 3.13 (issue #139).
217
+ - Drop support for Python 3.7.
218
+
219
+
220
+ Version 1.3.3
221
+ -------------
222
+
223
+ - Add support for Python 3.12.
224
+ - Fix package metadata to include Python 3.11, 3.12.
225
+
226
+
227
+ Version 1.3.2
228
+ -------------
229
+
230
+ - Restore import-time initialization of macOS to avoid crash on thread+fork
231
+ (issue #113).
232
+
233
+
234
+ Version 1.3.1
235
+ -------------
236
+
237
+ - Fixed segfault on macOS 12.5 in forked processes (issue #111).
238
+ Note that, as a workaround, Activity Monitor will show the title of the
239
+ parent.
240
+
241
+
242
+ Version 1.3.0
243
+ -------------
244
+
245
+ - Added fallback no-op implementation if building the extension fails.
246
+ - Added support for displaying title as the process name in MacOS Activity
247
+ Monitor (issue #10).
248
+ - Fixed "Symbol not found: _Py_GetArgcArgv" error when using Xcode provided
249
+ Python (issues #82, #103).
250
+ - Fixed FreeBSD support, broken in 1.2 (issue #94).
251
+ - Added package type annotations (issue #101).
252
+ - Dropped support for Python 3.6.
253
+
254
+
255
+ Version 1.2.3
256
+ -------------
257
+
258
+ - Added Python 3.10 packages (issue #102).
259
+ - Added Wheel packages for macOS (issue #96).
260
+ - Package build moved to cibuildwheel, other wheels provided (issue #47).
261
+
262
+
263
+ Version 1.2.2
264
+ -------------
265
+
266
+ - Fixed Windows build (issues #89, #90).
267
+ - Added wheel packages for Windows (issues #47, #90).
268
+ - Added wheel packages for aarch64 (issue #95).
269
+
270
+
271
+ Version 1.2.1
272
+ -------------
273
+
274
+ - Fixed segfault after ``os.environ.clear()`` (issue #88).
275
+
276
+
277
+ Version 1.2
278
+ ~~~~~~~~~~~
279
+
280
+ - added ``getthreadtitle()`` and ``setthreadtitle()``.
281
+ - Initialisation of the module moved to the first usage: importing the module
282
+ doesn't cause side effects.
283
+ - Manage much longer command lines (issue #52)
284
+ - Improved build on BSD, dropped ancient versions (issue #67).
285
+ - Fixed build for Python 3.8 (issues #66, #72)
286
+ - Added support for Python 3.9
287
+ - Dropped support for Python < 3.6
288
+
289
+
290
+ Version 1.1.10
291
+ ~~~~~~~~~~~~~~
292
+
293
+ - Fixed building with certain ``prctl.h`` implementations (issue #44).
294
+ - Use ``setuptools`` if available (issue #48).
295
+
296
+
297
+ Version 1.1.9
298
+ ~~~~~~~~~~~~~
299
+
300
+ - Fixed build on VC (issues #20, #33).
301
+ - Added ``MANIFEST.in`` to the source distribution to help with RPM building
302
+ (issue #30).
303
+
304
+
305
+ Version 1.1.8
306
+ ~~~~~~~~~~~~~
307
+
308
+ - Added support for Python "diehard" 2.4 (pull request #3).
309
+ - Fixed build on Mac OS X 10.9 Maverick (issue #27).
310
+
311
+
312
+ Version 1.1.7
313
+ ~~~~~~~~~~~~~
314
+
315
+ - Added PyPy support, courtesy of Ozan Turksever - http://www.logsign.net
316
+ (pull request #2).
317
+
318
+
319
+ Version 1.1.6
320
+ ~~~~~~~~~~~~~
321
+
322
+ - The module can be compiled again on Windows (issue #21).
323
+
324
+
325
+ Version 1.1.5
326
+ ~~~~~~~~~~~~~
327
+
328
+ - No module bug, but a packaging issue: files ``README`` and ``HISTORY``
329
+ added back into the distribution.
330
+
331
+
332
+ Version 1.1.4
333
+ ~~~~~~~~~~~~~
334
+
335
+ - The module works correctly in embedded Python.
336
+ - ``setproctitle()`` accepts a keyword argument.
337
+ - Debug output support always compiled in: the variable ``SPT_DEBUG`` can be
338
+ used to emit debug log.
339
+
340
+
341
+ Version 1.1.3
342
+ ~~~~~~~~~~~~~
343
+
344
+ - Don't clobber environ if the variable ``SPT_NOENV`` is set (issue #16).
345
+
346
+
347
+ Version 1.1.2
348
+ ~~~~~~~~~~~~~
349
+
350
+ - Find the setproctitle include file on OpenBSD (issue #11).
351
+ - Skip test with unicode if the file system encoding wouldn't make it pass
352
+ (issue #13).
353
+
354
+
355
+ Version 1.1.1
356
+ ~~~~~~~~~~~~~
357
+
358
+ - Fixed segfault when the module is imported under mod_wsgi (issue #9).
359
+
360
+
361
+ Version 1.1
362
+ ~~~~~~~~~~~
363
+
364
+ - The module works correctly with Python 3.
365
+
366
+
367
+ Version 1.0.1
368
+ ~~~~~~~~~~~~~
369
+
370
+ - ``setproctitle()`` works even when Python messes up with argv, e.g. when run
371
+ with the -m option (issue #8).
372
+
373
+
374
+ Version 1.0
375
+ ~~~~~~~~~~~
376
+
377
+ No major change since the previous version. The module has been heavily used
378
+ in production environment without any problem reported, so it's time to declare
379
+ it stable.
380
+
381
+
382
+ Version 0.4
383
+ ~~~~~~~~~~~
384
+
385
+ - Module works on BSD (tested on FreeBSD 7.2).
386
+
387
+ - Module works on Windows. Many thanks to `Develer`_ for providing a neat `GCC
388
+ package for Windows with Python integration`__ that made the Windows porting
389
+ painless.
390
+
391
+ .. _Develer: http://www.develer.com/
392
+ .. __: http://www.develer.com/oss/GccWinBinaries
393
+
394
+
395
+ Version 0.3
396
+ ~~~~~~~~~~~
397
+
398
+ - Module works on Mac OS X 10.2. Reported working on OS X 10.6 too.
399
+
400
+
401
+ Version 0.2
402
+ ~~~~~~~~~~~
403
+
404
+ - Added ``prctl()`` call on Linux >= 2.6.9 to update ``/proc/self/status``.
405
+
406
+
407
+ Version 0.1
408
+ ~~~~~~~~~~~
409
+
410
+ - Initial public release.
@@ -0,0 +1,8 @@
1
+ setproctitle/__init__.py,sha256=k056SjO4kRWATgrRtjyHCgreIapxRiRnmPPUOY8CsNw,1466
2
+ setproctitle/_setproctitle.cp315-win_amd64.pyd,sha256=BSajh3K5eNZceIoZGwjl5IbeQGc7V6XxsunMR4lPUr0,13312
3
+ setproctitle/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ setproctitle-1.3.8.dist-info/licenses/LICENSE,sha256=HT9sg1eIr84Jp6PhUdv_iietlLQS22FfO4YOp4HsUOM,1558
5
+ setproctitle-1.3.8.dist-info/METADATA,sha256=fDVy3rp7pqjAg5lR50GsIe-eK0vs2kzG2nLUHGjSI3k,11319
6
+ setproctitle-1.3.8.dist-info/WHEEL,sha256=geuJoH1aW6kS7q0cKuoOBUdE-tpBsTvRf9l5rOGbxQs,101
7
+ setproctitle-1.3.8.dist-info/top_level.txt,sha256=khlu2SuNEK2Ct594XhMTT62ll8p0oFza-4dmzUFTBhQ,13
8
+ setproctitle-1.3.8.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp315-cp315-win_amd64
5
+
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2009, Daniele Varrazzo <daniele.varrazzo@gmail.com>
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
1
+ setproctitle