Skip to content

Commit 628bcba

Browse files
committed
Merge remote-tracking branch 'upstream/main' into windows
# Conflicts: # CHANGES.rst # setup.py # supervisor/compat.py # supervisor/dispatchers.py # supervisor/options.py # supervisor/supervisord.py # supervisor/tests/test_childutils.py # supervisor/tests/test_confecho.py # supervisor/tests/test_dispatchers.py # supervisor/tests/test_events.py # supervisor/tests/test_http.py # supervisor/tests/test_loggers.py # supervisor/tests/test_options.py # supervisor/tests/test_poller.py # supervisor/tests/test_process.py # supervisor/tests/test_rpcinterfaces.py # supervisor/tests/test_socket_manager.py # supervisor/tests/test_states.py # supervisor/tests/test_supervisorctl.py # supervisor/tests/test_supervisord.py # supervisor/tests/test_web.py # supervisor/xmlrpc.py
2 parents c8072bd + 49792c9 commit 628bcba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+375
-343
lines changed

.github/workflows/main.yml

+22-23
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,71 @@ on: [push, pull_request]
44

55
jobs:
66
tests:
7-
runs-on: ubuntu-18.04
7+
runs-on: ubuntu-20.04
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, "3.10"]
11+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, "3.10", 3.11]
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515

1616
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
1919
python-version: ${{ matrix.python-version }}
2020

21-
- name: Show Python version
22-
run: python -V
23-
24-
- name: Set TOXENV based on Python version
25-
run: python -c 'import sys; print("TOXENV=py%d%d" % (sys.version_info.major, sys.version_info.minor))' | tee -a $GITHUB_ENV
26-
2721
- name: Install dependencies
2822
run: pip install virtualenv tox
2923

24+
- name: Set variable for TOXENV based on Python version
25+
id: toxenv
26+
run: python -c 'import sys; print("TOXENV=py%d%d" % (sys.version_info.major, sys.version_info.minor))' | tee -a $GITHUB_OUTPUT
27+
3028
- name: Run the unit tests
31-
run: tox
29+
run: TOXENV=${{steps.toxenv.outputs.TOXENV}} tox
3230

3331
- name: Run the end-to-end tests
34-
run: END_TO_END=1 tox
32+
run: TOXENV=${{steps.toxenv.outputs.TOXENV}} END_TO_END=1 tox
3533

3634
coverage:
37-
runs-on: ubuntu-18.04
35+
runs-on: ubuntu-20.04
3836
strategy:
3937
fail-fast: false
4038
matrix:
41-
python-version: [2.7, 3.7]
39+
python-version: [2.7, 3.8]
4240

4341
steps:
44-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v3
4543

4644
- name: Set up Python ${{ matrix.python-version }}
47-
uses: actions/setup-python@v2
45+
uses: actions/setup-python@v4
4846
with:
4947
python-version: ${{ matrix.python-version }}
5048

5149
- name: Install dependencies
5250
run: pip install virtualenv tox
5351

54-
- name: Set TOXENV based on Python version
55-
run: python -c 'import sys; e="cover" if sys.version_info.major == 2 else "cover3"; print("TOXENV=%s" % e)' | tee -a $GITHUB_ENV
52+
- name: Set variable for TOXENV based on Python version
53+
id: toxenv
54+
run: python -c 'import sys; e="cover" if sys.version_info.major == 2 else "cover3"; print("TOXENV=%s" % e)' | tee -a $GITHUB_OUTPUT
5655

5756
- name: Run unit test coverage
58-
run: tox
57+
run: TOXENV=${{steps.toxenv.outputs.TOXENV}} tox
5958

6059
docs:
61-
runs-on: ubuntu-18.04
60+
runs-on: ubuntu-20.04
6261

6362
steps:
64-
- uses: actions/checkout@v2
63+
- uses: actions/checkout@v3
6564

6665
- name: Set up Python ${{ matrix.python-version }}
67-
uses: actions/setup-python@v2
66+
uses: actions/setup-python@v4
6867
with:
6968
python-version: "3.8"
7069

