django-systemd 0.2.1__tar.gz → 0.2.2__tar.gz
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.
- {django_systemd-0.2.1 → django_systemd-0.2.2}/PKG-INFO +7 -7
- {django_systemd-0.2.1 → django_systemd-0.2.2}/README.md +3 -1
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/changelog.rst +8 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/conf.py +30 -30
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/index.rst +3 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/pyproject.toml +5 -9
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/__init__.py +1 -1
- {django_systemd-0.2.1 → django_systemd-0.2.2}/uv.lock +257 -264
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.codecov.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.gitattributes +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/CODEOWNERS +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/dependabot.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/workflows/bandit.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/workflows/dependabot-automerge.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/workflows/lint.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/workflows/release.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/workflows/scorecard.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/workflows/test.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/workflows/update_coc.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/workflows/zizmor.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.github/zizmor.yml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.gitignore +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.pre-commit-config.yaml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/.readthedocs.yaml +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/AGENTS.md +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/CODE_OF_CONDUCT.md +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/CONTRIBUTING.md +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/LICENSE +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/SECURITY.md +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/_static/style.css +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/command.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/howto.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/reference/config.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/reference/defines.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/reference/index.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/reference/protocol.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/reference/signals.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/reference/systemd.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/refs.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/settings.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/doc/source/tutorial.rst +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/justfile +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/admin.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/apps.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/config.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/defines.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/management/__init__.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/management/commands/__init__.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/management/commands/systemd.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/protocol.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/src/django_systemd/signals.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/__init__.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/__init__.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app1/__init__.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app1/systemd/app@.target +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app1/systemd/check.timer +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app1/systemd/web.service +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app2/__init__.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app2/systemd/app@.target +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app2/systemd/check.timer +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app2/systemd/web.service +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/__init__.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/systemd/bad name.service +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/systemd/broken.service +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/systemd/cleanup.service +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/systemd/cleanup.timer +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/systemd/my.app.timer +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/systemd/runtime.service +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/systemd/scoped.service +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/systemd/sub/web.service +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/apps/app3/systemd/web.socket +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/conftest.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/settings.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/test_basics.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/test_command.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/test_protocol.py +0 -0
- {django_systemd-0.2.1 → django_systemd-0.2.2}/tests/urls.py +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: django-systemd
|
|
3
|
-
Version: 0.2.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Ship renderable systemd unit templates with your apps and manage project services through the django admin.
|
|
5
5
|
Project-URL: Homepage, https://django-systemd.readthedocs.io
|
|
6
6
|
Project-URL: Documentation, https://django-systemd.readthedocs.io
|
|
7
7
|
Project-URL: Repository, https://github.com/bckohan/django-systemd
|
|
8
8
|
Project-URL: Issues, https://github.com/bckohan/django-systemd/issues
|
|
9
9
|
Project-URL: Changelog, https://django-systemd.readthedocs.io/en/stable/changelog.html
|
|
10
|
-
Project-URL: Code_of_Conduct, https://github.com/
|
|
10
|
+
Project-URL: Code_of_Conduct, https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md
|
|
11
11
|
Author-email: Brian Kohan <bckohan@gmail.com>
|
|
12
12
|
License-Expression: MIT
|
|
13
13
|
License-File: LICENSE
|
|
14
|
-
Keywords: CLI,Typer,commands,django,integration,management,services,systemd
|
|
14
|
+
Keywords: CLI,Typer,commands,devops,django,integration,management,services,systemctl,systemd
|
|
15
15
|
Classifier: Development Status :: 5 - Production/Stable
|
|
16
16
|
Classifier: Environment :: Console
|
|
17
17
|
Classifier: Framework :: Django
|
|
@@ -36,8 +36,6 @@ Requires-Python: <4.0,>=3.11
|
|
|
36
36
|
Requires-Dist: django-render-static>=3.5.0
|
|
37
37
|
Requires-Dist: django-typer>=3.5.1
|
|
38
38
|
Requires-Dist: django<6.2,>=5.2
|
|
39
|
-
Provides-Extra: rich
|
|
40
|
-
Requires-Dist: rich<16.0.0,>=10.11.0; extra == 'rich'
|
|
41
39
|
Description-Content-Type: text/markdown
|
|
42
40
|
|
|
43
41
|
# django-systemd
|
|
@@ -53,8 +51,10 @@ Description-Content-Type: text/markdown
|
|
|
53
51
|
[](https://github.com/bckohan/django-systemd/actions/workflows/test.yml?query=branch:main)
|
|
54
52
|
[](https://github.com/bckohan/django-systemd/actions/workflows/lint.yml?query=branch:main)
|
|
55
53
|
[](https://securityscorecards.dev/viewer/?uri=github.com/bckohan/django-systemd)
|
|
54
|
+
[](https://djangopackages.org/packages/p/django-typer/)
|
|
55
|
+
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
[django-systemd](https://pypi.org/project/django-systemd) does two independent things for a Django deployment:
|
|
58
58
|
|
|
59
59
|
1. **Generate systemd unit files.** Apps bundle unit templates in a `systemd/` directory. Render them at package time with known settings and commit the result, or render them at deploy time from live production settings. This allows you to do things like ship services with your reusable Django app that downstream users can deploy from their own settings.
|
|
60
60
|
2. **Manage the project's units.** `django-admin systemd` can list, install, update, restart and reload every unit the project defines, without you naming them. Units are managed in the system scope by default; privileges come from root, an explicit escalation prefix, or [polkit](https://github.com/polkit-org/polkit) with the link install method. The user scope, with nothing running as root, is still available.
|
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
[](https://github.com/bckohan/django-systemd/actions/workflows/test.yml?query=branch:main)
|
|
12
12
|
[](https://github.com/bckohan/django-systemd/actions/workflows/lint.yml?query=branch:main)
|
|
13
13
|
[](https://securityscorecards.dev/viewer/?uri=github.com/bckohan/django-systemd)
|
|
14
|
+
[](https://djangopackages.org/packages/p/django-typer/)
|
|
15
|
+
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
[django-systemd](https://pypi.org/project/django-systemd) does two independent things for a Django deployment:
|
|
16
18
|
|
|
17
19
|
1. **Generate systemd unit files.** Apps bundle unit templates in a `systemd/` directory. Render them at package time with known settings and commit the result, or render them at deploy time from live production settings. This allows you to do things like ship services with your reusable Django app that downstream users can deploy from their own settings.
|
|
18
20
|
2. **Manage the project's units.** `django-admin systemd` can list, install, update, restart and reload every unit the project defines, without you naming them. Units are managed in the system scope by default; privileges come from root, an explicit escalation prefix, or [polkit](https://github.com/polkit-org/polkit) with the link install method. The user scope, with nothing running as root, is still available.
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
|
-
import sys
|
|
3
1
|
import os
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
from sphinx.ext.autodoc import between
|
|
6
2
|
import shutil
|
|
3
|
+
import sys
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
7
6
|
import django
|
|
8
|
-
from
|
|
7
|
+
from sphinx.ext.autodoc import between
|
|
9
8
|
|
|
10
9
|
sys.path.insert(0, str(Path(__file__).parent.parent.parent / "src"))
|
|
11
10
|
sys.path.append(str(Path(__file__).parent.parent.parent))
|
|
12
|
-
sys.path.append(str(Path(__file__).parent /
|
|
11
|
+
sys.path.append(str(Path(__file__).parent / "ext"))
|
|
13
12
|
|
|
14
|
-
os.environ.setdefault(
|
|
15
|
-
#settings.configure()
|
|
13
|
+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
|
|
14
|
+
# settings.configure()
|
|
16
15
|
django.setup()
|
|
17
16
|
|
|
18
17
|
import django_systemd
|
|
@@ -47,13 +46,13 @@ release = django_systemd.__version__
|
|
|
47
46
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
48
47
|
# ones.
|
|
49
48
|
extensions = [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
"sphinxcontrib_django",
|
|
50
|
+
"sphinx.ext.autodoc",
|
|
51
|
+
"sphinx.ext.todo",
|
|
52
|
+
"sphinxcontrib.typer",
|
|
53
|
+
"sphinx_tabs.tabs",
|
|
55
54
|
"sphinx.ext.viewcode",
|
|
56
|
-
|
|
55
|
+
"sphinx.ext.intersphinx",
|
|
57
56
|
"sphinx.ext.autosectionlabel",
|
|
58
57
|
"sphinxcontrib_enum",
|
|
59
58
|
]
|
|
@@ -71,7 +70,7 @@ autodoc_use_legacy_class_based = True
|
|
|
71
70
|
svg2pdf_converter = ("cairosvg",)
|
|
72
71
|
|
|
73
72
|
# Add any paths that contain templates here, relative to this directory.
|
|
74
|
-
templates_path = [
|
|
73
|
+
templates_path = ["_templates"]
|
|
75
74
|
|
|
76
75
|
# List of patterns, relative to source directory, that match files and
|
|
77
76
|
# directories to ignore when looking for source files.
|
|
@@ -84,7 +83,7 @@ exclude_patterns = []
|
|
|
84
83
|
# a list of builtin themes.
|
|
85
84
|
#
|
|
86
85
|
# html_theme = 'sphinx_rtd_theme'
|
|
87
|
-
html_theme =
|
|
86
|
+
html_theme = "furo"
|
|
88
87
|
html_theme_options = {
|
|
89
88
|
"source_repository": "https://github.com/bckohan/django-systemd/",
|
|
90
89
|
"source_branch": "main",
|
|
@@ -95,17 +94,17 @@ html_title = f"{project} {release}"
|
|
|
95
94
|
# Add any paths that contain custom static files (such as style sheets) here,
|
|
96
95
|
# relative to this directory. They are copied after the builtin static files,
|
|
97
96
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
98
|
-
html_static_path = [
|
|
99
|
-
html_css_files = [
|
|
97
|
+
html_static_path = ["_static"]
|
|
98
|
+
html_css_files = ["style.css"]
|
|
100
99
|
|
|
101
100
|
todo_include_todos = True
|
|
102
101
|
|
|
103
102
|
latex_engine = "xelatex"
|
|
104
103
|
|
|
105
|
-
suppress_warnings = [
|
|
104
|
+
suppress_warnings = ["app.add_directive"]
|
|
106
105
|
|
|
107
106
|
linkcheck_ignore = [
|
|
108
|
-
r
|
|
107
|
+
r"https://github.com/django/django/blob/main/django/core/management/__init__.py#L278", # Ignore exact match
|
|
109
108
|
]
|
|
110
109
|
|
|
111
110
|
linkcheck_allow_redirects = True
|
|
@@ -121,35 +120,36 @@ intersphinx_mapping = {
|
|
|
121
120
|
"click": ("https://click.palletsprojects.com/en/stable", None),
|
|
122
121
|
"rich": ("https://rich.readthedocs.io/en/stable", None),
|
|
123
122
|
"django-typer": ("https://django-typer.readthedocs.io/en/stable", None),
|
|
124
|
-
"django-render-static": (
|
|
125
|
-
|
|
123
|
+
"django-render-static": (
|
|
124
|
+
"https://django-render-static.readthedocs.io/en/stable",
|
|
125
|
+
None,
|
|
126
|
+
),
|
|
127
|
+
"python": ("https://docs.python.org/3", None),
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
|
|
129
|
-
def pypi_role(name, rawtext, text, lineno, inliner, options=
|
|
131
|
+
def pypi_role(name, rawtext, text, lineno, inliner, options=None, content=None):
|
|
130
132
|
from docutils import nodes
|
|
131
133
|
|
|
132
134
|
url = f"https://pypi.org/project/{text}/"
|
|
133
|
-
node = nodes.reference(rawtext, text, refuri=url, **options)
|
|
135
|
+
node = nodes.reference(rawtext, text, refuri=url, **(options or {}))
|
|
134
136
|
return [node], []
|
|
135
137
|
|
|
136
138
|
|
|
137
|
-
def rtd_role(name, rawtext, text, lineno, inliner, options=
|
|
139
|
+
def rtd_role(name, rawtext, text, lineno, inliner, options=None, content=None):
|
|
138
140
|
from docutils import nodes
|
|
139
141
|
|
|
140
142
|
url = f"https://{text}.readthedocs.io"
|
|
141
|
-
node = nodes.reference(rawtext, text, refuri=url, **options)
|
|
143
|
+
node = nodes.reference(rawtext, text, refuri=url, **(options or {}))
|
|
142
144
|
return [node], []
|
|
143
145
|
|
|
144
146
|
|
|
145
147
|
def setup(app):
|
|
146
148
|
from docutils.parsers.rst import roles
|
|
149
|
+
|
|
147
150
|
# Register a sphinx.ext.autodoc.between listener to ignore everything
|
|
148
151
|
# between lines that contain the word IGNORE
|
|
149
|
-
app.connect(
|
|
150
|
-
'autodoc-process-docstring',
|
|
151
|
-
between('^.*[*]{79}.*$', exclude=True)
|
|
152
|
-
)
|
|
152
|
+
app.connect("autodoc-process-docstring", between("^.*[*]{79}.*$", exclude=True))
|
|
153
153
|
# app.connect('html-page-context', add_page_class)
|
|
154
154
|
roles.register_local_role("pypi", pypi_role)
|
|
155
155
|
roles.register_local_role("rtd", rtd_role)
|
|
@@ -49,6 +49,9 @@ Django Systemd
|
|
|
49
49
|
:target: https://securityscorecards.dev/viewer/?uri=github.com/bckohan/django-systemd
|
|
50
50
|
:alt: OpenSSF Scorecard
|
|
51
51
|
|
|
52
|
+
.. image:: https://img.shields.io/badge/Published%20on-Django%20Packages-0c3c26
|
|
53
|
+
:target: https://djangopackages.org/packages/p/django-systemd/
|
|
54
|
+
:alt: Published on Django Packages
|
|
52
55
|
|
|
53
56
|
:pypi:`django-systemd` does two independent things for a Django deployment:
|
|
54
57
|
|
|
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "django-systemd"
|
|
7
|
-
version = "0.2.
|
|
8
|
-
description = "
|
|
7
|
+
version = "0.2.2"
|
|
8
|
+
description = "Ship renderable systemd unit templates with your apps and manage project services through the django admin."
|
|
9
9
|
requires-python = ">=3.11,<4.0"
|
|
10
10
|
authors = [
|
|
11
11
|
{name = "Brian Kohan", email = "bckohan@gmail.com"},
|
|
@@ -15,7 +15,7 @@ license-files = [ "LICENSE" ]
|
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
repository = "https://github.com/bckohan/django-systemd"
|
|
17
17
|
homepage = "https://django-systemd.readthedocs.io"
|
|
18
|
-
keywords = ["django", "CLI", "management", "Typer", "commands", "systemd", "services", "integration"]
|
|
18
|
+
keywords = ["django", "CLI", "management", "Typer", "commands", "systemd", "services", "integration", "systemctl", "devops"]
|
|
19
19
|
dependencies = [
|
|
20
20
|
"Django>=5.2,<6.2",
|
|
21
21
|
"django-render-static>=3.5.0",
|
|
@@ -57,10 +57,6 @@ conflicts = [
|
|
|
57
57
|
[tool.hatch.build.targets.wheel]
|
|
58
58
|
packages = ["src/django_systemd"]
|
|
59
59
|
|
|
60
|
-
[project.optional-dependencies]
|
|
61
|
-
rich = [
|
|
62
|
-
"rich>=10.11.0,<16.0.0",
|
|
63
|
-
]
|
|
64
60
|
|
|
65
61
|
[project.urls]
|
|
66
62
|
"Homepage" = "https://django-systemd.readthedocs.io"
|
|
@@ -68,7 +64,7 @@ rich = [
|
|
|
68
64
|
"Repository" = "https://github.com/bckohan/django-systemd"
|
|
69
65
|
"Issues" = "https://github.com/bckohan/django-systemd/issues"
|
|
70
66
|
"Changelog" = "https://django-systemd.readthedocs.io/en/stable/changelog.html"
|
|
71
|
-
"Code_of_Conduct" = "https://github.com/
|
|
67
|
+
"Code_of_Conduct" = "https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md"
|
|
72
68
|
|
|
73
69
|
|
|
74
70
|
[tool.mypy]
|
|
@@ -156,11 +152,11 @@ include = [
|
|
|
156
152
|
line-length = 88
|
|
157
153
|
target-version = "py311"
|
|
158
154
|
exclude = [
|
|
159
|
-
"doc",
|
|
160
155
|
"dist",
|
|
161
156
|
"examples",
|
|
162
157
|
"docs",
|
|
163
158
|
]
|
|
159
|
+
extend-exclude = ["*.md", "*.rst"]
|
|
164
160
|
|
|
165
161
|
[tool.ruff.lint]
|
|
166
162
|
exclude = [
|