Meta doc ¶
Contents
Head project : tuto_devops ¶
Gitlab project ¶
Issues ¶
Pipelines ¶
.git/config ¶
1[init]
2 defaultBranch = none
3[fetch]
4 recurseSubmodules = false
5[core]
6 repositoryformatversion = 0
7 filemode = true
8 bare = false
9 logallrefupdates = true
10[remote "origin"]
11 url = https://gitlab-ci-token:XKjuEwwQuTsyN_2jxqFK@gitlab.com/gdevops/tuto_django.git
12 fetch = +refs/heads/*:refs/remotes/origin/*
pyproject.toml ¶
1[tool.poetry]
2name = "tuto_django"
3version = "0.1.0"
4description = "Tuto django"
5authors = ["Noam <noamsw@pm.me>"]
6
7[tool.poetry.dependencies]
8python = "^3.11"
9sphinx-material = "*"
10sphinx-markdown-tables = "*"
11sphinx-copybutton = "*"
12sphinx-panels = "*"
13sphinx-tabs = "*"
14autoclasstoc = "*"
15Sphinx = "*"
16myst-parser = "*"
17
18[tool.poetry.dev-dependencies]
19
20[build-system]
21requires = ["poetry-core>=1.0.0"]
22build-backend = "poetry.core.masonry.api"
conf.py ¶
1# Configuration file for the Sphinx documentation builder.
2#
3# This file only contains a selection of the most common options. For a full
4# list see the documentation:
5# http://www.sphinx-doc.org/en/master/config
6# -- Path setup --------------------------------------------------------------
7# If extensions (or modules to document with autodoc) are in another directory,
8# add these directories to sys.path here. If the directory is relative to the
9# documentation root, use os.path.abspath to make it absolute, like shown here.
10#
11# import os
12# import sys
13# sys.path.insert(0, os.path.abspath('.'))
14import platform
15from datetime import datetime
16from zoneinfo import ZoneInfo
17
18import sphinx
19import sphinx_material
20
21# If extensions (or modules to document with autodoc) are in another directory,
22# add these directories to sys.path here. If the directory is relative to the
23# documentation root, use os.path.abspath to make it absolute, like shown here.
24# sys.path.insert(0, os.path.abspath("./src"))
25
26project = "Tuto Django"
27html_title = project
28
29author = "DevOps people"
30html_logo = "images/django-logo-negative.png"
31html_favicon = "images/django-logo-negative.png"
32release = "0.1.0"
33now = datetime.now(tz=ZoneInfo("Europe/Paris"))
34version = f"{now.year}-{now.month:02}-{now.day:02} {now.hour:02}H ({now.tzinfo})"
35today = version
36
37extensions = [
38 "sphinx.ext.autodoc",
39 "sphinx.ext.doctest",
40 "sphinx.ext.extlinks",
41 "sphinx.ext.intersphinx",
42 "sphinx.ext.todo",
43 "sphinx.ext.mathjax",
44 "sphinx.ext.viewcode",
45 "myst_parser",
46 "sphinx_copybutton",
47]
48extensions += ["sphinx.ext.intersphinx"]
49
50
51autosummary_generate = True
52autoclass_content = "class"
53
54# Add any paths that contain templates here, relative to this directory.
55templates_path = ["_templates"]
56exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
57html_static_path = ["_static"]
58html_show_sourcelink = True
59html_sidebars = {
60 "**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
61}
62extensions.append("sphinx_material")
63html_theme_path = sphinx_material.html_theme_path()
64html_context = sphinx_material.get_html_context()
65html_theme = "sphinx_material"
66
67extensions.append("sphinx.ext.intersphinx")
68intersphinx_mapping = {
69 "django": (
70 "http://docs.djangoproject.com/en/dev/",
71 "http://docs.djangoproject.com/en/dev/_objects/",
72 ),
73 "python": ("https://gdevops.gitlab.io/tuto_python/", None),
74 "https://gdevops.gitlab.io/tuto_databases/": None,
75 "psycopg2": ("https://www.psycopg.org/docs/", None),
76 "docker": ("https://gdevops.gitlab.io/tuto_docker/", None),
77 "git": ("https://gdevops.gitlab.io/tuto_git/", None),
78 "languages": ("https://gdevops.gitlab.io/tuto_languages/", None),
79 "sysops": ("https://gdevops.gitlab.io/tuto_sysops/", None),
80 "javascript": ("https://gdevops.gitlab.io/tuto_javascript/", None),
81 "build": ("https://gdevops.gitlab.io/tuto_build/", None),
82 "project": ("https://gdevops.gitlab.io/tuto_project/", None),
83 "tuto_secops": ("https://gdevops.gitlab.io/tuto_secops/", None),
84 "tuto_htmx": ("https://gdevops.gitlab.io/tuto_htmx/", None),
85 "tuto_html": ("https://gdevops.gitlab.io/tuto_html/", None),
86 "databases": ("https://gdevops.gitlab.io/tuto_databases/", None),
87 "webframeworks": ("https://gdevops.gitlab.io/tuto_webframeworks/", None),
88 "programming": ("https://gdevops.gitlab.io/tuto_programming/", None),
89 "http": ("https://gdevops.gitlab.io/tuto_http/", None),
90 "sphinx_material": ("https://gdevops.gitlab.io/tuto_sphinx_material", None),
91}
92extensions.append("sphinx.ext.todo")
93todo_include_todos = True
94
95extensions += [
96 "sphinx_panels",
97]
98extensions += ["sphinx_tabs.tabs"]
99# Panels config
100panels_add_bootstrap_css = False
101
102# autoclasstoc + napoleon + autodoc
103# https://autoclasstoc.readthedocs.io/en/latest/basic_usage.html
104extensions += [
105 "autoclasstoc",
106 "sphinx.ext.napoleon",
107 "sphinx.ext.autodoc",
108 "sphinx.ext.autosummary",
109 "sphinx.ext.viewcode",
110]
111autodoc_default_options = {
112 "members": True,
113 "special-members": True,
114 "private-members": True,
115 "inherited-members": True,
116 "undoc-members": True,
117 "exclude-members": "__weakref__",
118}
119
120# material theme options (see theme.conf for more information)
121# https://gitlab.com/bashtage/sphinx-material/blob/master/sphinx_material/sphinx_material/theme.conf
122# Colors
123# The theme color for mobile browsers. Hex color.
124# theme_color = #3f51b5
125# Primary colors:
126# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
127# teal, green, light-green, lime, yellow, amber, orange, deep-orange,
128# brown, grey, blue-grey, white
129# Accent colors:
130# red, pink, purple, deep-purple, indigo, blue, light-blue, cyan,
131# teal, green, light-green, lime, yellow, amber, orange, deep-orange
132# color_accent = blue
133# color_primary = blue-grey
134
135# material theme options (see theme.conf for more information)
136html_theme_options = {
137 "base_url": "https://gdevops.gitlab.io/tuto_django/",
138 "repo_url": "https://gitlab.com/gdevops/tuto_django/",
139 "repo_name": project,
140 "html_minify": False,
141 "html_prettify": True,
142 "css_minify": True,
143 "repo_type": "gitlab",
144 "globaltoc_depth": -1,
145 "color_primary": "green",
146 "color_accent": "cyan",
147 "theme_color": "#2196f3",
148 "master_doc": False,
149 "nav_title": f"{project} ({today})",
150 "nav_links": [
151 {
152 "href": "genindex",
153 "internal": True,
154 "title": "Index",
155 },
156 {
157 "href": "https://awesomedjango.org/",
158 "internal": False,
159 "title": "Awsome Django",
160 },
161 {
162 "href": "https://gdevops.gitlab.io/tuto_htmx/",
163 "internal": False,
164 "title": "Tuto HTMX",
165 },
166 {
167 "href": "https://gdevops.gitlab.io/tuto_http/",
168 "internal": False,
169 "title": "Tuto HTTP",
170 },
171 {
172 "href": "https://gdevops.gitlab.io/tuto_devops/",
173 "internal": False,
174 "title": "Tuto devops",
175 },
176 ],
177 "heroes": {
178 "index": "Tuto Django",
179 },
180 "table_classes": ["plain"],
181}
182
183
184language = "en"
185html_last_updated_fmt = ""
186
187todo_include_todos = True
188
189html_use_index = True
190html_domain_indices = True
191
192
193copyright = f"2018-{now.year}, {author} Built with sphinx {sphinx.__version__} Python {platform.python_version()}"
gitlab-ci.yaml ¶
1image: python:3.11.0-slim-bullseye
2
3pages:
4 script:
5 - pip install -r requirements.txt
6 - sphinx-build -d _build/doctrees . _build/html
7 - mv _build/html public
8 artifacts:
9 paths:
10 - public
11 only:
12 - main
.pre-commit-config.yaml ¶
1---
2
3# .pre-commit-config.yaml
4# ========================
5#
6# pre-commit clean
7# pre-commit install
8# pre-commit install-hooks
9#
10# precommit hooks installation
11#
12# - pre-commit autoupdate
13#
14# - pre-commit run black
15#
16# continuous integration
17# ======================
18#
19# - pre-commit run --all-files
20#
21
22repos:
23 - repo: https://github.com/pre-commit/pre-commit-hooks
24 rev: v4.3.0
25 hooks:
26 - id: trailing-whitespace
27 - id: end-of-file-fixer
28 - id: check-yaml
29 - id: check-json
30 - id: fix-encoding-pragma
31 args: ['--remove']
32 - id: forbid-new-submodules
33 - id: mixed-line-ending
34 args: ['--fix=lf']
35 description: Forces to replace line ending by the UNIX 'lf' character.
36 #- id: pretty-format-json
37 # args: ['--no-sort-keys']
38 - id: check-added-large-files
39 args: ['--maxkb=500']
40 - id: no-commit-to-branch
41 args: [--branch, staging]
42
43 - repo: https://github.com/ambv/black
44 rev: 22.8.0
45 hooks:
46 - id: black
47 language_version: python3.11
48
49 - repo: https://github.com/asottile/reorder_python_imports
50 rev: v3.8.3
51 hooks:
52 - id: reorder-python-imports
53
54 - repo: https://github.com/hadialqattan/pycln
55 rev: v2.1.1 # Possible releases: https://github.com/hadialqattan/pycln/tags
56 hooks:
57 - id: pycln
58 args: [--config=pyproject.toml]
59
60 - repo: https://github.com/rtts/djhtml
61 rev: v1.5.2
62 hooks:
63 - id: djhtml
Makefile ¶
1# Minimal makefile for Sphinx documentation
2#
3
4# You can set these variables from the command line.
5SPHINXOPTS =
6SPHINXBUILD = sphinx-build
7SPHINXPROJ = Tutopython
8SOURCEDIR = .
9BUILDDIR = _build
10
11THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST))
12
13# Put it first so that "make" without argument is like "make help".
14help:
15 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
16 @echo " "
17 @echo "Targets:"
18 @echo " "
19 @echo "- make check_all"
20 @echo "- make req"
21 @echo "- make update"
22 @echo "- make clearcache"
23 @echo " "
24
25clearcache:
26 poetry cache clear --all pypi
27
28
29check_all:
30 pre-commit run --all-files
31
32req:
33 poetry env info --path
34 poetry show --tree
35 poetry check
36 poetry export -f requirements.txt --without-hashes > requirements.txt
37 cat requirements.txt
38
39update:
40 poetry update
41 @$(MAKE) -f $(THIS_MAKEFILE) req
42 pre-commit autoupdate
43
44.PHONY: help Makefile
45
46# Catch-all target: route all unknown targets to Sphinx using the new
47# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
48%: Makefile
49 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)