7170
- name: Install dependencies
72-
run: pip install virtualenv tox
71+
run: pip install virtualenv tox>=4.0.0
7372

7473
- name: Build the docs
7574
run: TOXENV=docs tox

.readthedocs.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the version of Python and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.11"
13+
14+
# Build documentation in the docs/ directory with Sphinx
15+
sphinx:
16+
configuration: docs/conf.py
17+
18+
# We recommend specifying your dependencies to enable reproducible builds:
19+
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20+
# python:
21+
# install:
22+
# - requirements: docs/requirements.txt
23+

COPYRIGHT.txt

-21
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,6 @@
11
Supervisor is Copyright (c) 2006-2015 Agendaless Consulting and Contributors.
22
(http://www.agendaless.com), All Rights Reserved
33

4-
This software is subject to the provisions of the license at
5-
http://www.repoze.org/LICENSE.txt . A copy of this license should
6-
accompany this distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND
7-
ANY AND ALL EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING,
8-
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
9-
MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS FOR A PARTICULAR
10-
PURPOSE.
11-
124
medusa was (is?) Copyright (c) Sam Rushing.
135

146
http_client.py code Copyright (c) by Daniel Krech, http://eikeon.com/.
15-
16-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27-

docs/api.rst

+2
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ Process Control
321321
same elements as the struct returned by ``getProcessInfo``. If the process
322322
table is empty, an empty array is returned.
323323

324+
.. automethod:: getAllConfigInfo
325+
324326
.. automethod:: startProcess
325327

326328
.. automethod:: startAllProcesses

docs/configuration.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ follows.
321321
activity log. One of ``critical``, ``error``, ``warn``, ``info``,
322322
``debug``, ``trace``, or ``blather``. Note that at log level
323323
``debug``, the supervisord log file will record the stderr/stdout
324-
output of its child processes and extended info info about process
324+
output of its child processes and extended info about process
325325
state changes, which is useful for debugging a process which isn't
326326
starting properly. See also: :ref:`activity_log_levels`.
327327

@@ -1508,9 +1508,9 @@ sections do not have.
15081508

15091509
``result_handler``
15101510

1511-
A `pkg_resources entry point string
1512-
<http://peak.telecommunity.com/DevCenter/PkgResources>`_ that
1513-
resolves to a Python callable. The default value is
1511+
An `entry point object reference
1512+
<https://packaging.python.org/en/latest/specifications/entry-points/#data-model>`_
1513+
string that resolves to a Python callable. The default value is
15141514
``supervisor.dispatchers:default_handler``. Specifying an alternate
15151515
result handler is a very uncommon thing to need to do, and as a
15161516
result, how to create one is not documented.
@@ -1611,7 +1611,7 @@ And a section in the config file meant to configure it.
16111611

16121612
``supervisor.rpcinterface_factory``
16131613

1614-
``pkg_resources`` "entry point" dotted name to your RPC interface's
1614+
``entry point object reference`` dotted name to your RPC interface's
16151615
factory function.
16161616

16171617
*Default*: N/A

docs/events.rst

+5-6
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ follows.
9393

9494
An advanced feature, specifying an alternate "result handler" for a
9595
pool, can be specified via the ``result_handler`` parameter of an
96-
``[eventlistener:x]`` section in the form of a `pkg_resources
97-
<http://peak.telecommunity.com/DevCenter/PkgResources>`_ "entry
98-
point" string. The default result handler is
96+
``[eventlistener:x]`` section in the form of an `entry point object reference
97+
<https://packaging.python.org/en/latest/specifications/entry-points/#data-model>`_
98+
string. The default result handler is
9999
``supervisord.dispatchers:default_handler``. Creating an alternate
100100
result handler is not currently documented.
101101

@@ -177,7 +177,7 @@ pool The name of the event listener pool which myeventpool
177177
poolserial An integer assigned to each event by the 30
178178
eventlistener pool which it is being sent
179179
from. No two events generated by the same
180-
eventlister pool during the lifetime of a
180+
eventlistener pool during the lifetime of a
181181
:program:`supervisord` process will have the
182182
same ``poolserial`` number. This value can
183183
be used to detect event ordering anomalies.
@@ -375,7 +375,7 @@ including "process state change", "process communication", and
375375
these event types.
376376

377377
In the below list, we indicate that some event types have a "body"
378-
which is a a *token set*. A token set consists of a set of charaters
378+
which is a a *token set*. A token set consists of a set of characters
379379
with space-separated tokens. Each token represents a key-value pair.
380380
The key and value are separated by a colon. For example:
381381

@@ -897,4 +897,3 @@ Indicates that a process group has been removed from Supervisor's configuration.
897897
.. code-block:: text
898898
899899
groupname:cat
900-

docs/installing.rst

+2-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ differently. Since both ``pip`` and ``python setup.py
4848
install`` depend on internet access to perform downloads of dependent
4949
software, neither will work on machines without internet access until
5050
dependencies are installed. To install to a machine which is not
51-
internet-connected, obtain the following dependencies on a machine
52-
which is internet-connected:
53-
54-
- setuptools (latest) from `https://pypi.org/pypi/setuptools/
55-
<https://pypi.org/pypi/setuptools/>`_.
51+
internet-connected, obtain the dependencies listed in ``setup.py``
52+
using a machine which is internet-connected.
5653

5754
Copy these files to removable media and put them on the target
5855
machine. Install each onto the target machine as per its

docs/introduction.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Supervisor Components
134134
The command-line client talks to the server across a UNIX domain
135135
socket or an internet (TCP) socket. The server can assert that the
136136
user of a client should present authentication credentials before it
137-
allows him to perform commands. The client process typically uses
137+
allows them to perform commands. The client process typically uses
138138
the same configuration file as the server but any configuration file
139139
with a ``[supervisorctl]`` section in it will work.
140140

docs/plugins.rst

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ instances running on different servers.
4949
Web-based dashboard and command line tool written in Python using PostgreSQL
5050
with a REST API, event monitoring, and configuration management.
5151

52+
`Polyvisor <https://github.com/poly-laboratory/poly-visor>`_
53+
Web-based dashboard written in Python using `flask <http://flask.pocoo.org>`_ web server.
54+
Frontend based on `Svelte <https://svelte.dev/>`_ result in lightweighted packages. Communicate via supervisor's event-listener.
55+
Providing system resource management via visualized charts & easy to config processes configs via web interface.
56+
5257
Third Party Plugins and Libraries for Supervisor
5358
------------------------------------------------
5459

docs/subprocess.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ per the following directed graph.
248248
Subprocess State Transition Graph
249249

250250
A process is in the ``STOPPED`` state if it has been stopped
251-
adminstratively or if it has never been started.
251+
administratively or if it has never been started.
252252

253253
When an autorestarting process is in the ``BACKOFF`` state, it will be
254254
automatically restarted by :program:`supervisord`. It will switch

setup.cfg

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
[easy_install]
22
zip_ok = false
33

4-
[aliases]
5-
dev = develop easy_install supervisor[testing]
6-
74
[bdist_wheel]
85
universal = 1

setup.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@
2222
elif (3, 0) < py_version < (3, 4):
2323
raise RuntimeError('On Python 3, Supervisor requires Python 3.4 or later')
2424

25-
# pkg_resource is used in several places
26-
requires = ["setuptools"]
25+
# setuptools is required as a runtime dependency only on
26+
# Python < 3.8. See the comments in supervisor/compat.py.
27+
requires = [
28+
"setuptools; python_version < '3.8'",
29+
]
2730

2831
if (2, 7) <= py_version < (3, 0):
2932
requires.append("pywin32==228")
3033
else:
3134
requires.append("pywin32<=306,>228")
3235

3336
tests_require = []
34-
if py_version < (3, 3):
35-
tests_require.append('mock<4.0.0.dev0')
36-
3737
testing_extras = tests_require + [
3838
'pytest',
3939
'pytest-cov',
@@ -70,6 +70,9 @@
7070
"Programming Language :: Python :: 3.6",
7171
"Programming Language :: Python :: 3.7",
7272
"Programming Language :: Python :: 3.8",
73+
"Programming Language :: Python :: 3.9",
74+
"Programming Language :: Python :: 3.10",
75+
"Programming Language :: Python :: 3.11",
7376
]
7477

7578
version_txt = os.path.join(here, 'supervisor/version.txt')
@@ -81,6 +84,11 @@
8184
version=supervisor_version,
8285
license='BSD-derived (http://www.repoze.org/LICENSE.txt)',
8386
url='http://supervisord.org/',
87+
project_urls={
88+
'Changelog': 'http://supervisord.org/changelog',
89+
'Documentation': 'http://supervisord.org',
90+
'Issue Tracker': 'https://github.com/Supervisor/supervisor',
91+
},
8492
description="A system for controlling process state under WINDOWS",
8593
long_description=README + '\n\n' + CHANGES,
8694
classifiers=CLASSIFIERS,
@@ -98,7 +106,7 @@
98106
install_requires=requires,
99107
extras_require={
100108
'testing': testing_extras,
101-
},
109+
},
102110
tests_require=tests_require,
103111
include_package_data=True,
104112
zip_safe=False,

supervisor/compat.py

+49
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,55 @@ class SubprocessError(Exception):
163163
except ImportError: # pragma: no cover
164164
from HTMLParser import HTMLParser
165165

166+
# Begin importlib/setuptools compatibility code
167+
168+
# Supervisor used pkg_resources (a part of setuptools) to load package
169+
# resources for 15 years, until setuptools 67.5.0 (2023-03-05) deprecated
170+
# the use of pkg_resources. On Python 3.8 or later, Supervisor now uses
171+
# importlib (part of Python 3 stdlib). Unfortunately, on Python < 3.8,
172+
# Supervisor needs to use pkg_resources despite its deprecation. The PyPI
173+
# backport packages "importlib-resources" and "importlib-metadata" couldn't
174+
# be added as dependencies to Supervisor because they require even more
175+
# dependencies that would likely cause some Supervisor installs to fail.
176+
from warnings import filterwarnings as _fw
177+
_fw("ignore", message="pkg_resources is deprecated as an API")
178+
179+
try: # pragma: no cover
180+
from importlib.metadata import EntryPoint as _EntryPoint
181+
182+
def import_spec(spec):
183+
return _EntryPoint(None, spec, None).load()
184+
185+
except ImportError: # pragma: no cover
186+
from pkg_resources import EntryPoint as _EntryPoint
187+
188+
def import_spec(spec):
189+
ep = _EntryPoint.parse("x=" + spec)
190+
if hasattr(ep, 'resolve'):
191+
# this is available on setuptools >= 10.2
192+
return ep.resolve()
193+
else:
194+
# this causes a DeprecationWarning on setuptools >= 11.3
195+
return ep.load(False)
196+
197+
try: # pragma: no cover
198+
import importlib.resources as _importlib_resources
199+
200+
if hasattr(_importlib_resources, "files"):
201+
def resource_filename(package, path):
202+
return str(_importlib_resources.files(package).joinpath(path))
203+
204+
else:
205+
# fall back to deprecated .path if .files is not available
206+
def resource_filename(package, path):
207+
with _importlib_resources.path(package, '__init__.py') as p:
208+
return str(p.parent.joinpath(path))
209+
210+
except ImportError: # pragma: no cover
211+
from pkg_resources import resource_filename
212+
213+
# End importlib/setuptools compatibility code
214+
166215
try: # pragma: no cover
167216
import queue
168217
except ImportError: # pragma: no cover

supervisor/confecho.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import pkg_resources
44

55
from supervisor.compat import as_string
6+
from supervisor.compat import resource_filename
7+
68

79

810
def main(out=sys.stdout):
9-
config = pkg_resources.resource_string(__name__, 'skel/sample.conf')
10-
out.write(as_string(config))
11+
with open(resource_filename(__package__, 'skel/sample.conf'), 'r') as f:
12+
out.write(as_string(f.read()))

0 commit comments

Comments
 (0)