From 340c4c2df62526c0b60ce3cf688b1e12af15305e Mon Sep 17 00:00:00 2001 From: Julien Date: Sun, 3 May 2020 23:20:59 +0200 Subject: [PATCH 01/59] Add auto-generated doc from source code --- .gitignore | 2 + .vscode/settings.json | 1 + docs/Makefile | 20 ++++++++ docs/conf.py | 110 +++++++++++++++++++++++++++++++++++++++++ docs/index.rst | 26 ++++++++++ docs/make.bat | 35 +++++++++++++ elgeopaso/__about__.py | 3 +- requirements/local.txt | 1 + 8 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 docs/Makefile create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat diff --git a/.gitignore b/.gitignore index d6227397..d0da178e 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,7 @@ coverage.xml # Sphinx documentation docs/_build/ +docs/_apidoc/ # PyBuilder target/ @@ -101,6 +102,7 @@ nltk_data/* # bash .bash_history +# tests and PEP8 *.whl dev_flake8_report.txt junit/test-results.xml diff --git a/.vscode/settings.json b/.vscode/settings.json index 15697bcb..6fbdfba4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,4 +19,5 @@ "python.testing.nosetestsEnabled": false, "autoDocstring.customTemplatePath": ".vscode\\docstring-config.mustache", "autoDocstring.generateDocstringOnEnter": false, + "restructuredtext.confPath": "${workspaceFolder}\\docs", } diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d0c3cbf1 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..20e1e30d --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,110 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys + +sys.path.insert(0, os.path.abspath("..")) + +# 3rd party +import django + +# Project +from elgeopaso import __about__ + + +# -- Build environment ----------------------------------------------------- +on_rtd = os.environ.get("READTHEDOCS", None) == "True" +os.environ["DJANGO_SETTINGS_MODULE"] = "elgeopaso.settings.local" +django.setup() + +# -- Project information ----------------------------------------------------- + +project = __about__.__title__ +author = __about__.__author__ +copyright = __about__.__copyright__ + +# The full version, including alpha/beta/rc tags +version = release = __about__.__version__ + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "recommonmark", + "sphinx.ext.autodoc", + "sphinx_autodoc_typehints", + "sphinx_markdown_tables", + "sphinx_rtd_theme", +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# source_suffix = ['.rst', '.md'] +source_suffix = {".rst": "restructuredtext", ".md": "markdown"} + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = "fr" + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "samples/*", "Thumbs.db", ".DS_Store", "*env*", "libs/*"] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# Ensure sidebar is the same along the pages +html_sidebars = { + "**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"] +} + +# -- Options for extensions ------------------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("https://python.readthedocs.io/en/latest/", None), + "django": ("https://django.readthedocs.org/en/stable/", None), +} + +# -- Options for Sphinx API doc ---------------------------------------------- +# run api doc +def run_apidoc(_): + from sphinx.ext.apidoc import main + + cur_dir = os.path.normpath(os.path.dirname(__file__)) + output_path = os.path.join(cur_dir, "_apidoc") + modules = os.path.normpath(os.path.join(cur_dir, "../elgeopaso")) + exclusions = [] + main(["-e", "-f", "-M", "-o", output_path, modules] + exclusions) + + +# launch setup +def setup(app): + app.connect("builder-inited", run_apidoc) diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..dc0b367a --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,26 @@ +.. El Géo Paso documentation master file, created by + sphinx-quickstart on Sun May 3 23:02:56 2020. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Documentation technique pour El Géo Paso +======================================== + +.. |date| date:: + +Mise à jour : |date| + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + +---- + +.. toctree:: + :maxdepth: 3 + :caption: Package + + _apidoc/modules diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..922152e9 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/elgeopaso/__about__.py b/elgeopaso/__about__.py index e4b81c96..acba8f51 100644 --- a/elgeopaso/__about__.py +++ b/elgeopaso/__about__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- #! python3 # noqa: E265 # noqa: E265 """ @@ -20,7 +19,7 @@ ] -__author__ = "Julien M. (guts@github)" +__author__ = "Julien M. (guts@github, geojulien@twitter)" __copyright__ = "2018 - {0}, {1}".format(date.today().year, __author__) __email__ = "elpaso@georezo.net" __license__ = "GNU Lesser General Public License v3.0" diff --git a/requirements/local.txt b/requirements/local.txt index 0e2e1b71..894e94d7 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -13,6 +13,7 @@ Werkzeug==1.0.* # https://github.com/pallets/werkzeug # ----------------------- recommonmark==0.6.* Sphinx==2.4.* # https://github.com/sphinx-doc/sphinx +sphinx-autodoc-typehints==1.10.* sphinx-markdown-tables==0.0.12 # to render markdown tables sphinx-rtd-theme==0.4.* From 509803d255437e9b4b5152d435c199571b5ec7f9 Mon Sep 17 00:00:00 2001 From: Julien Date: Sun, 3 May 2020 23:21:13 +0200 Subject: [PATCH 02/59] Add RTD config --- .readthedocs.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .readthedocs.yml diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..582b88c6 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,28 @@ +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# VCS +submodules: + exclude: all + recursive: false + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Build documentation with MkDocs +#mkdocs: +# configuration: mkdocs.yml + +# Optionally build your docs in additional formats such as PDF and ePub +formats: all + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.7 + install: + - requirements: requirements/local.txt From c40df7cb8ec414d305aa65eb86fde7039dbe46b2 Mon Sep 17 00:00:00 2001 From: Julien Date: Sun, 3 May 2020 23:32:34 +0200 Subject: [PATCH 03/59] Add RTD badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8b74ac29..44d551c7 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ ![Continuous integration and deployment](https://github.com/Guts/elgeopaso/workflows/Continuous%20integration%20and%20deployment/badge.svg) [![codecov](https://codecov.io/gh/Guts/elgeopaso/branch/master/graph/badge.svg)](https://codecov.io/gh/Guts/elgeopaso) !["Python 3.7.x"](https://img.shields.io/badge/python-3.7-blue.svg) +[![Documentation Status](https://readthedocs.org/projects/elgeopaso/badge/?version=latest)](https://elgeopaso.readthedocs.io/en/latest/?badge=latest) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) From 9ecaa0675f3ea4dbd4115be1e23c8e8aa251c0a9 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 4 May 2020 00:13:56 +0200 Subject: [PATCH 04/59] Bump sphinx to v3 --- requirements/local.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 894e94d7..722f8b7b 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -12,8 +12,9 @@ Werkzeug==1.0.* # https://github.com/pallets/werkzeug # Documentation # ----------------------- recommonmark==0.6.* -Sphinx==2.4.* # https://github.com/sphinx-doc/sphinx +Sphinx==3.0.* # https://github.com/sphinx-doc/sphinx sphinx-autodoc-typehints==1.10.* +sphinx-copybutton==0.2.11 sphinx-markdown-tables==0.0.12 # to render markdown tables sphinx-rtd-theme==0.4.* From f054c6e9b665a35ae0e0adc3168f90447f0b4643 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 4 May 2020 00:14:26 +0200 Subject: [PATCH 05/59] Improve rcommonmark config (for markdown handling) --- docs/conf.py | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 20e1e30d..f96f10f1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,6 +17,8 @@ # 3rd party import django +import recommonmark +from recommonmark.transform import AutoStructify # Project from elgeopaso import __about__ @@ -43,6 +45,7 @@ # ones. extensions = [ "recommonmark", + "sphinx_copybutton", "sphinx.ext.autodoc", "sphinx_autodoc_typehints", "sphinx_markdown_tables", @@ -85,15 +88,27 @@ "**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"] } +# Language to be used for generating the HTML full-text search index. +# Sphinx supports the following languages: +# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' +# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' +html_search_language = "fr" + +# The master toctree document. +master_doc = "index" + # -- Options for extensions ------------------------------------------------- -# Example configuration for intersphinx: refer to the Python standard library. +# -- intersphinx: refer to others sphinx docs intersphinx_mapping = { "python": ("https://python.readthedocs.io/en/latest/", None), "django": ("https://django.readthedocs.org/en/stable/", None), } -# -- Options for Sphinx API doc ---------------------------------------------- +# -- recommonmark +github_doc_root = __about__.__uri__ + "tree/master/docs" + +# -- API autodoc # run api doc def run_apidoc(_): from sphinx.ext.apidoc import main @@ -107,4 +122,18 @@ def run_apidoc(_): # launch setup def setup(app): + # api autodoc app.connect("builder-inited", run_apidoc) + + # structify + app.add_config_value( + "recommonmark_config", + { + "url_resolver": lambda url: github_doc_root + url, + "auto_toc_tree_section": "Contents", + "enable_auto_toc_tree": True, + "enable_eval_rst": True, + }, + True, + ) + app.add_transform(AutoStructify) From 4e792aec8c323dfc73903e358fb2915280e96d95 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 4 May 2020 00:14:53 +0200 Subject: [PATCH 06/59] Switch from github wiki --- docs/database/backup.md | 86 +++++++++ docs/database/index.md | 79 ++++++++ docs/deployment/git_flow.md | 98 ++++++++++ docs/deployment/preproduction.md | 56 ++++++ docs/deployment/production.md | 300 +++++++++++++++++++++++++++++ docs/deployment/scheduled_tasks.md | 34 ++++ docs/deployment/server_apache.md | 147 ++++++++++++++ docs/development/build.md | 9 + docs/development/code.md | 43 +++++ docs/development/index.md | 173 +++++++++++++++++ docs/development/settings.md | 11 ++ docs/development/tests.md | 3 + docs/global/history.md | 13 ++ docs/global/index.md | 5 + docs/global/product_life.md | 16 ++ docs/index.rst | 49 ++++- docs/misc/miscellaneous.md | 56 ++++++ docs/misc/resources.md | 33 ++++ 18 files changed, 1208 insertions(+), 3 deletions(-) create mode 100644 docs/database/backup.md create mode 100644 docs/database/index.md create mode 100644 docs/deployment/git_flow.md create mode 100644 docs/deployment/preproduction.md create mode 100644 docs/deployment/production.md create mode 100644 docs/deployment/scheduled_tasks.md create mode 100644 docs/deployment/server_apache.md create mode 100644 docs/development/build.md create mode 100644 docs/development/code.md create mode 100644 docs/development/index.md create mode 100644 docs/development/settings.md create mode 100644 docs/development/tests.md create mode 100644 docs/global/history.md create mode 100644 docs/global/index.md create mode 100644 docs/global/product_life.md create mode 100644 docs/misc/miscellaneous.md create mode 100644 docs/misc/resources.md diff --git a/docs/database/backup.md b/docs/database/backup.md new file mode 100644 index 00000000..20babb35 --- /dev/null +++ b/docs/database/backup.md @@ -0,0 +1,86 @@ +# Sauvegarde et restauration de la base de données + +La base de données en production est motorisée par PostgreSQL/PostGIS (celle de développement par SQLite3) : + +```sql +elpaso=> SELECT version(); +elpaso=> PostgreSQL 9.6.9 on x86_64-pc-linux-gnu (Ubuntu 9.6.9-2.pgdg16.04+1), compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609, 64-bit +elpaso=> SELECT PostGIS_full_version(); +elpaso=> POSTGIS="2.4.4 r16526" PGSQL="96" GEOS="3.5.1-CAPI-1.9.1 r4246" PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 1.11.3, released 2015/09/16" LIBXML="2.9.3" LIBJSON="0.11.99" LIBPROTOBUF="1.2.1" (core procs from "2.4.1 r16012" need upgrade) RASTER (raster procs from "2.4.1 r16012" need upgrade) +``` + +Les données sont de plusieurs types dans le projet : + +* les offres d'emploi : + * la version brute récupérée depuis les sources (RSS GeoRezo...) + * la version analysée + +* les données de référence qui servent à l'analyse : + + * les lieux et leurs variantes + * les types de contrats et leurs variantes + * les technologies et leurs variantes + * les métiers et leurs variantes + +* les contenus éditoriaux (page d'accueil, section aide...) + +* les tables liées à l'administration et à Django : utilisateurs, migrations... + +La base est sauvegardée : + +* via des tâches planifiées liées à l'infrastructure et à l'hébergeur +* via les outils de sauvegardes et restauration intégrés à Django (voir ci-dessous) +* la base sur le serveur de développement est régulièrement synchronisée dans le dépôt via Git LFS + +A l'avenir, il peut être envisagé d'utiliser [Django Smuggler](https://github.com/semente/django-smuggler) pour faciliter les opérations. + +---- + +## Utilitaires Django + +Les opérations doivent se faire dans l'environnement virtuel. Documentation de référence : + +* sauvegarder : [dumpdata](https://docs.djangoproject.com/en/dev/ref/django-admin/#dumpdata) +* restaurer : [loaddata](https://docs.djangoproject.com/en/dev/ref/django-admin/#loaddata) + +### Sauvegarder l'ensemble des données + +Utile pour effectuer une sauvegarde complète ou bien basculer les données entre développement et production. Attention, le fichier JSON produit est lourd (~90 Mo en juin 2018). + +#### Sauvegarder + +```bash +python manage.py dumpdata --exclude auth.permission --exclude contenttypes > elgeopaso_bkp_db.json +``` + +#### Restaurer + +```bash +python manage.py loaddata elgeopaso_bkp_db.json +``` + +### Sauvegarder les données de départ + +Pour un usage léger, des "fixtures" des principaux éléments nécessaires pour amorcer l'usage du projet sont exportes (avec indentation optionnelle) et stockées dans le dépôt du code. + +#### Sauvegarder + +```bash +python manage.py dumpdata jobs.Contract jobs.ContractVariations > elgeopaso/jobs/fixtures/contracts.json +python manage.py dumpdata jobs.JobPosition jobs.JobPositionVariations > elgeopaso/jobs/fixtures/metiers.json +python manage.py dumpdata jobs.Place jobs.PlaceVariations > elgeopaso/jobs/fixtures/places.json +python manage.py dumpdata jobs.Source > elgeopaso/jobs/fixtures/sources.json +python manage.py dumpdata jobs.Technology jobs.TechnologyVariations > elgeopaso/jobs/fixtures/technos.json +python manage.py dumpdata --exclude auth.permission --exclude contenttypes cms.Article cms.Category > elgeopaso/cms/fixtures/content.json +``` + +#### Restaurer + +```bash +python manage.py loaddata elgeopaso/jobs/fixtures/contracts.json +python manage.py loaddata elgeopaso/jobs/fixtures/metiers.json +python manage.py loaddata elgeopaso/jobs/fixtures/places.json +python manage.py loaddata elgeopaso/jobs/fixtures/sources.json +python manage.py loaddata elgeopaso/jobs/fixtures/technos.json +python manage.py loaddata elgeopaso/cms/fixtures/content.json +``` diff --git a/docs/database/index.md b/docs/database/index.md new file mode 100644 index 00000000..0d3e075c --- /dev/null +++ b/docs/database/index.md @@ -0,0 +1,79 @@ +# Administration de la base de données + +## Configuration initiale + +Ouvrir la session super-admin avec l'utilisateur `postgres` (créé par défaut lors de l'installation) : + +```bash +sudo -u postgres psql + +psql (12.2 (Ubuntu 12.2-2.pgdg16.04+1), serveur 9.6.17) +Saisissez « help » pour l'aide. + +postgres=# +``` + +Une fois dans l'invite de commandes `psql` : + +```psql +CREATE DATABASE elgeopaso; +``` + +Créer l'utilisateur avec les options recommandées pour Django : + +```psql +CREATE USER "elgeopaso-db-uzr"; +ALTER ROLE "elgeopaso-db-uzr" SET client_encoding TO 'utf8'; +ALTER ROLE "elgeopaso-db-uzr" SET default_transaction_isolation TO 'read committed'; +ALTER ROLE "elgeopaso-db-uzr" SET timezone TO 'UTC'; + +GRANT ALL PRIVILEGES ON DATABASE elgeopaso TO "elgeopaso-db-uzr"; + +\password "elgeopaso-db-uzr" +``` + +Ressources : + +* [Configuration PostgreSQL recommandée par Django](https://docs.djangoproject.com/fr/2.2/ref/databases/#postgresql-notes) +* [Doc officielle sur `ALTER ROLE` et la création protégée de mot de passe](https://docs.postgresql.fr/12/sql-alterrole.html) + +---- + +## Opérations courantes + +Après connexion en tant que super utilisateur : + +```bash +sudo -u postgres psql +``` + +### Lister les bases + +```psql +\l + + Liste des bases de données + Nom | Propriétaire | Encodage | Collationnement | Type caract. | Droits d'accès +-----------+--------------+----------+-----------------+--------------+----------------------- + elpaso | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =Tc/postgres + + | | | | | postgres=CTc/postgres+ + | | | | | geotribu=CTc/postgres + postgres | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | + template0 | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =c/postgres + + | | | | | postgres=CTc/postgres + template1 | postgres | UTF8 | fr_FR.UTF-8 | fr_FR.UTF-8 | =c/postgres + + | | | | | postgres=CTc/postgres +(4 lignes) +``` + +### Lister les utilisateurs + +```psql +\du+ + + Liste des rôles + Nom du rôle | Attributs | Membre de | Description +-------------+---------------------------------------------------------------------------------+-----------+------------- + geotribu | | {} | + postgres | Superutilisateur, Créer un rôle, Créer une base, Réplication, Contournement RLS | {} | +``` diff --git a/docs/deployment/git_flow.md b/docs/deployment/git_flow.md new file mode 100644 index 00000000..7f0657f1 --- /dev/null +++ b/docs/deployment/git_flow.md @@ -0,0 +1,98 @@ +# Git Flow + +Le projet s'appuie sur l'intégration d'Heroku avec Github pour déployer des versions de test/développement et de pré-production : + +- [les *Review Apps*](https://devcenter.heroku.com/articles/github-integration-review-apps#changes) : des déploiements temporaires correspondant à une *Pull Request* +- [une application gratuite](https://www.heroku.com/pricing) : déploiement automatisé à partir de `master` sur . + +## Branches + +- `origin/master` : + - branche principale + - correspond à la pré-production + - *pull request* obligatoire : aucun commit ne peut être poussé directement + - automatiquement déployée sur Heroku : + +- `origin/develop` : + - branche générique pour le développement actif + +- `origin/housekeeping` : + - branche dédiée aux opérations courantes de maintenance, mise à jour des dépendances, etc. + +## Processus type + +1. Une nouvelle branche est créée ou une existante est utilisée + +2. Des changements sont apportés dans cette branche et poussés vers la branche principale (master) via une pull-request. Un déploiement temporaire est effectué sur une URL mi-aléatoire. Exemple : + + - travail sur l'amélioration de la lecture du RSS pour gérer les problèmes d'encodage : + - déploiement temporaire correspondant : - l'URL est indiqué sur la pull request + +3. Une fois les changements achevés et validés, ils sont fusionnés dans la branche principale (*merged*) qui est automatiquement déployée sur Heroku : + +4. Lorsqu'une nouvelle version est finalisée, un [numéro de version](product_life.md) est ajouté via un `git tag`. + +> Pour comprendre l'étiquetage des commits, voir ou [Divers - Utilitaires](miscellaneous.md). + +---- + +## Déploiement + +### Depuis le serveur de production + +#### Configuration initiale de Git + +1. S'ajouter aux utilisateurs + + ```bash + sudo adduser geotribu users + ``` + +2. Générer une paire de clés SSH : + + ```bash + ssh-keygen -f ~/.ssh/git_elgeopaso_rsa -t rsa -b 4096 -C "elpaso@georezo.net" + ``` + +3. Ajouter la clé publique dans la partie **Deploy keys** du dépôt en lecture seule : . + +> Voir la documentation officielle de GitHub : + +#### Configurer le dossier de destination + +On utilise le fork du [script de François Romain](https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3) : + +```bash +# récupérer le script +mkdir ~/scripts +cd ~/scripts +git clone git@gist.github.com:36672e8730244764b4a047f6584bd66d.git git-flow-deploy + +# lancer le script +source git-flow-deploy/project-create elgeopaso + +# modifier le git hook +cd /srv/git/elgeopaso.git/hooks/ +sudo nano post-receive + +# copier le contenu du fichier : .deploy/git-hooks/post-receive +``` + +Ressources : + +- [le fichier du hook post-receive dans le dépôt](https://github.com/Guts/elgeopaso/blob/master/.deploy/git-hooks/post-receive.sh) +- Voir le billet de blog lié : + +### Depuis la machine locale + +Ajouter le dépôt distant correspondant au serveur : + +```powershell +git remote add deploy-prod ssh://geotribu@elgeopaso.georezo.net/srv/git/elgeopaso.git/ +``` + +Pour publier (par exemple depuis master) : + +```powershell +git push --follow-tags deploy-prod master +``` diff --git a/docs/deployment/preproduction.md b/docs/deployment/preproduction.md new file mode 100644 index 00000000..65bfc488 --- /dev/null +++ b/docs/deployment/preproduction.md @@ -0,0 +1,56 @@ +# Pré-production + +Le site est déployé en pré-production sur [Heroku](https://dashboard.heroku.com/apps). + +## Prérequis + +- compte Heroku : le niveau gratuit suffit pour un déploiement basique +- outil en ligne de commande Heroku : [CLI Heroku](https://devcenter.heroku.com/articles/heroku-cli#download-and-install) + +## Déployer + +### Déploiement automatisé + +L'application peut être déployée automatiquement via le fichier `app.json`. + +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) + +> Plus d'informations : + +### Déploiement pas à pas + +> Commandes lancées sous Windows 10 avec WSL activé. + +```powershell +# authenticate +heroku login + +# add convenient plugin to pull/push from/to `.env` files +# https://github.com/xavdid/heroku-config +heroku plugins:install heroku-config + +# create app in Europe +heroku create elgeopaso-dev --region eu + +# add PostgreSQL database and schedule backup +heroku addons:create heroku-postgresql:hobby-dev --version=12 +heroku pg:backups schedule --at "02:00 Europe/Paris" DATABASE_URL +# On bash, use simple quotes for the time zone: heroku pg:backups schedule --at '02:00 Europe/Paris' DATABASE_URL + +# set some environment variables pointing to application's settings +heroku config:set PYTHONHASHSEED=random +heroku config:set WEB_CONCURRENCY=4 +heroku config:set DJANGO_DEBUG=False +heroku config:set DJANGO_SETTINGS_MODULE=elgeopaso.settings.production +heroku config:set DJANGO_ALLOWED_HOSTS=elgeopaso-dev.herokuapp.com +heroku config:set DJANGO_ADMIN_URL=admin +heroku config:set DJANGO_SECRET_KEY=$(wsl -- openssl rand -base64 64) +# on bash: heroku config:set DJANGO_SECRET_KEY="$(openssl rand -base64 64)" + +# now, let's deploy +git push heroku master:master +heroku run python manage.py migrate +heroku run python manage.py createsuperuser --email elpaso@georezo.net +heroku run python manage.py check --deploy +heroku open +``` diff --git a/docs/deployment/production.md b/docs/deployment/production.md new file mode 100644 index 00000000..b17ee76c --- /dev/null +++ b/docs/deployment/production.md @@ -0,0 +1,300 @@ +# Deployment + +## Ubuntu Server 16.04 + +### OS setup + +```bash +# dependencies +sudo apt install curl build-essential python3-software-properties python3-venv python3-dev python3-pip python-software-properties python-dev python-pip libsqlite3-dev sqlite3 bzip2 libbz2-dev gunicorn nginx git build-essential tcl +curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash +sudo apt install git-lfs + +pip3 install --upgrade pip +pip3 install virtualenv --upgrade + +# web app directory +mkdir -p /webapps/elpaso +# clone repository +cd /webapps/elpaso +git clone https://github.com/Guts/elpaso.git . +mkdir tmp +# COPY secrets.ini inside folder + +# groups and users +sudo groupadd --system webapps +sudo useradd --system --gid webapps --shell /bin/bash --home /webapps/elpaso elpacha +sudo usermod -a -G "www-data" elpacha +sudo chown -R elpacha:www-data /webapps/elpaso/ +sudo chmod -R g+w /webapps/elpaso + +# virtualenv +pvernier@datamadre:/webapps/elpaso$ sudo su - elpacha +pyvenv virtenv +source ./virtenv/bin/activate +pip install --upgrade pip +pip install -r requirements.txt +deactivate + +# back to main user +exit + +# open directory to other users +sudo chown -R elpacha:www-data /webapps/elpaso +sudo chgrp -R www-data /webapps/elpaso +sudo chmod -R 770 /webapps/elpaso/ +sudo usermod -a -G "webapps" geoj +sudo usermod -a -G "webapps" pvernier +sudo usermod -a -G "www-data" geoj +sudo usermod -a -G "www-data" pvernier +``` + +---- + +### Gunicorn setup (HTTP server) + +#### Manual serve + +```bash +# back into the virtualenv as elpacha +cd /webapps/elpaso +elpacha@datamadre:~$ source virtenv/bin/activate +# Check manual serving +(virtenv) elpacha@datamadre:~$ gunicorn elpaso.wsgi:application --bind elgeopaso.fr:8443 --log-level debug +``` + +#### Set gunicorn start parameters + +Edit/Create the file: + +```bash +nano -c /webapps/elpaso/bin/gunicorn_start +``` + +Insert something like this: + +```bash +#!/bin/bash + +NAME="ElPaso_app" # Name of the application +DJANGODIR=/webapps/elpaso/ # Django project directory +SOCKFILE=/webapps/elpaso/run/gunicorn.sock # we will communicte using this unix soc$ +USER=elpacha # the user to run as +GROUP=www-data # the group to run as +NUM_WORKERS=3 # how many worker processes should Gunic$ +DJANGO_SETTINGS_MODULE=elpaso.settings # which settings file should Django use +DJANGO_WSGI_MODULE=elpaso.wsgi # WSGI module name + +echo "Starting $NAME as `whoami`" + +# Activate the virtual env +cd $DJANGODIR +source /webapps/elpaso/virtenv/bin/activate +export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE +export PYTHONPATH=$DJANGODIR:$PYTHONPATH + +# Create the run directory if it doesn't exist +RUNDIR=$(dirname $SOCKFILE) +test -d $RUNDIR || mkdir -p $RUNDIR + +# Start your Django Unicorn +exec /webapps/elpaso/virtenv/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \ + --name $NAME \ + --workers $NUM_WORKERS \ + --user=$USER \ + --log-level=debug \ + --log-file=/webapps/elpaso/logs/gunicorn.log \ + --bind=unix:$SOCKFILE +# --bind=163.172.12.190:8443 +# --bind=elgeopaso.fr:8000 +``` + +```bash +sudo chmod u+x /webapps/elpaso/bin/gunicorn_start +``` + +#### Set gunicorn as a systemd service + +See: [Digital Ocean tutorial](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-debian-8#create-a-gunicorn-systemd-service-file) + +1. Edit/Create the file: + + ```bash + sudo nano /etc/systemd/system/gunicorn.service + ``` + +2. Insert something like this: + + ```ini + [Unit] + Description=gunicorn daemon + After=network.target + + [Service] + User=elpacha + Group=www-data + WorkingDirectory=/webapps/elpaso + ExecStart=/webapps/elpaso/bin/gunicorn_start + + [Install] + WantedBy=multi-user.target + ``` + +3. Validate, start and reference (symlink) + + ```bash + sudo systemctl start gunicorn + sudo systemctl daemon-reload + sudo systemctl enable gunicorn + sudo systemctl restart gunicorn + ``` + +4. Check the status + + ```bash + sudo systemctl status gunicorn + ``` + + Output expected: + + ```bash + ● gunicorn.service - gunicorn daemon + Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled) + Active: active (running) since Tue 2017-01-10 23:10:37 CET; 26s ago + Main PID: 7558 (gunicorn: maste) + CGroup: /system.slice/gunicorn.service + ├─7558 gunicorn: master [elpaso.wsgi:application] + ├─7570 gunicorn: worker [elpaso.wsgi:application] + ├─7571 gunicorn: worker [elpaso.wsgi:application] + └─7572 gunicorn: worker [elpaso.wsgi:application] + + Jan 10 23:10:37 datamadre systemd[1]: Started gunicorn daemon. + Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7558] [INFO] Starting gunicorn 19.6.0 + Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7558] [INFO] Listening at: unix:/webapps/elpaso/run/gunicorn.sock (7558) + Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7558] [INFO] Using worker: sync + Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7570] [INFO] Booting worker with pid: 7570 + Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7571] [INFO] Booting worker with pid: 7571 + Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7572] [INFO] Booting worker with pid: 7572 + ``` + +---- + +### nginx setup (reverse proxy) + +#### Remove default site + +1. Edit nginx configuration + + ```bash + sudo nano -c /etc/nginx/nginx.conf + ``` + +2. Comment this line: + + ```ini + # include /etc/nginx/conf.d/*.conf; + ``` + +#### Add webapp configuration file + +1. Edit file + + ```bash + sudo nano -c /etc/nginx/sites-available/elpaso + ``` + +2. Insert something like this: + + ```nginx + server { + listen 80; + server_name 163.172.42.190; + rewrite ^(.*) http://elgeopaso.fr$1 permanent; + } + + + server { + listen 80; + server_name www.elgeopaso.fr; + rewrite ^(.*) http://elgeopaso.fr$1 permanent; + } + + + server { + listen 80; + server_name elgeopaso.fr; + + location = /favicon.ico { access_log off; log_not_found off; } + location /static/ { + root /webapps/elpaso; + } + + client_max_body_size 4G; + access_log /webapps/elpaso/logs/nginx.access.log; + error_log /webapps/elpaso/logs/nginx.error.log; + + location / { + include proxy_params; + # proxy_pass http://163.172.42.190:8443; # Pass to Gunicorn + proxy_pass http://unix:/webapps/elpaso/run/gunicorn.sock; + proxy_set_header X-Real-IP $remote_addr; # get real Client IP + proxy_redirect off; + } + } + ``` + +3. Validate, symlink and start + + ```bash + sudo ln -s /etc/nginx/sites-available/elpaso /etc/nginx/sites-enabled/elpaso + sudo service nginx restart + ``` + +---- + +### Option : supervisor + +1. Install + + ```bash + sudo apt install supervisor + ``` + +2. Edit/create the supervisor file + + ```bash + sudo nano -c /etc/supervisor/conf.d/elpaso.conf + ``` + +3. Insert something like this: + + ```ini + [program:elpaso] + command = /webapps/elpaso/bin/gunicorn_start ; Command to start app + user = elpacha ; User to run as + stdout_logfile = /webapps/elpaso/logs/gunicorn_supervisor.log ; Where to write log messages + redirect_stderr = true ; Save stderr in the same log + environment=LANG=fr_FR.UTF-8,LC_ALL=fr_FR.UTF-8 ; Set UTF-8 as default encoding + ``` + +4. Validate, update and start + + ```bash + sudo supervisorctl reread + sudo supervisorctl update + sudo supervisorctl status elpaso + ``` + +---- + +## Launch analisis + +```python +python manage.py rss2db +``` + +## SSL - Let's Encrypt + +```bash +sudo certbot certonly --nginx -w /webapps/elpaso -d elgeopaso.fr -d www.elgeopaso.fr +``` diff --git a/docs/deployment/scheduled_tasks.md b/docs/deployment/scheduled_tasks.md new file mode 100644 index 00000000..51eaacfc --- /dev/null +++ b/docs/deployment/scheduled_tasks.md @@ -0,0 +1,34 @@ +# Tâches planifiées + +Le projet repose sur certaines tâches récurrentes : + +* la récupération des offres d'emploi depuis GeoRezo +* le vidage du cache +* la génération des rapports envoyés par mail +* la génération des fichiers GeoJSON pour les cartes interactives +* le renouvellement du certificat SSL par Let's Encrypt + +En production, c'est [cron](https://fr.wikipedia.org/wiki/Cron) qui est utilisé. + +## Paramètres de planification + +Pour éditer les tâches planifiées lancées par cron avec nano : + +```bash +export VISUAL=nano; crontab -e +``` + +Insérer : + +```conf +# El Paso +@hourly cd /var/www/elgeopaso && /var/www/elgeopaso/.venv/bin/python /var/www/elgeopaso/manage.py rss2db +@daily cd /var/www/elgeopaso && /var/www/elgeopaso/.venv/bin/python /var/www/elgeopaso/manage.py clear_cache +30 23 * * 7 cd /var/www/elgeopaso && /var/www/elgeopaso/.venv/bin/python /var/www/elgeopaso/manage.py report +05 00 * * 7 cd /var/www/elgeopaso && /var/www/elgeopaso/.venv/bin/python /var/www/elgeopaso/manage.py map_builder + +# Let's Encrypt +0 2 * * * root /bin/bash /home/geotribu/letsencrypt/scripts/cron.sh > /home/geotribu/log/cron/letsencrypt.log +``` + +Pour la syntaxe, le site [crontab.guru](https://crontab.guru/) est une bonne ressource. diff --git a/docs/deployment/server_apache.md b/docs/deployment/server_apache.md new file mode 100644 index 00000000..dcbecafd --- /dev/null +++ b/docs/deployment/server_apache.md @@ -0,0 +1,147 @@ +# Utiliser Apache pour servir le site + +Pour servir l'application avec Apache, retenir ces quelques points de vigilance : + +- par défaut, Apache ne support pas [WSGI](https://wsgi.readthedocs.io/en/latest/what.html). Il faut donc utiliser le module `mod_wsgi` pour Apache. +- par défaut sur Ubuntu 16.04, ce module est compilé ave Python 3.5. **Or, il faut utiliser la version compilée avec la même version de Python que celle utilisée par l'application**. + +## Prérequis + +```sh +# add repo with latest Apache version +sudo add-apt-repository ppa:ondrej/apache2 +# install apache and dependencies +sudo apt install apache2 apache2-dev broli +``` + +## Déployer l'application Django avec le module Apache WSGI + +### 1. Identifier la bonne version du module et le chemin Python + +#### Installer et utiliser le module inclus dans l'environnement virtuel de l'application + +```sh +# in project folder +cd /var/www/elgeopaso +source .venv/bin/activate + +# install mod_wsgi Python module +python -m pip install mod-wsgi==4.7.* + +# run the config command to get the directives values +mod_wsgi-express module-config +> LoadModule wsgi_module "/var/www/elgeopaso/.venv/lib/python3.7/site-packages/mod_wsgi/server/mod_wsgi-py37.cpython-37m-x86_64-linux-gnu.so" +> WSGIPythonHome "/var/www/elgeopaso/.venv" +``` + +#### Installer et utiliser le module directement dans Apache + +```sh +# open root input +sudo su - +# in project folder +cd /var/www/elgeopaso +source .venv/bin/activate + +# install mod_wsgi Python module +python -m pip install mod-wsgi==4.7.* + +# run the config command to get the directives values +mod_wsgi-express install-module +> LoadModule wsgi_module "/usr/lib/apache2/modules/mod_wsgi-py37.cpython-37m-x86_64-linux-gnu.so" +> WSGIPythonHome "/var/www/elgeopaso/.venv" +``` + +---- + +### 2. Mettre à jour la configuration Apache + +```sh +# edit Apache module wsgi loader +sudo nano /etc/apache2/mods-available/wsgi.load + +# paste the line output in the previous step. For example: +LoadModule wsgi_module "/usr/lib/apache2/modules/mod_wsgi-py37.cpython-37m-x86_64-linux-gnu.so" +``` + +---- + +### 3. Enable site, reload and restart + +Validate configuration syntax: + +```sh +sudo apache2ctl -t +``` + +Enable virtual hosts: + +```sh +sudo a2ensite elpaso.conf +sudo a2ensite elpaso-ssl.conf +``` + +At the end, restart Apache server: + +```sh +sudo service apache2 restart +``` + +---- + +### 4. Générer le certificat SSL avec Let's Encrypt + +Il s'agit principalement de la reproduction de la doc officielle : . + +```sh +# travailler dans home +mkdir ~/letsencrypt +cd ~/letsencrypt + +# enregistrer le dépôt des paquets de certbot - letsencrypt +sudo apt update +sudo apt install software-properties-common +sudo add-apt-repository universe +sudo add-apt-repository ppa:certbot/certbot +sudo apt update + +# installer le certbot +sudo apt-get install certbot python-certbot-apache + +# lancer le processus en choisiasant elgeopaso.georezo.net +sudo certbot --apache +``` + +Tester le renouvellement automatique : + +```sh +sudo certbot renew --dry-run +``` + +---- + +## Commandes habituelles + +```bash +# check full version and compilation details +apache2ctl -V + +# help +apache2ctl -h + +# list enabled modules +apache2ctl -M + +``` + + +---- + +## Resources + +- [Django avec Apache et mod_wsgi](https://docs.djangoproject.com/fr/2.2/howto/deployment/wsgi/modwsgi/) +- [Déployer Apache sur Ubuntu](https://doc.ubuntu-fr.org/apache2) +- [documentation officielle du module mod_wsgi](https://modwsgi.readthedocs.io/en/develop/installation.html) +- [Le package Python correspondant au module WSGI pour Apache](https://pypi.org/project/mod-wsgi/) +- [Procédure de création d'un certificat SSL avec Let's Encrypt pour Apache](https://certbot.eff.org/lets-encrypt/ubuntuxenial-apache) +- [Outil de génération de configuration Apache par Mozilla](https://ssl-config.mozilla.org/) diff --git a/docs/development/build.md b/docs/development/build.md new file mode 100644 index 00000000..c50e1db3 --- /dev/null +++ b/docs/development/build.md @@ -0,0 +1,9 @@ +# Build and deploy + +## Build + +> TO DOC + +## Deploy + +> TO DOC diff --git a/docs/development/code.md b/docs/development/code.md new file mode 100644 index 00000000..4cfc792b --- /dev/null +++ b/docs/development/code.md @@ -0,0 +1,43 @@ +# Structure du code + +## Règles + +### Nommage des dossiers et fichiers + +* les sous-dossiers/fichiers précédés par un `.` sont liés au développement + +### Formatage du code + +Le projet s'appuie sur [black](https://github.com/python/black) pour formater automatiquement le code source. Un ensemble de `git hooks` peut également être utilisé afin de formater le code à chaque commit, via [pre-commit](https://pre-commit.com) en installant les _hooks_ configurés dans le fichier `.pre-commit-config.yaml` : + +```python +# installer les hooks +pre-commit install +# les exécuter manuellement +pre-commit run -a +``` + +---- + +## Dossier `.vscode` + +Configuration pour l'éditeur Visual Studio Code : + +* extensions recommandées (`extensions.json`) +* tâches (`tasks.json`) +* paramètres d'environnement de travail sur le projet (tests, etc.) (`settings.json`) +* paramètres de débogage (`launch.json`) + +---- + +## Dossier `tests` + +Tests unitaires et leurs éventuelles [*fixtures*](https://fr.wikipedia.org/wiki/Test_fixture). + +---- + +## Divers + +* `.coveragerc`: configuration pour le calcul de la couverture des tests (_coverage_ / _codecov_) +* `example.env`: modèle de fichier d'environnement +* `setup.cfg` : configuration de l'environnement Python diff --git a/docs/development/index.md b/docs/development/index.md new file mode 100644 index 00000000..dc08b31e --- /dev/null +++ b/docs/development/index.md @@ -0,0 +1,173 @@ +# Développement + +## Prérequis + +### OS + +#### Windows + +Version 10 minimum + +* activer le [sous-système Linux (WSL)](https://docs.microsoft.com/fr-fr/windows/wsl/install-win10) : + * installer [Debian](https://www.microsoft.com/store/apps/9MSVKQC78PK6) ou Ubuntu ([16.04](https://www.microsoft.com/store/apps/9pjn388hp8c9) ou [18.04](https://www.microsoft.com/store/apps/9N9TNGVNDL3Q)) + * [initialiser l'instance](https://docs.microsoft.com/fr-fr/windows/wsl/initialize-distro) + * installer les paquest souhaités, par exemple openssl : `sudo apt update && sudo apt upgrade && sudo apt install openssl libssl-dev` +* l'utilisation [du nouveau Terminal](https://www.microsoft.com/fr-fr/p/windows-terminal-preview/9n0dx20hk701?activetab=pivot:overviewtab) est fortement recommandée + +#### Linux + +Distributions compatibles : + +* Debian +* Ubuntu 16.04 ou 18.04 + +### Logiciels + +* Docker (Engine et Compose a minima) +* Python 3.7 64 bits +* PostgreSQL 12 + +---- + +## Lancer en local + +> Commandes lancées sous Windows 10 avec WSL activé. + +### Installation + +```powershell +# create virtual env +# on Linux: python3.7 -m venv .venv +py -3.7 -m venv .venv + +# enter into +.\.venv\Scripts\activate +# on Linux: source .venv/bin/activate + +# upgrade install tooling +python -m pip install --upgrade pip + +# install requirements +python -m pip install -U -r .\requirements\local.txt +# on Linux: python -m pip install -U -r requirements/local.txt + +# download NLTK packages - please refer to `ntlk.txt` +python -m nltk.downloader punkt stopwords + +# optionally, install pre-commit git-hooks +pre-commit install +``` + +### Configuration + +Renommer le fichier `example.env` en `.env` et le compléter. Pour info, il est possible de générer une clé Django Secret en passant par OpenSSL sur WSl : `wsl -- openssl rand -base64 64` (copier/coller dans le fichier `.env`). + +### Base de données + +Initialiser la base de données : + +```powershell +# apply migrations to database +python manage.py migrate + +# create the super user +python manage.py createsuperuser +``` + +Pour charger des enregistrements de base (technologies, métiers, types de contrats, etc.), utiliser `loaddata` : + +* voir les commandes dans le fichier de déploiement : `.deploy/release-tasks.sh` +* voir ["Restaurer les données"](backup#restaurer-1) + +### Lancer + +```powershell +# launch development web server +python .\manage.py runserver +# on Linux: python manage.py runserver + +# alternatively, use the enhanced command from django-extensions +python .\manage.py runserver_plus +``` + +Ouvrir le navigateur à l'adresse indiquée dans le terminal. Par défaut : . + +#### Avec HTTPS + +Pour développer au mieux, il est préférable de servir l'application en HTTPS. C'est possible via `runserver_plus` de Django Extensions ([voir la documentation](https://django-extensions.readthedocs.io/en/latest/runserver_plus.html#ssl)). + +```powershell +# create folder where to store certificate and key +mkdir certs +# generate SSL certificate and key +wsl -- openssl req -nodes -new -x509 -days 365 -keyout certs/serverKey.key -out certs/serverCert.cert +# on Linux: remove 'wsl -- ' + +# alternatively, use the enhanced command from django-extensions +python .\manage.py runserver_plus --cert-file .\certs\serverCert.cert --key-file .\certs\serverKey.key +``` + +Ouvrir le navigateur à l'adresse indiquée dans le terminal. Par défaut : . Accepter [le risque lié aux certificats auto-signés](https://support.mozilla.org/fr/kb/comment-regler-codes-erreur-securite-sur-sites-securises?as=u&utm_source=inproduct#w_certificats-auto-signaes). + +---- + +## Docker + +### Prérequis Docker + +* Docker 2.2+ ou dans le détail : + * Docker Engine : 19.03+ + * Docker Compose 1.25+ + +### Configuration Docker + +Renommer fichier `example.env` en `docker.env` et compléter : + +```ini +# DEVELOPMENT +DJANGO_DEBUG=1 +USE_DOCKER=1 + +# GLOBAL +DJANGO_ADMIN_URL="admin" +DJANGO_PROJECT_FOLDER="elgeopaso" +DJANGO_SECURE_SSL_REDIRECT=0 +DJANGO_SETTINGS_MODULE="elgeopaso.settings.production" +WEB_CONCURRENCY=4 + +# SECURITY +DJANGO_SECRET_KEY="change_me_with_generated_key" +DJANGO_ALLOWED_HOSTS="localhost, 0.0.0.0, 127.0.0.1" + +# EMAIL +REPORT_RECIPIENTS="elpaso@georezo.net," +SMTP_USER="elpaso@georezo.net" +SMTP_PSWD= + +# PostgreSQL +# ------------------------------------------------------------------------------ +POSTGRES_HOST=database +POSTGRES_PORT=5432 +POSTGRES_DB=elgeopaso-dev +POSTGRES_USER=elgeopaso +POSTGRES_PASSWORD=elgeopaso +DATABASE_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" +``` + +### Usage + +#### Lancer l'application + +```shell +docker-compose -f docker-compose.dev.yml up -d +``` + +Ouvrir le navigateur sur . + +#### Données et analyses de base + +Après que l'application soit lancée : + +```shell +docker-compose -f docker-compose.dev.yml run --rm webapp sh .deploy/release-tasks.sh +``` diff --git a/docs/development/settings.md b/docs/development/settings.md new file mode 100644 index 00000000..f199e66a --- /dev/null +++ b/docs/development/settings.md @@ -0,0 +1,11 @@ +# Configuration + +L'application tente de respecter les [12-Factor et notamment la partie concernant la configuration](https://www.12factor.net/config). L'essentiel de la configuration se fait donc à l'aide de variables d'environnement. + +## Structure de la configuration + +> TO DO + +## Fichier de configuration + +Fichier `.env`. diff --git a/docs/development/tests.md b/docs/development/tests.md new file mode 100644 index 00000000..892a06e8 --- /dev/null +++ b/docs/development/tests.md @@ -0,0 +1,3 @@ +# Tests + +> TO DOC diff --git a/docs/global/history.md b/docs/global/history.md new file mode 100644 index 00000000..3d232ed8 --- /dev/null +++ b/docs/global/history.md @@ -0,0 +1,13 @@ +# Histoire du Projet + +## Auteurs + +L'idée initiale est celle de [Pierre Vernier](https://github.com/pvernier) et de [Julien Moura](https://github.com/Guts), portés que nous étions par la regrettée dynamique de [Geotribu](http://geotribu.net) ! + +Les bénévoles de GeoRezo ont aussi contribué à relancer la dynamique lorsqu'elle s'éteignait, que ce soit [Yves Jacolin](https://github.com/yjacolin) pour les aspects techniques, [Marc Isenmann](https://www.linkedin.com/in/marc-isenmann-9b764b109/) pour son intérêt jamais démenti pour l'analyse des offres qu'il modère depuis tant d'années et Bruno Iratchet pour son soutien ponctuel mais non moins fidèle. + +## Pourquoi El Paso + +Pourquoi El Paso ? Depuis des temps immémoriaux, le choix d'un nom de projet informatique est cornélien (le mot est sûrement trop faible). Né autour de fajitas et de rhum, le nom El Paso s'est imposé comme une évidence. Bien traduit, il représente le petit pas qui sépare un chercheur d'emploi d'un poste. Une simple offre, un simple pas... non, en fait, rien de tout cela, c'est juste parce-que les fajitas étaient bonnes ! + +![Logo - Old El Paso](https://upload.wikimedia.org/wikipedia/en/2/27/Logo_for_Old_El_Paso,_Oct_2014.png "Fajitas + rhum = El Géo Paso") diff --git a/docs/global/index.md b/docs/global/index.md new file mode 100644 index 00000000..b8190a68 --- /dev/null +++ b/docs/global/index.md @@ -0,0 +1,5 @@ +# El Géo Paso - Wiki + +Documentation technique du projet El Géo Paso, statistiques dynamiques sur les offres d'emploi en géomatique publiées sur le forum francophone de géomatique [GeoRezo](https://georezo.net/forum/viewforum.php?id=10). + +Base de connaissances techniques sur le projet El Géo Paso. Cette base, enrichie au gré du temps disponible et de l'envie (autant dire qu'elle est incomplète), a vocation à éviter que le projet ne soit une boîte noire et à faciliter les phases de reprise du développement, celui-ci étant discontinu et irrégulier (bénévolat mon amour). diff --git a/docs/global/product_life.md b/docs/global/product_life.md new file mode 100644 index 00000000..c6a0b1a5 --- /dev/null +++ b/docs/global/product_life.md @@ -0,0 +1,16 @@ +# Gestion du projet + +## Nommage des versions + +Le projet respecte SemVer, pour *Semantic Versioning*. + +Consulter : + +- le [manifeste officiel de SemVer](https://semver.org/lang/fr/) +- le [paragraphe Wikipédia](https://en.wikipedia.org/wiki/Software_versioning#Change_significance) dédié à cette convention de nommage + +Exemples : + +```txt +1.0.0 +``` diff --git a/docs/index.rst b/docs/index.rst index dc0b367a..2414afa9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,8 +3,8 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Documentation technique pour El Géo Paso -======================================== +El Géo Paso - Documentation +=========================== .. |date| date:: @@ -17,10 +17,53 @@ Indices and tables * :ref:`modindex` * :ref:`search` +.. toctree:: + :maxdepth: 2 + :caption: Global + + global/index + global/history + global/product_life + +.. toctree:: + :maxdepth: 1 + :caption: Développement + + development/index + development/code + development/build + development/settings + development/tests + +.. toctree:: + :maxdepth: 1 + :caption: Déployer + + deployment/preproduction + deployment/production + deployment/git_flow + deployment/server_apache + deployment/scheduled_tasks + +.. toctree:: + :maxdepth: 1 + :caption: Base de données + + database/index + database/backup + +.. toctree:: + :maxdepth: 1 + :caption: Autres + + misc/miscellaneous + misc/resources + + ---- .. toctree:: :maxdepth: 3 - :caption: Package + :caption: Code source _apidoc/modules diff --git a/docs/misc/miscellaneous.md b/docs/misc/miscellaneous.md new file mode 100644 index 00000000..77a9091b --- /dev/null +++ b/docs/misc/miscellaneous.md @@ -0,0 +1,56 @@ +# Utilitaires et divers + +## Etiqueter un commit pour publier une version + +Commande exemple dans un terminal *git*, où `XXXXXX` est la signature (hash) du commit : + +```git +git tag -a 1.5.0 XXXXXXX -m "Mars 2020" +git push origin 1.5.0 +``` + +En cas d'erreur, il est possible de renommer une étiquette : + +```git +git tag new old +git tag -d old +git push origin :refs/tags/old +git push --tags +``` + +---- + +## Générer le modèle graphique de la base de données + +[Graph models, inclus dans la boîte à outils Django Extensions](http://django-extensions.readthedocs.io/en/latest/graph_models.html), permet de générer un graphique récapitulatif de la base de données : + +![DB Model Graph](https://raw.githubusercontent.com/Guts/elpaso/master/docs/elpaso_db_models_graph.png) + +### Dépendances + +Il s'appuie sur l'une des 2 bibliohtèques : + +* pydot - celle que nous utilisons, car bien plus légère +* pygraphviz + +```bash +sudo apt install pkg-config python-pydot graphviz graphviz-dev +``` + +Puis, dans l'environnement virtuel du projet : + +```bash +source ./virtenv/bin/activate +pip install pydot +``` + +> Note : il peut être nécessaire d'installer une version spécifique de pyparsing, une dépendance de pydot : +> `pip install pyparsing==1.5.7` + +### Génération + +Dans l'environnement virtuel du projet : + +```bash +python manage.py graph_models --pydot -a -g -o docs/elpaso_db_models_graph.png +``` diff --git a/docs/misc/resources.md b/docs/misc/resources.md new file mode 100644 index 00000000..46223036 --- /dev/null +++ b/docs/misc/resources.md @@ -0,0 +1,33 @@ +# Ressources + +## Python + +- [Alléger les GeoJSON](http://makina-corpus.com/blog/metier/2014/reduire-le-poids-dun-geojson) + +## Django + +- +- [Écriture de tests dans Django](https://docs.djangoproject.com/fr/2.2/topics/testing/overview/) +- [Articulation entre PyTest, Coverage et le lanceur de tests intégrés à Django ](https://adamj.eu/tech/2019/04/30/getting-a-django-application-to-100-percent-coverage/) + +---- + +## Déploiement + +### Heroku + +- [`app.json` et déploiement automatique](https://devcenter.heroku.com/articles/heroku-butto) + +### Serveur + +- [Django with Postgres, Nginx, and Gunicorn on Debian 8](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-debian-8#create-a-gunicorn-systemd-service-file) + +#### Git flow + +- [Deploy to remote server with Git](https://medium.com/@francoisromain/vps-deploy-with-git-fea605f1303b) + +#### Nginx + +- +- +- From 56e67801ab22e3d45978622192d14b5ccdaa0b1b Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 4 May 2020 09:08:09 +0200 Subject: [PATCH 07/59] Move info from README to docs --- README.md | 60 -------------------------------------------- docs/global/index.md | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index 44d551c7..3691246c 100644 --- a/README.md +++ b/README.md @@ -6,63 +6,3 @@ [![Documentation Status](https://readthedocs.org/projects/elgeopaso/badge/?version=latest)](https://elgeopaso.readthedocs.io/en/latest/?badge=latest) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) - ----- - -## Développement - -### Docker - -```shell -docker-compose -f "docker-compose.dev.yml" up --build -``` - -Ouvrir le site sur . - ----- - -> TO MOVE - -## Description fonctionnelle - -### Récupération à partir de GeoRezo - -1. Toutes les heures, les dernières offres publiées sont récupérées à partir du [flux RSS du forum Job de GeoRezo](https://georezo.net/extern.php?fid=10) et stockées en brut dans une table dédiée ; -2. Chaque nouvelle offre est analysée en s'appuyant sur le kit de traitement du langage naturel NLTK et des correspondances personnalisables en base de données via l'interface d'administration ; - -### Représentation des données - -Les données sont ensuite représentées dans différents modes : - -* métriques globales ; -* valeurs absolues du nombre d'offre par période ; -* valeurs proportionnelles selon le différents critères (types de contrats...) - ----- - -## Description technique - -Pour dupliquer le projet, la documentation est dans [le wiki du dépôt](https://github.com/Guts/elgeopaso/wiki). - -### Base de données - -!["El Géo Paso - Modèle graphique de la base de données"](docs/elpaso_db_models_graph.png "El Geo Paso - DB") - - *Modèle généré automatiquement par Django Extensions graph-models (pydot)* - -### Briques logicielles - -Le projet est développé en Python 3.5.x avec le framework Django et des extensions : - -* [feedparser](https://pypi.org/project/feedparser/) pour la consommation du flux RSS -* [NLTK](http://www.nltk.org/) pour l'analyse sémantique -* [DRF (Django REST Framework)](http://www.django-rest-framework.org/) et [drf-yasg](https://github.com/axnsan12/drf-yasg/) pour la mise en place de l'API REST et sa documentation automatisée -* [Django Extensions](https://github.com/django-extensions/django-extensions) pour la boîte à outils de dév Django - -Du côté de l'interface du site web, on retrouve les classiques : - -* [Bootstrap](https://getbootstrap.com/) -* [D3.js](https://d3js.org/), via la surcouche [NVD3](http://nvd3.org) -* [Django Suit](https://djangosuit.com/) pour l'habillage de l'interface d'administration - -Le site est servi sur le Web par [gunicorn](https://gunicorn.org/) et nginx ou Apache selon les plateformes (dév ou production). diff --git a/docs/global/index.md b/docs/global/index.md index b8190a68..875ead16 100644 --- a/docs/global/index.md +++ b/docs/global/index.md @@ -3,3 +3,47 @@ Documentation technique du projet El Géo Paso, statistiques dynamiques sur les offres d'emploi en géomatique publiées sur le forum francophone de géomatique [GeoRezo](https://georezo.net/forum/viewforum.php?id=10). Base de connaissances techniques sur le projet El Géo Paso. Cette base, enrichie au gré du temps disponible et de l'envie (autant dire qu'elle est incomplète), a vocation à éviter que le projet ne soit une boîte noire et à faciliter les phases de reprise du développement, celui-ci étant discontinu et irrégulier (bénévolat mon amour). + +## Description fonctionnelle + +### Récupération à partir de GeoRezo + +1. Toutes les heures, les dernières offres publiées sont récupérées à partir du [flux RSS du forum Job de GeoRezo](https://georezo.net/extern.php?fid=10) et stockées en brut dans une table dédiée ; +2. Chaque nouvelle offre est analysée en s'appuyant sur le kit de traitement du langage naturel NLTK et des correspondances personnalisables en base de données via l'interface d'administration ; + +### Représentation des données + +Les données sont ensuite représentées dans différents modes : + +* métriques globales ; +* valeurs absolues du nombre d'offre par période ; +* valeurs proportionnelles selon le différents critères (types de contrats...) + +---- + +## Description technique + +Pour dupliquer le projet, la documentation est dans [le wiki du dépôt](https://github.com/Guts/elgeopaso/wiki). + +### Base de données + +!["El Géo Paso - Modèle graphique de la base de données"](docs/elpaso_db_models_graph.png "El Geo Paso - DB") + + *Modèle généré automatiquement par Django Extensions graph-models (pydot)* + +### Briques logicielles + +Le projet est développé en Python 3.5.x avec le framework Django et des extensions : + +* [feedparser](https://pypi.org/project/feedparser/) pour la consommation du flux RSS +* [NLTK](http://www.nltk.org/) pour l'analyse sémantique +* [DRF (Django REST Framework)](http://www.django-rest-framework.org/) et [drf-yasg](https://github.com/axnsan12/drf-yasg/) pour la mise en place de l'API REST et sa documentation automatisée +* [Django Extensions](https://github.com/django-extensions/django-extensions) pour la boîte à outils de dév Django + +Du côté de l'interface du site web, on retrouve les classiques : + +* [Bootstrap](https://getbootstrap.com/) +* [D3.js](https://d3js.org/), via la surcouche [NVD3](http://nvd3.org) +* [Django Suit](https://djangosuit.com/) pour l'habillage de l'interface d'administration + +Le site est servi sur le Web par [gunicorn](https://gunicorn.org/) et nginx ou Apache selon les plateformes (dév ou production). From 6676c0443bead94c950ebd428bc2dedb75813b3d Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 4 May 2020 09:16:08 +0200 Subject: [PATCH 08/59] Use French doc for Python intersphinx --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index f96f10f1..a8568769 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -101,7 +101,7 @@ # -- intersphinx: refer to others sphinx docs intersphinx_mapping = { - "python": ("https://python.readthedocs.io/en/latest/", None), + "python": ("https://docs.python.org/fr/3/", None), "django": ("https://django.readthedocs.org/en/stable/", None), } From 1d9b879f22d127afdb402085ec10cd5833fcca3e Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 4 May 2020 09:16:41 +0200 Subject: [PATCH 09/59] Add viewsource extension --- docs/conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index a8568769..61443682 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -44,10 +44,15 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + # markdown "recommonmark", - "sphinx_copybutton", + # Sphinx included "sphinx.ext.autodoc", + "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", + # 3rd party "sphinx_autodoc_typehints", + "sphinx_copybutton", "sphinx_markdown_tables", "sphinx_rtd_theme", ] From e9888281f86918693cc9428a5853d179513dc2f6 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 4 May 2020 09:50:15 +0200 Subject: [PATCH 10/59] Add ugly button to redirect to documentation --- README.md | 8 +++++++- docs/_static/icon_doc.png | Bin 0 -> 15586 bytes 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 docs/_static/icon_doc.png diff --git a/README.md b/README.md index 3691246c..2a8b3798 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,12 @@ ![Continuous integration and deployment](https://github.com/Guts/elgeopaso/workflows/Continuous%20integration%20and%20deployment/badge.svg) [![codecov](https://codecov.io/gh/Guts/elgeopaso/branch/master/graph/badge.svg)](https://codecov.io/gh/Guts/elgeopaso) !["Python 3.7.x"](https://img.shields.io/badge/python-3.7-blue.svg) -[![Documentation Status](https://readthedocs.org/projects/elgeopaso/badge/?version=latest)](https://elgeopaso.readthedocs.io/en/latest/?badge=latest) +[![Documentation Status](https://readthedocs.org/projects/elgeopaso/badge/?version=latest)](https://elgeopaso.readthedocs.io/fr/latest/?badge=latest) [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) + +Envie d'en savoir plus ? Tout (enfin presque) est dans la documentation : + +[![](docs/_static/icon_doc.png)](http://elgeopaso.rtfd.io/) + +> Source icône : Book by Smalllike from the Noun Project diff --git a/docs/_static/icon_doc.png b/docs/_static/icon_doc.png new file mode 100644 index 0000000000000000000000000000000000000000..1b95186ba18f6af76011a224864919ad5dd34c19 GIT binary patch literal 15586 zcmZvDWmsEHv^DPT?ry;ff#UA&P~6?!A-F@47H{!l#ogVDOMw8z-JP5F-ap@uFVAyM zGMPD(lbL;H_F8-GSTz+{bQBU4C@3g&c{wQ!$oo6wSVBU8oUiOe|EqxWkdW6xg1iEe zEMp*LXb%lp38(6rKw}FMg#MsNAgzj)Be7lPYZbLlM!SgGU3HZ^;y4{s4?Nd z;fsK1!qmW;OgKpY&&RuCO*k3=0JBY?fQlY|l$94$TujpttwCPs5~u+3d*H)q;W&{9 zo2Q7|xc7B8p>(TP&FRWGh6>u%WRWs3AVK-FRwUkKS$bfS-|ZM#>Xa|3t^M_=D2C@Y zQMCdKzRf2DOSs6X3iz{R)5-wPEgGdjgE}oeJ-hlMHFIA==lS4;X$KKsq(tK9&!3!z zqG=gYAd@eJ{bgD)29?R#)s$m$$>z;WI~b5A8RhEbGWSQx$5q_rrsU#HRT%iyg}!iulJPfLy{6-8NFTU*X9JhxEDq$(N< zVMavtGc8oTS>$(_xbgjj7W5KD&9nZSO%Vqa2dO@>U%A!xO`SzV-A$-;+_C%6kQA#= ze4d?~GxKNKLAa|_3s#JX3ZdrsiwKhLdFU?tIWAs(FVEu7^`GT(v_Bliv-%8kRsWWk zBSrk1)CDm#qyG#Il^`B8JhdM&!2TItRfC%}&R+3xL}QSYB~YR5Xr-RkdGjsa?oCcf zg0azYHO@|bkT@1wWDF~S`IV$Q_-*`F4Nkmj8p`@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N#@iez%r6`{DJ3L>9;hp_4f?5+g%$CG8|jN_O={g8l9X!mQKC-Hb@;gapM7oOJN*d( zQiRy|HU`tRh><7=Hslb1G)0 z!Ix;eH%ejw?!(W$x&L+eUj?Q6&Qx%+7#@1Hpk(;vq+3-2Hb(DUe77hJGN@IYoQpqzS7)@{pnArB$SA IBuvBq2lVFd2mk;8 literal 0 HcmV?d00001 From 5f692462c4dcfbeac53e364cbbffb4504c45c46f Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 4 May 2020 09:54:30 +0200 Subject: [PATCH 11/59] Clean up --- docs/global/index.md | 2 +- docs/index.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/global/index.md b/docs/global/index.md index 875ead16..369f17e4 100644 --- a/docs/global/index.md +++ b/docs/global/index.md @@ -1,4 +1,4 @@ -# El Géo Paso - Wiki +# Introduction Documentation technique du projet El Géo Paso, statistiques dynamiques sur les offres d'emploi en géomatique publiées sur le forum francophone de géomatique [GeoRezo](https://georezo.net/forum/viewforum.php?id=10). diff --git a/docs/index.rst b/docs/index.rst index 2414afa9..e4b945d6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,8 +10,8 @@ El Géo Paso - Documentation Mise à jour : |date| -Indices and tables -================== +Raccourcis +++++++++++ * :ref:`genindex` * :ref:`modindex` From cf712dda0469464d3f8ff10b4976ed781e9f0aea Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 4 May 2020 09:58:45 +0200 Subject: [PATCH 12/59] Add raw link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a8b3798..7f1c9beb 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) -Envie d'en savoir plus ? Tout (enfin presque) est dans la documentation : +Envie d'en savoir plus ? Tout (enfin presque) est dans la documentation : -[![](docs/_static/icon_doc.png)](http://elgeopaso.rtfd.io/) +[![](docs/_static/icon_doc.png)](https://elgeopaso.rtfd.io/) > Source icône : Book by Smalllike from the Noun Project From 2196f87ba41481a2997da36fcea8e0fcb37ea98c Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 16:20:51 +0000 Subject: [PATCH 13/59] Update pytest-django requirement from ==3.8.* to ==3.9.* Updates the requirements on [pytest-django](https://github.com/pytest-dev/pytest-django) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest-django/releases) - [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst) - [Commits](https://github.com/pytest-dev/pytest-django/compare/v3.8.0...v3.9.0) Signed-off-by: dependabot-preview[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 722f8b7b..9dafd294 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -22,7 +22,7 @@ sphinx-rtd-theme==0.4.* # ---------------------- pytest==5.3.* # https://github.com/pytest-dev/pytest pytest-cov==2.8.* -pytest-django==3.8.* # https://github.com/pytest-dev/pytest-django +pytest-django==3.9.* # https://github.com/pytest-dev/pytest-django semver==2.9.* # https://github.com/python-semver/python-semver validator-collection== 1.4.* # https://github.com/insightindustry/validator-collection From 4e9df778096069e282923becdfb8e3ec00937b8b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 4 May 2020 17:43:05 +0000 Subject: [PATCH 14/59] Update beautifulsoup4 requirement from ==4.8.* to ==4.9.* Updates the requirements on [beautifulsoup4](http://www.crummy.com/software/BeautifulSoup/bs4/) to permit the latest version. Signed-off-by: dependabot-preview[bot] --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index 2a1fc97c..2e7c23d7 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -26,7 +26,7 @@ drf-yasg[validation]==1.17.* # -------------------------- argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi arrow==0.12.* -beautifulsoup4==4.8.* +beautifulsoup4==4.9.* lxml==4.5.* Pillow==7.1.* # https://github.com/python-pillow/Pillow python-dotenv==0.13.* # https://saurabh-kumar.com/python-dotenv/#django From 127aeaa32a412ac3112215c9b456286a0b3290f1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 6 May 2020 05:21:30 +0000 Subject: [PATCH 15/59] Update semver requirement from ==2.9.* to ==2.10.* Updates the requirements on [semver](https://github.com/python-semver/python-semver) to permit the latest version. - [Release notes](https://github.com/python-semver/python-semver/releases) - [Changelog](https://github.com/python-semver/python-semver/blob/master/CHANGELOG.rst) - [Commits](https://github.com/python-semver/python-semver/compare/2.9.0...2.10.0) Signed-off-by: dependabot-preview[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 9dafd294..c881fceb 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -23,7 +23,7 @@ sphinx-rtd-theme==0.4.* pytest==5.3.* # https://github.com/pytest-dev/pytest pytest-cov==2.8.* pytest-django==3.9.* # https://github.com/pytest-dev/pytest-django -semver==2.9.* # https://github.com/python-semver/python-semver +semver==2.10.* # https://github.com/python-semver/python-semver validator-collection== 1.4.* # https://github.com/insightindustry/validator-collection # Code quality From f05a46354cbf51d0f61abcfe5de03929765a3498 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 6 May 2020 08:23:10 +0000 Subject: [PATCH 16/59] Bump sphinx-markdown-tables from 0.0.12 to 0.0.14 Bumps [sphinx-markdown-tables](https://github.com/ryanfox/sphinx-markdown-tables) from 0.0.12 to 0.0.14. - [Release notes](https://github.com/ryanfox/sphinx-markdown-tables/releases) - [Commits](https://github.com/ryanfox/sphinx-markdown-tables/compare/v0.0.12...v0.0.14) Signed-off-by: dependabot-preview[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index c881fceb..f6f73299 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -15,7 +15,7 @@ recommonmark==0.6.* Sphinx==3.0.* # https://github.com/sphinx-doc/sphinx sphinx-autodoc-typehints==1.10.* sphinx-copybutton==0.2.11 -sphinx-markdown-tables==0.0.12 # to render markdown tables +sphinx-markdown-tables==0.0.14 # to render markdown tables sphinx-rtd-theme==0.4.* # Testing From f94dced224123383bea8814f5b36808b76359d98 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 6 May 2020 08:34:06 +0000 Subject: [PATCH 17/59] Update django-debug-toolbar requirement from ==2.2.* to ==2.2 Updates the requirements on [django-debug-toolbar](https://github.com/jazzband/django-debug-toolbar) to permit the latest version. - [Release notes](https://github.com/jazzband/django-debug-toolbar/releases) - [Changelog](https://github.com/jazzband/django-debug-toolbar/blob/master/docs/changes.rst) - [Commits](https://github.com/jazzband/django-debug-toolbar/compare/2.2...2.2) Signed-off-by: dependabot-preview[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index f6f73299..c3368cc3 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -36,5 +36,5 @@ pylint-django==2.0.* # https://github.com/PyCQA/pylint-django # Django # ------------------------------------------------------------------------------ -django-debug-toolbar==2.2.* # https://github.com/jazzband/django-debug-toolbar +django-debug-toolbar==2.2 # https://github.com/jazzband/django-debug-toolbar django-extensions==2.2.* # https://github.com/django-extensions/django-extensions From 07d2752919ef50e6b233a6c5dcd38d4e8e3ddc85 Mon Sep 17 00:00:00 2001 From: Julien Date: Wed, 6 May 2020 18:05:36 +0200 Subject: [PATCH 18/59] Bump sphinx copy button --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index c3368cc3..e466353c 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -14,7 +14,7 @@ Werkzeug==1.0.* # https://github.com/pallets/werkzeug recommonmark==0.6.* Sphinx==3.0.* # https://github.com/sphinx-doc/sphinx sphinx-autodoc-typehints==1.10.* -sphinx-copybutton==0.2.11 +sphinx-copybutton==0.2.* sphinx-markdown-tables==0.0.14 # to render markdown tables sphinx-rtd-theme==0.4.* From 5f5947dc493b9eb3e5c3b7f2aebda9e3563b3525 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 6 May 2020 16:12:26 +0000 Subject: [PATCH 19/59] Update pytest requirement from ==5.3.* to ==5.4.* Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/5.3.0...5.4.1) Signed-off-by: dependabot-preview[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index e466353c..3d4a5422 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -20,7 +20,7 @@ sphinx-rtd-theme==0.4.* # Testing # ---------------------- -pytest==5.3.* # https://github.com/pytest-dev/pytest +pytest==5.4.* # https://github.com/pytest-dev/pytest pytest-cov==2.8.* pytest-django==3.9.* # https://github.com/pytest-dev/pytest-django semver==2.10.* # https://github.com/python-semver/python-semver From 90652f606a85f87fb89a0d04885ef647c9ec6a92 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 7 May 2020 12:28:42 +0200 Subject: [PATCH 20/59] Backup also site information --- elgeopaso/fixtures/sites.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 elgeopaso/fixtures/sites.json diff --git a/elgeopaso/fixtures/sites.json b/elgeopaso/fixtures/sites.json new file mode 100644 index 00000000..3423a129 --- /dev/null +++ b/elgeopaso/fixtures/sites.json @@ -0,0 +1 @@ +[{"model": "sites.site", "pk": 1, "fields": {"domain": "elgeopaso.georezo.net", "name": "El G\u00e9o Paso (GeoRezo)"}}] From edcc2d1b59ca3cd13b831fad844d70f4fe26bce0 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 7 May 2020 12:28:56 +0200 Subject: [PATCH 21/59] Add site backup/restoration cmd --- docs/database/backup.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/database/backup.md b/docs/database/backup.md index 20babb35..1ef4adb2 100644 --- a/docs/database/backup.md +++ b/docs/database/backup.md @@ -72,6 +72,7 @@ python manage.py dumpdata jobs.Place jobs.PlaceVariations > elgeopaso/jobs/fixtu python manage.py dumpdata jobs.Source > elgeopaso/jobs/fixtures/sources.json python manage.py dumpdata jobs.Technology jobs.TechnologyVariations > elgeopaso/jobs/fixtures/technos.json python manage.py dumpdata --exclude auth.permission --exclude contenttypes cms.Article cms.Category > elgeopaso/cms/fixtures/content.json +python manage.py dumpdata sites > elgeopaso/fixtures/sites.json ``` #### Restaurer @@ -83,4 +84,5 @@ python manage.py loaddata elgeopaso/jobs/fixtures/places.json python manage.py loaddata elgeopaso/jobs/fixtures/sources.json python manage.py loaddata elgeopaso/jobs/fixtures/technos.json python manage.py loaddata elgeopaso/cms/fixtures/content.json +python manage.py loaddata elgeopaso/fixtures/sites.json ``` From 4ad8069f6f16dc34ed3a19206000fe9884bcac61 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 7 May 2020 12:30:20 +0200 Subject: [PATCH 22/59] Load site fixture during deployment --- .deploy/release-tasks.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.deploy/release-tasks.sh b/.deploy/release-tasks.sh index 54431013..c0ce5472 100644 --- a/.deploy/release-tasks.sh +++ b/.deploy/release-tasks.sh @@ -4,6 +4,7 @@ python manage.py migrate # load fixtures +python manage.py loaddata ./elgeopaso/fixtures/sites.json python manage.py loaddata ./elgeopaso/jobs/fixtures/contracts.json python manage.py loaddata ./elgeopaso/jobs/fixtures/jobs.json python manage.py loaddata ./elgeopaso/jobs/fixtures/places.json From a2b322ecf290d2dae83784b98c575b9e6a6ada85 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 May 2020 08:56:45 +0200 Subject: [PATCH 23/59] Update flake8 requirement from ==3.7.* to ==3.8.* (#75) Updates the requirements on [flake8](https://gitlab.com/pycqa/flake8) to permit the latest version. - [Release notes](https://gitlab.com/pycqa/flake8/tags) - [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.0...3.8.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 3d4a5422..7aeb1004 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -30,7 +30,7 @@ validator-collection== 1.4.* # https://github.com/insightindustry/validator-c # ---------------------- black==19.10b0 # https://github.com/ambv/black django-coverage-plugin==1.8.* # https://github.com/nedbat/django_coverage_plugin -flake8==3.7.* # https://github.com/PyCQA/flake8 +flake8==3.8.* # https://github.com/PyCQA/flake8 pre-commit==2.3.* # https://github.com/pre-commit/pre-commit pylint-django==2.0.* # https://github.com/PyCQA/pylint-django From 75ea36ab02a59147af36aaf42711db68379fcd73 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 May 2020 09:16:35 +0200 Subject: [PATCH 24/59] Bump argon2-cffi from 19.2.0 to 20.1.0 (#76) Bumps [argon2-cffi](https://github.com/hynek/argon2-cffi) from 19.2.0 to 20.1.0. - [Release notes](https://github.com/hynek/argon2-cffi/releases) - [Changelog](https://github.com/hynek/argon2-cffi/blob/master/CHANGELOG.rst) - [Commits](https://github.com/hynek/argon2-cffi/compare/19.2.0...20.1.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index 2e7c23d7..2a50e519 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -24,7 +24,7 @@ drf-yasg[validation]==1.17.* # Utils # -------------------------- -argon2-cffi==19.2.0 # https://github.com/hynek/argon2_cffi +argon2-cffi==20.1.0 # https://github.com/hynek/argon2_cffi arrow==0.12.* beautifulsoup4==4.9.* lxml==4.5.* From 280638ff8c380b11ce6281e2a032aefa271d6116 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 18 May 2020 09:22:49 +0200 Subject: [PATCH 25/59] Update pre-commit requirement from ==2.3.* to ==2.4.* (#77) Updates the requirements on [pre-commit](https://github.com/pre-commit/pre-commit) to permit the latest version. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v2.3.0...v2.4.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 7aeb1004..a3f6579e 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -31,7 +31,7 @@ validator-collection== 1.4.* # https://github.com/insightindustry/validator-c black==19.10b0 # https://github.com/ambv/black django-coverage-plugin==1.8.* # https://github.com/nedbat/django_coverage_plugin flake8==3.8.* # https://github.com/PyCQA/flake8 -pre-commit==2.3.* # https://github.com/pre-commit/pre-commit +pre-commit==2.4.* # https://github.com/pre-commit/pre-commit pylint-django==2.0.* # https://github.com/PyCQA/pylint-django # Django From 2dc43fcd894527d3fbc5fc54ce63a545a0d6617d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 12:03:47 +0200 Subject: [PATCH 26/59] Update django-allauth requirement from ==0.41.* to ==0.42.* (#78) Updates the requirements on [django-allauth](https://github.com/pennersr/django-allauth) to permit the latest version. - [Release notes](https://github.com/pennersr/django-allauth/releases) - [Changelog](https://github.com/pennersr/django-allauth/blob/master/ChangeLog.rst) - [Commits](https://github.com/pennersr/django-allauth/compare/0.41.0...0.42.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index 2a50e519..b02b9107 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -9,7 +9,7 @@ wheel # Django # ----------------------- django==2.2.* # pyup: < 3.0 -django-allauth==0.41.* # https://django-allauth.readthedocs.io +django-allauth==0.42.* # https://django-allauth.readthedocs.io django-crispy-forms==1.9.* # https://django-crispy-forms.readthedocs.io django-ckeditor==5.9.* django-filter==2.2.* From 661f7d6800df22fcdd9184b76334012a115c4d4f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 13:00:47 +0200 Subject: [PATCH 27/59] Update whitenoise[brotli] requirement from ==5.0.* to ==5.1.* (#79) Updates the requirements on [whitenoise[brotli]](https://github.com/evansd/whitenoise) to permit the latest version. - [Release notes](https://github.com/evansd/whitenoise/releases) - [Changelog](https://github.com/evansd/whitenoise/blob/master/docs/changelog.rst) - [Commits](https://github.com/evansd/whitenoise/compare/v5.0...v5.1.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index b02b9107..59ceaa90 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -14,7 +14,7 @@ django-crispy-forms==1.9.* # https://django-crispy-forms.readthedocs.io django-ckeditor==5.9.* django-filter==2.2.* django-widgets-improved==1.5.* -whitenoise[brotli]==5.0.* # https://github.com/evansd/whitenoise +whitenoise[brotli]==5.1.* # https://github.com/evansd/whitenoise # Django REST Framework (DRF) # -------------------------- From 472e0992cbd350f3c4980c7bb82fd98d0408fc36 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 26 May 2020 10:13:32 +0200 Subject: [PATCH 28/59] Update pytest-cov requirement from ==2.8.* to ==2.9.* (#80) Updates the requirements on [pytest-cov](https://github.com/pytest-dev/pytest-cov) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest-cov/releases) - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.8.0...v2.9.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index a3f6579e..7fee9c4d 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -21,7 +21,7 @@ sphinx-rtd-theme==0.4.* # Testing # ---------------------- pytest==5.4.* # https://github.com/pytest-dev/pytest -pytest-cov==2.8.* +pytest-cov==2.9.* pytest-django==3.9.* # https://github.com/pytest-dev/pytest-django semver==2.10.* # https://github.com/python-semver/python-semver validator-collection== 1.4.* # https://github.com/insightindustry/validator-collection From e0434fb2a33bd48ccba96d51d1dadd00f13f06cf Mon Sep 17 00:00:00 2001 From: Julien Date: Fri, 12 Jun 2020 19:11:28 +0200 Subject: [PATCH 29/59] typo --- docs/deployment/server_apache.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deployment/server_apache.md b/docs/deployment/server_apache.md index dcbecafd..bde5f734 100644 --- a/docs/deployment/server_apache.md +++ b/docs/deployment/server_apache.md @@ -3,7 +3,7 @@ Pour servir l'application avec Apache, retenir ces quelques points de vigilance : - par défaut, Apache ne support pas [WSGI](https://wsgi.readthedocs.io/en/latest/what.html). Il faut donc utiliser le module `mod_wsgi` pour Apache. -- par défaut sur Ubuntu 16.04, ce module est compilé ave Python 3.5. **Or, il faut utiliser la version compilée avec la même version de Python que celle utilisée par l'application**. +- par défaut sur Ubuntu 18.04, ce module est compilé ave Python 3.6. **Or, il faut utiliser la version compilée avec la même version de Python que celle utilisée par l'application**. ## Prérequis @@ -106,7 +106,7 @@ sudo add-apt-repository ppa:certbot/certbot sudo apt update # installer le certbot -sudo apt-get install certbot python-certbot-apache +sudo apt-get install certbot python3-certbot-apache # lancer le processus en choisiasant elgeopaso.georezo.net sudo certbot --apache From f8ce77230f482f36290591214a10825469165f05 Mon Sep 17 00:00:00 2001 From: Julien Date: Fri, 12 Jun 2020 19:39:38 +0200 Subject: [PATCH 30/59] Minor changes --- docs/deployment/production.md | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/docs/deployment/production.md b/docs/deployment/production.md index b17ee76c..1fd900c5 100644 --- a/docs/deployment/production.md +++ b/docs/deployment/production.md @@ -1,11 +1,36 @@ -# Deployment +# Déploiement -## Ubuntu Server 16.04 +## Configuration du système -### OS setup +> Ce guide se base sur Ubuntu Server 18.04 + +Avant, tout mettre à jour la liste des paquets + +```bash +sudo apt update +``` + +### Installer Python + +```bash +sudo apt install software-properties-common +sudo add-apt-repository ppa:deadsnakes/ppa +sudo apt update +sudo apt install python3.7 +``` + +### Installer git ```bash -# dependencies +sudo add-apt-repository ppa:git-core/ppa +sudo apt update +sudo apt install git +``` + + +### Dépendances + +``` sudo apt install curl build-essential python3-software-properties python3-venv python3-dev python3-pip python-software-properties python-dev python-pip libsqlite3-dev sqlite3 bzip2 libbz2-dev gunicorn nginx git build-essential tcl curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash sudo apt install git-lfs From afa059c8ba8740686a723ba45bc39f2e7393dbca Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 15 Jun 2020 10:47:54 +0200 Subject: [PATCH 31/59] Update docs (#83) * Revamp configurations steps * Rename * Use elgeopaso instead of elpaso * Bump pre-commit hooks * Add python3 alias switch * Remove deprecated docs * Minor fixes --- .deploy/apache/elgeopaso.conf | 7 +- .pre-commit-config.yaml | 2 +- .../{server_apache.md => apache.md} | 3 +- docs/deployment/git_flow.md | 4 +- docs/deployment/production.md | 316 ++---------------- docs/index.rst | 2 +- requirements/local.txt | 4 +- 7 files changed, 37 insertions(+), 301 deletions(-) rename docs/deployment/{server_apache.md => apache.md} (98%) diff --git a/.deploy/apache/elgeopaso.conf b/.deploy/apache/elgeopaso.conf index 2cf7ad72..33a3e891 100644 --- a/.deploy/apache/elgeopaso.conf +++ b/.deploy/apache/elgeopaso.conf @@ -1,12 +1,11 @@ - ServerAdmin webmaster@georezo.net + ServerAdmin elpaso@georezo.net ServerName geotribu.georezo.net ServerAlias elgeopaso.georezo.net - ServerAlias elgeopaso.fr Redirect permanent / https://elgeopaso.georezo.net/ - ErrorLog /var/log/apache2/elpaso_error.log + ErrorLog /var/log/apache2/elgeopaso_error.log LogLevel warn - CustomLog /var/log/apache2/elpaso_access.log combined + CustomLog /var/log/apache2/elgeopaso_access.log combined diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14de1fca..56fb1f3f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ exclude: "node_modules|migrations|.venv|tests/dev/|tests/fixtures/" fail_fast: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.5.0 + rev: v3.1.0 hooks: - id: check-added-large-files args: ['--maxkb=500'] diff --git a/docs/deployment/server_apache.md b/docs/deployment/apache.md similarity index 98% rename from docs/deployment/server_apache.md rename to docs/deployment/apache.md index bde5f734..cab8eb16 100644 --- a/docs/deployment/server_apache.md +++ b/docs/deployment/apache.md @@ -91,7 +91,7 @@ sudo service apache2 restart ### 4. Générer le certificat SSL avec Let's Encrypt -Il s'agit principalement de la reproduction de la doc officielle : . +Il s'agit principalement de la reproduction de la doc officielle : . ```sh # travailler dans home @@ -134,7 +134,6 @@ apache2ctl -M ``` - ---- ## Resources diff --git a/docs/deployment/git_flow.md b/docs/deployment/git_flow.md index 7f0657f1..da134116 100644 --- a/docs/deployment/git_flow.md +++ b/docs/deployment/git_flow.md @@ -30,9 +30,9 @@ Le projet s'appuie sur l'intégration d'Heroku avec Github pour déployer des ve 3. Une fois les changements achevés et validés, ils sont fusionnés dans la branche principale (*merged*) qui est automatiquement déployée sur Heroku : -4. Lorsqu'une nouvelle version est finalisée, un [numéro de version](product_life.md) est ajouté via un `git tag`. +4. Lorsqu'une nouvelle version est finalisée, un [numéro de version](../global/product_life.md) est ajouté via un `git tag`. -> Pour comprendre l'étiquetage des commits, voir ou [Divers - Utilitaires](miscellaneous.md). +> Pour comprendre l'étiquetage des commits, voir ou [Divers - Utilitaires](../misc/miscellaneous.md). ---- diff --git a/docs/deployment/production.md b/docs/deployment/production.md index 1fd900c5..0cf8ac7d 100644 --- a/docs/deployment/production.md +++ b/docs/deployment/production.md @@ -1,8 +1,8 @@ # Déploiement -## Configuration du système +> Ce guide se base sur Ubuntu Server 18.04 (Bionic) -> Ce guide se base sur Ubuntu Server 18.04 +## Dépendances Avant, tout mettre à jour la liste des paquets @@ -10,316 +10,54 @@ Avant, tout mettre à jour la liste des paquets sudo apt update ``` -### Installer Python +### Installer Python 3.7 -```bash -sudo apt install software-properties-common -sudo add-apt-repository ppa:deadsnakes/ppa -sudo apt update -sudo apt install python3.7 -``` +Par défaut c'est Python 3.6 qui est livré avec Ubuntu 18.04 Bionic. Il nous faut donc : -### Installer git +- installer Python 3.7 +- le définir comme version par défaut lorsque l'on tape `python3` ```bash -sudo add-apt-repository ppa:git-core/ppa +# ajouter le dépôt dans lequel trouver Python 3.7 +sudo apt install software-properties-common +sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update -sudo apt install git -``` - - -### Dépendances - +sudo apt install python3.7 python3-pip ``` -sudo apt install curl build-essential python3-software-properties python3-venv python3-dev python3-pip python-software-properties python-dev python-pip libsqlite3-dev sqlite3 bzip2 libbz2-dev gunicorn nginx git build-essential tcl -curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash -sudo apt install git-lfs - -pip3 install --upgrade pip -pip3 install virtualenv --upgrade - -# web app directory -mkdir -p /webapps/elpaso -# clone repository -cd /webapps/elpaso -git clone https://github.com/Guts/elpaso.git . -mkdir tmp -# COPY secrets.ini inside folder - -# groups and users -sudo groupadd --system webapps -sudo useradd --system --gid webapps --shell /bin/bash --home /webapps/elpaso elpacha -sudo usermod -a -G "www-data" elpacha -sudo chown -R elpacha:www-data /webapps/elpaso/ -sudo chmod -R g+w /webapps/elpaso - -# virtualenv -pvernier@datamadre:/webapps/elpaso$ sudo su - elpacha -pyvenv virtenv -source ./virtenv/bin/activate -pip install --upgrade pip -pip install -r requirements.txt -deactivate - -# back to main user -exit - -# open directory to other users -sudo chown -R elpacha:www-data /webapps/elpaso -sudo chgrp -R www-data /webapps/elpaso -sudo chmod -R 770 /webapps/elpaso/ -sudo usermod -a -G "webapps" geoj -sudo usermod -a -G "webapps" pvernier -sudo usermod -a -G "www-data" geoj -sudo usermod -a -G "www-data" pvernier -``` - ----- -### Gunicorn setup (HTTP server) +#### Personnaliser bash -#### Manual serve +Configurer `bash` pour faire correspondre `python3` à Python 3.7 : ```bash -# back into the virtualenv as elpacha -cd /webapps/elpaso -elpacha@datamadre:~$ source virtenv/bin/activate -# Check manual serving -(virtenv) elpacha@datamadre:~$ gunicorn elpaso.wsgi:application --bind elgeopaso.fr:8443 --log-level debug +nano ~/.bashrc ``` -#### Set gunicorn start parameters - -Edit/Create the file: +Ajouter les lignes en fin de fichier : -```bash -nano -c /webapps/elpaso/bin/gunicorn_start +```config +# Custom python3 alias +alias python='/usr/bin/python3.7' ``` -Insert something like this: +Charger la configuration : ```bash -#!/bin/bash - -NAME="ElPaso_app" # Name of the application -DJANGODIR=/webapps/elpaso/ # Django project directory -SOCKFILE=/webapps/elpaso/run/gunicorn.sock # we will communicte using this unix soc$ -USER=elpacha # the user to run as -GROUP=www-data # the group to run as -NUM_WORKERS=3 # how many worker processes should Gunic$ -DJANGO_SETTINGS_MODULE=elpaso.settings # which settings file should Django use -DJANGO_WSGI_MODULE=elpaso.wsgi # WSGI module name - -echo "Starting $NAME as `whoami`" - -# Activate the virtual env -cd $DJANGODIR -source /webapps/elpaso/virtenv/bin/activate -export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE -export PYTHONPATH=$DJANGODIR:$PYTHONPATH +. ~/.bashrc +``` -# Create the run directory if it doesn't exist -RUNDIR=$(dirname $SOCKFILE) -test -d $RUNDIR || mkdir -p $RUNDIR +### Installer git -# Start your Django Unicorn -exec /webapps/elpaso/virtenv/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \ - --name $NAME \ - --workers $NUM_WORKERS \ - --user=$USER \ - --log-level=debug \ - --log-file=/webapps/elpaso/logs/gunicorn.log \ - --bind=unix:$SOCKFILE -# --bind=163.172.12.190:8443 -# --bind=elgeopaso.fr:8000 -``` +On a besoin d'utiliser les versions récentes de `git`. ```bash -sudo chmod u+x /webapps/elpaso/bin/gunicorn_start +sudo add-apt-repository ppa:git-core/ppa +sudo apt update +sudo apt install git ``` -#### Set gunicorn as a systemd service - -See: [Digital Ocean tutorial](https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-debian-8#create-a-gunicorn-systemd-service-file) - -1. Edit/Create the file: - - ```bash - sudo nano /etc/systemd/system/gunicorn.service - ``` - -2. Insert something like this: - - ```ini - [Unit] - Description=gunicorn daemon - After=network.target - - [Service] - User=elpacha - Group=www-data - WorkingDirectory=/webapps/elpaso - ExecStart=/webapps/elpaso/bin/gunicorn_start - - [Install] - WantedBy=multi-user.target - ``` - -3. Validate, start and reference (symlink) - - ```bash - sudo systemctl start gunicorn - sudo systemctl daemon-reload - sudo systemctl enable gunicorn - sudo systemctl restart gunicorn - ``` - -4. Check the status - - ```bash - sudo systemctl status gunicorn - ``` - - Output expected: - - ```bash - ● gunicorn.service - gunicorn daemon - Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled) - Active: active (running) since Tue 2017-01-10 23:10:37 CET; 26s ago - Main PID: 7558 (gunicorn: maste) - CGroup: /system.slice/gunicorn.service - ├─7558 gunicorn: master [elpaso.wsgi:application] - ├─7570 gunicorn: worker [elpaso.wsgi:application] - ├─7571 gunicorn: worker [elpaso.wsgi:application] - └─7572 gunicorn: worker [elpaso.wsgi:application] - - Jan 10 23:10:37 datamadre systemd[1]: Started gunicorn daemon. - Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7558] [INFO] Starting gunicorn 19.6.0 - Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7558] [INFO] Listening at: unix:/webapps/elpaso/run/gunicorn.sock (7558) - Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7558] [INFO] Using worker: sync - Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7570] [INFO] Booting worker with pid: 7570 - Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7571] [INFO] Booting worker with pid: 7571 - Jan 10 23:10:38 datamadre gunicorn[7558]: [2017-01-10 23:10:38 +0100] [7572] [INFO] Booting worker with pid: 7572 - ``` - ---- -### nginx setup (reverse proxy) - -#### Remove default site - -1. Edit nginx configuration - - ```bash - sudo nano -c /etc/nginx/nginx.conf - ``` - -2. Comment this line: - - ```ini - # include /etc/nginx/conf.d/*.conf; - ``` - -#### Add webapp configuration file - -1. Edit file - - ```bash - sudo nano -c /etc/nginx/sites-available/elpaso - ``` - -2. Insert something like this: - - ```nginx - server { - listen 80; - server_name 163.172.42.190; - rewrite ^(.*) http://elgeopaso.fr$1 permanent; - } - - - server { - listen 80; - server_name www.elgeopaso.fr; - rewrite ^(.*) http://elgeopaso.fr$1 permanent; - } - - - server { - listen 80; - server_name elgeopaso.fr; - - location = /favicon.ico { access_log off; log_not_found off; } - location /static/ { - root /webapps/elpaso; - } - - client_max_body_size 4G; - access_log /webapps/elpaso/logs/nginx.access.log; - error_log /webapps/elpaso/logs/nginx.error.log; - - location / { - include proxy_params; - # proxy_pass http://163.172.42.190:8443; # Pass to Gunicorn - proxy_pass http://unix:/webapps/elpaso/run/gunicorn.sock; - proxy_set_header X-Real-IP $remote_addr; # get real Client IP - proxy_redirect off; - } - } - ``` +## Configurer un serveur web -3. Validate, symlink and start - - ```bash - sudo ln -s /etc/nginx/sites-available/elpaso /etc/nginx/sites-enabled/elpaso - sudo service nginx restart - ``` - ----- - -### Option : supervisor - -1. Install - - ```bash - sudo apt install supervisor - ``` - -2. Edit/create the supervisor file - - ```bash - sudo nano -c /etc/supervisor/conf.d/elpaso.conf - ``` - -3. Insert something like this: - - ```ini - [program:elpaso] - command = /webapps/elpaso/bin/gunicorn_start ; Command to start app - user = elpacha ; User to run as - stdout_logfile = /webapps/elpaso/logs/gunicorn_supervisor.log ; Where to write log messages - redirect_stderr = true ; Save stderr in the same log - environment=LANG=fr_FR.UTF-8,LC_ALL=fr_FR.UTF-8 ; Set UTF-8 as default encoding - ``` - -4. Validate, update and start - - ```bash - sudo supervisorctl reread - sudo supervisorctl update - sudo supervisorctl status elpaso - ``` - ----- - -## Launch analisis - -```python -python manage.py rss2db -``` - -## SSL - Let's Encrypt - -```bash -sudo certbot certonly --nginx -w /webapps/elpaso -d elgeopaso.fr -d www.elgeopaso.fr -``` +- [servir avec Apache](apache) diff --git a/docs/index.rst b/docs/index.rst index e4b945d6..68816d42 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -42,7 +42,7 @@ Raccourcis deployment/preproduction deployment/production deployment/git_flow - deployment/server_apache + deployment/apache deployment/scheduled_tasks .. toctree:: diff --git a/requirements/local.txt b/requirements/local.txt index 7fee9c4d..773a03a2 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -12,7 +12,7 @@ Werkzeug==1.0.* # https://github.com/pallets/werkzeug # Documentation # ----------------------- recommonmark==0.6.* -Sphinx==3.0.* # https://github.com/sphinx-doc/sphinx +Sphinx==3.1.* # https://github.com/sphinx-doc/sphinx sphinx-autodoc-typehints==1.10.* sphinx-copybutton==0.2.* sphinx-markdown-tables==0.0.14 # to render markdown tables @@ -31,7 +31,7 @@ validator-collection== 1.4.* # https://github.com/insightindustry/validator-c black==19.10b0 # https://github.com/ambv/black django-coverage-plugin==1.8.* # https://github.com/nedbat/django_coverage_plugin flake8==3.8.* # https://github.com/PyCQA/flake8 -pre-commit==2.4.* # https://github.com/pre-commit/pre-commit +pre-commit==2.5.* # https://github.com/pre-commit/pre-commit pylint-django==2.0.* # https://github.com/PyCQA/pylint-django # Django From 91a73b172b0b1491e2a0e152a78fe2d088fc6b8e Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 15 Jun 2020 10:51:41 +0200 Subject: [PATCH 32/59] typo --- docs/deployment/apache.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment/apache.md b/docs/deployment/apache.md index cab8eb16..14d886c9 100644 --- a/docs/deployment/apache.md +++ b/docs/deployment/apache.md @@ -11,7 +11,7 @@ Pour servir l'application avec Apache, retenir ces quelques points de vigilance # add repo with latest Apache version sudo add-apt-repository ppa:ondrej/apache2 # install apache and dependencies -sudo apt install apache2 apache2-dev broli +sudo apt install apache2 apache2-dev brotli ``` ## Déployer l'application Django avec le module Apache WSGI From c993e8acb73c8e0798764081c1889db2069fa51f Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 15 Jun 2020 11:19:57 +0200 Subject: [PATCH 33/59] Update apache.md --- docs/deployment/apache.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/deployment/apache.md b/docs/deployment/apache.md index 14d886c9..c0738086 100644 --- a/docs/deployment/apache.md +++ b/docs/deployment/apache.md @@ -12,6 +12,8 @@ Pour servir l'application avec Apache, retenir ces quelques points de vigilance sudo add-apt-repository ppa:ondrej/apache2 # install apache and dependencies sudo apt install apache2 apache2-dev brotli +# enable brotli module +sudo a2enmod brotli ``` ## Déployer l'application Django avec le module Apache WSGI From e13ae0d839b408daca6dbc9204824cef78a45239 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2020 19:07:24 +0200 Subject: [PATCH 34/59] Update pytest-cov requirement from ==2.9.* to ==2.10.* (#86) Updates the requirements on [pytest-cov](https://github.com/pytest-dev/pytest-cov) to permit the latest version. - [Release notes](https://github.com/pytest-dev/pytest-cov/releases) - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.9.0...v2.10.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Julien --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 773a03a2..647cc45f 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -21,7 +21,7 @@ sphinx-rtd-theme==0.4.* # Testing # ---------------------- pytest==5.4.* # https://github.com/pytest-dev/pytest -pytest-cov==2.9.* +pytest-cov==2.10.* pytest-django==3.9.* # https://github.com/pytest-dev/pytest-django semver==2.10.* # https://github.com/python-semver/python-semver validator-collection== 1.4.* # https://github.com/insightindustry/validator-collection From 009a84ab0cde6a15c8465a2eff05174657a44786 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2020 19:18:56 +0200 Subject: [PATCH 35/59] Update django-filter requirement from ==2.2.* to ==2.3.* (#82) Updates the requirements on [django-filter](https://github.com/carltongibson/django-filter) to permit the latest version. - [Release notes](https://github.com/carltongibson/django-filter/releases) - [Changelog](https://github.com/carltongibson/django-filter/blob/master/CHANGES.rst) - [Commits](https://github.com/carltongibson/django-filter/compare/2.2.0...2.3.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Julien --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index 59ceaa90..45f3f8f1 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -12,7 +12,7 @@ django==2.2.* # pyup: < 3.0 django-allauth==0.42.* # https://django-allauth.readthedocs.io django-crispy-forms==1.9.* # https://django-crispy-forms.readthedocs.io django-ckeditor==5.9.* -django-filter==2.2.* +django-filter==2.3.* django-widgets-improved==1.5.* whitenoise[brotli]==5.1.* # https://github.com/evansd/whitenoise From ab99d2b6085e62a218fddc7dce6a8e293a25288a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2020 02:42:25 +0000 Subject: [PATCH 36/59] Update sphinx-rtd-theme requirement from ==0.4.* to ==0.5.* Updates the requirements on [sphinx-rtd-theme](https://github.com/rtfd/sphinx_rtd_theme) to permit the latest version. - [Release notes](https://github.com/rtfd/sphinx_rtd_theme/releases) - [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst) - [Commits](https://github.com/rtfd/sphinx_rtd_theme/compare/0.4.0...0.5.0) Signed-off-by: dependabot-preview[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 647cc45f..eeab2e22 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -16,7 +16,7 @@ Sphinx==3.1.* # https://github.com/sphinx-doc/sphinx sphinx-autodoc-typehints==1.10.* sphinx-copybutton==0.2.* sphinx-markdown-tables==0.0.14 # to render markdown tables -sphinx-rtd-theme==0.4.* +sphinx-rtd-theme==0.5.* # Testing # ---------------------- From 943ab852033036bfd43be83fbb527e43a9d22c26 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2020 07:36:18 +0000 Subject: [PATCH 37/59] Update sphinx-autodoc-typehints requirement from ==1.10.* to ==1.11.* Updates the requirements on [sphinx-autodoc-typehints](https://github.com/agronholm/sphinx-autodoc-typehints) to permit the latest version. - [Release notes](https://github.com/agronholm/sphinx-autodoc-typehints/releases) - [Changelog](https://github.com/agronholm/sphinx-autodoc-typehints/blob/master/CHANGELOG.rst) - [Commits](https://github.com/agronholm/sphinx-autodoc-typehints/compare/1.10.0...1.11.0) Signed-off-by: dependabot-preview[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index eeab2e22..18c4b183 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -13,7 +13,7 @@ Werkzeug==1.0.* # https://github.com/pallets/werkzeug # ----------------------- recommonmark==0.6.* Sphinx==3.1.* # https://github.com/sphinx-doc/sphinx -sphinx-autodoc-typehints==1.10.* +sphinx-autodoc-typehints==1.11.* sphinx-copybutton==0.2.* sphinx-markdown-tables==0.0.14 # to render markdown tables sphinx-rtd-theme==0.5.* From cc9d50ca5bfad76f30a7d5702b7c4f399fc4fb22 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2020 07:39:24 +0000 Subject: [PATCH 38/59] Bump sphinx-markdown-tables from 0.0.14 to 0.0.15 Bumps [sphinx-markdown-tables](https://github.com/ryanfox/sphinx-markdown-tables) from 0.0.14 to 0.0.15. - [Release notes](https://github.com/ryanfox/sphinx-markdown-tables/releases) - [Commits](https://github.com/ryanfox/sphinx-markdown-tables/compare/v0.0.14...v0.0.15) Signed-off-by: dependabot-preview[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 18c4b183..afc4c457 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -15,7 +15,7 @@ recommonmark==0.6.* Sphinx==3.1.* # https://github.com/sphinx-doc/sphinx sphinx-autodoc-typehints==1.11.* sphinx-copybutton==0.2.* -sphinx-markdown-tables==0.0.14 # to render markdown tables +sphinx-markdown-tables==0.0.15 # to render markdown tables sphinx-rtd-theme==0.5.* # Testing From a3b8a703208a3ae432823e6f7b7380aaad1769e9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2020 07:43:43 +0000 Subject: [PATCH 39/59] Update pillow requirement from ==7.1.* to ==7.2.* Updates the requirements on [pillow](https://github.com/python-pillow/Pillow) to permit the latest version. - [Release notes](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/blob/master/CHANGES.rst) - [Commits](https://github.com/python-pillow/Pillow/compare/7.1.0...7.2.0) Signed-off-by: dependabot-preview[bot] --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index 45f3f8f1..0d75a3b6 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -28,7 +28,7 @@ argon2-cffi==20.1.0 # https://github.com/hynek/argon2_cffi arrow==0.12.* beautifulsoup4==4.9.* lxml==4.5.* -Pillow==7.1.* # https://github.com/python-pillow/Pillow +Pillow==7.2.* # https://github.com/python-pillow/Pillow python-dotenv==0.13.* # https://saurabh-kumar.com/python-dotenv/#django pytz==2020.1 # https://github.com/stub42/pytz From e91c32bd63058ec7c75c15dfcf6f8f28f61c2ffb Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2020 02:41:51 +0000 Subject: [PATCH 40/59] Update pre-commit requirement from ==2.5.* to ==2.7.* Updates the requirements on [pre-commit](https://github.com/pre-commit/pre-commit) to permit the latest version. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v2.5.0...v2.7.1) Signed-off-by: dependabot-preview[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index afc4c457..c757ce64 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -31,7 +31,7 @@ validator-collection== 1.4.* # https://github.com/insightindustry/validator-c black==19.10b0 # https://github.com/ambv/black django-coverage-plugin==1.8.* # https://github.com/nedbat/django_coverage_plugin flake8==3.8.* # https://github.com/PyCQA/flake8 -pre-commit==2.5.* # https://github.com/pre-commit/pre-commit +pre-commit==2.7.* # https://github.com/pre-commit/pre-commit pylint-django==2.0.* # https://github.com/PyCQA/pylint-django # Django From f8cc91615a0d97629f096b9b086e48c45452f728 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 22 Oct 2020 15:29:18 +0200 Subject: [PATCH 41/59] Bump pre-commit hooks --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56fb1f3f..503b4f3f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ exclude: "node_modules|migrations|.venv|tests/dev/|tests/fixtures/" fail_fast: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.1.0 + rev: v3.3.0 hooks: - id: check-added-large-files args: ['--maxkb=500'] @@ -18,7 +18,7 @@ repos: args: [--markdown-linebreak-ext=md] - repo: https://github.com/python/black - rev: 19.10b0 + rev: 20.8b1 hooks: - id: black exclude_types: [directory,] From c930be79a74509a3aa7add85ee53e9bc108ecf27 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2020 13:31:59 +0000 Subject: [PATCH 42/59] Create Dependabot config file --- .github/dependabot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..a3f2eb2f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: +- package-ecosystem: pip + directory: "/requirements" + schedule: + interval: weekly + time: "04:00" + timezone: Europe/Paris + reviewers: + - Guts + labels: + - dependencies From 4f13facfc04a690f6536682352f863ac30f16ae8 Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 22 Oct 2020 15:39:21 +0200 Subject: [PATCH 43/59] Include others requirements --- .github/dependabot.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a3f2eb2f..c043e240 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,25 @@ version: 2 updates: +- package-ecosystem: pip + directory: "/" + schedule: + interval: weekly + time: "04:00" + timezone: Europe/Paris + reviewers: + - Guts + labels: + - dependencies +- package-ecosystem: pip + directory: ".deploy/apache/" + schedule: + interval: monthly + time: "04:00" + timezone: Europe/Paris + reviewers: + - Guts + labels: + - dependencies - package-ecosystem: pip directory: "/requirements" schedule: From b7354e496e85d5266265c67826023c389d591eaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2020 16:20:22 +0200 Subject: [PATCH 44/59] Update python-dotenv requirement in /requirements (#103) Updates the requirements on [python-dotenv](https://github.com/theskumar/python-dotenv) to permit the latest version. - [Release notes](https://github.com/theskumar/python-dotenv/releases) - [Changelog](https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md) - [Commits](https://github.com/theskumar/python-dotenv/compare/v0.13.0...v0.14.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Julien --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index 0d75a3b6..552719d0 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -29,7 +29,7 @@ arrow==0.12.* beautifulsoup4==4.9.* lxml==4.5.* Pillow==7.2.* # https://github.com/python-pillow/Pillow -python-dotenv==0.13.* # https://saurabh-kumar.com/python-dotenv/#django +python-dotenv==0.14.* # https://saurabh-kumar.com/python-dotenv/#django pytz==2020.1 # https://github.com/stub42/pytz # Database From 039fffcf0682de20788d16528aa920663d3a5bee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Oct 2020 14:21:52 +0000 Subject: [PATCH 45/59] Update sphinx-copybutton requirement from ==0.2.* to ==0.3.* Updates the requirements on [sphinx-copybutton](https://github.com/ExecutableBookProject/sphinx-copybutton) to permit the latest version. - [Release notes](https://github.com/ExecutableBookProject/sphinx-copybutton/releases) - [Changelog](https://github.com/executablebooks/sphinx-copybutton/blob/master/CHANGELOG.md) - [Commits](https://github.com/ExecutableBookProject/sphinx-copybutton/compare/0.2.8...v0.3.0) Signed-off-by: dependabot[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index c757ce64..b4294c69 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -14,7 +14,7 @@ Werkzeug==1.0.* # https://github.com/pallets/werkzeug recommonmark==0.6.* Sphinx==3.1.* # https://github.com/sphinx-doc/sphinx sphinx-autodoc-typehints==1.11.* -sphinx-copybutton==0.2.* +sphinx-copybutton==0.3.* sphinx-markdown-tables==0.0.15 # to render markdown tables sphinx-rtd-theme==0.5.* From 457779b92ba7e5beffb09804e1c7cd05109af097 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Oct 2020 03:18:45 +0000 Subject: [PATCH 46/59] Update drf-yasg[validation] requirement from ==1.17.* to ==1.20.* Updates the requirements on [drf-yasg[validation]](https://github.com/axnsan12/drf-yasg) to permit the latest version. - [Release notes](https://github.com/axnsan12/drf-yasg/releases) - [Changelog](https://github.com/axnsan12/drf-yasg/blob/master/docs/changelog.rst) - [Commits](https://github.com/axnsan12/drf-yasg/compare/1.17.0...1.20.0) Signed-off-by: dependabot[bot] --- requirements/base.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.txt b/requirements/base.txt index 552719d0..a82aa669 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -20,7 +20,7 @@ whitenoise[brotli]==5.1.* # https://github.com/evansd/whitenoise # -------------------------- djangorestframework==3.11.* djangorestframework-filters==1.0.* -drf-yasg[validation]==1.17.* +drf-yasg[validation]==1.20.* # Utils # -------------------------- From 1914c8704c569c7226fc448ebeb36e49247d75cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Nov 2020 03:18:27 +0000 Subject: [PATCH 47/59] Bump black from 19.10b0 to 20.8b1 Bumps [black](https://github.com/psf/black) from 19.10b0 to 20.8b1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/master/CHANGES.md) - [Commits](https://github.com/psf/black/commits) Signed-off-by: dependabot[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index b4294c69..6b90851b 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -28,7 +28,7 @@ validator-collection== 1.4.* # https://github.com/insightindustry/validator-c # Code quality # ---------------------- -black==19.10b0 # https://github.com/ambv/black +black==20.8b1 # https://github.com/ambv/black django-coverage-plugin==1.8.* # https://github.com/nedbat/django_coverage_plugin flake8==3.8.* # https://github.com/PyCQA/flake8 pre-commit==2.7.* # https://github.com/pre-commit/pre-commit From 2d97bbcb4bb45ef020ed2ee6e5cd8837faa22ae7 Mon Sep 17 00:00:00 2001 From: Julien Date: Wed, 11 Nov 2020 22:35:33 +0100 Subject: [PATCH 48/59] Update production.md --- docs/deployment/production.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/deployment/production.md b/docs/deployment/production.md index 0cf8ac7d..f9947f8b 100644 --- a/docs/deployment/production.md +++ b/docs/deployment/production.md @@ -22,9 +22,11 @@ Par défaut c'est Python 3.6 qui est livré avec Ubuntu 18.04 Bionic. Il nous fa sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update -sudo apt install python3.7 python3-pip +sudo apt install libpq-dev python3-pip python3.7 python3.7-dev ``` +Au passage, on installe tout ce qu'il faut pour builder [psycopg2](https://tekshinobi.com/install-psycopg2-on-ubuntu-18-04/). + #### Personnaliser bash Configurer `bash` pour faire correspondre `python3` à Python 3.7 : From 30606ff4f2f63803a242f9a298899853ef02d78b Mon Sep 17 00:00:00 2001 From: Julien Date: Thu, 3 Dec 2020 11:57:17 +0100 Subject: [PATCH 49/59] Update production.md --- docs/deployment/production.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deployment/production.md b/docs/deployment/production.md index f9947f8b..12ceb36d 100644 --- a/docs/deployment/production.md +++ b/docs/deployment/production.md @@ -22,7 +22,7 @@ Par défaut c'est Python 3.6 qui est livré avec Ubuntu 18.04 Bionic. Il nous fa sudo apt install software-properties-common sudo add-apt-repository ppa:deadsnakes/ppa sudo apt update -sudo apt install libpq-dev python3-pip python3.7 python3.7-dev +sudo apt install libpq-dev python3-pip python3.7 python3.7-dev python3.7-venv ``` Au passage, on installe tout ce qu'il faut pour builder [psycopg2](https://tekshinobi.com/install-psycopg2-on-ubuntu-18-04/). From edff2301c817360ab2b61bf4dfee1cf22d4f6eef Mon Sep 17 00:00:00 2001 From: GeoJulien Date: Mon, 4 Jan 2021 12:52:54 +0100 Subject: [PATCH 50/59] Enable dependabot for GHA --- .github/dependabot.yml | 62 ++++++++++++++++++++++-------------------- .vscode/settings.json | 2 +- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c043e240..2e7af838 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,32 +1,34 @@ version: 2 updates: -- package-ecosystem: pip - directory: "/" - schedule: - interval: weekly - time: "04:00" - timezone: Europe/Paris - reviewers: - - Guts - labels: - - dependencies -- package-ecosystem: pip - directory: ".deploy/apache/" - schedule: - interval: monthly - time: "04:00" - timezone: Europe/Paris - reviewers: - - Guts - labels: - - dependencies -- package-ecosystem: pip - directory: "/requirements" - schedule: - interval: weekly - time: "04:00" - timezone: Europe/Paris - reviewers: - - Guts - labels: - - dependencies + + - package-ecosystem: pip + directory: ".deploy/apache/" + schedule: + interval: monthly + time: "04:00" + timezone: Europe/Paris + reviewers: + - Guts + labels: + - dependencies + + - package-ecosystem: pip + directory: "/requirements" + schedule: + interval: monthly + time: "04:00" + timezone: Europe/Paris + reviewers: + - Guts + labels: + - dependencies + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + reviewers: + - Guts + labels: + - ci-cd + - dependencies diff --git a/.vscode/settings.json b/.vscode/settings.json index 6fbdfba4..f0bf1a3b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,7 @@ "python.linting.pylintArgs": [ "--load-plugins=pylint_django" ], - "python.pythonPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe", + "python.pythonPath": ".venv/bin/python3.8", "python.testing.pytestEnabled": true, "python.testing.pytestArgs": [ "-c", From 9650eede8b9660470587bb14feb6b04ac5eb3f4f Mon Sep 17 00:00:00 2001 From: GeoJulien Date: Mon, 4 Jan 2021 12:55:05 +0100 Subject: [PATCH 51/59] Add GHA --- .github/workflows/ci_cd.yml | 4 +- .github/workflows/pre-commit_autoupdate.yml | 47 +++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pre-commit_autoupdate.yml diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index ea9d16a8..f4566fe9 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -29,7 +29,7 @@ jobs: with: path: ~/.cache/pip # This path is specific to Ubuntu # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} restore-keys: | ${{ runner.os }}-pip- ${{ runner.os }}- @@ -37,7 +37,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements/local.txt + python -m pip install -r requirements/local.txt # download NLTK packages - please refer to `ntlk.txt` python -m nltk.downloader punkt stopwords diff --git a/.github/workflows/pre-commit_autoupdate.yml b/.github/workflows/pre-commit_autoupdate.yml new file mode 100644 index 00000000..9883d98f --- /dev/null +++ b/.github/workflows/pre-commit_autoupdate.yml @@ -0,0 +1,47 @@ +# Run pre-commit autoupdate every day at midnight +# and create a pull request if any changes + + +name: Pre-commit auto-update + +on: + schedule: + - cron: "0 0 1 * *" + workflow_dispatch: # to trigger manually + +env: + PYTHON_VERSION: 3.8 + +jobs: + auto-update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2.2.1 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - uses: actions/cache@v2.1.3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Install pre-commit + run: | + python -m pip install -U pip setuptools wheel + python -m pip install -U pre-commit + + - name: Run pre-commit autoupdate + run: pre-commit autoupdate + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3.6.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + branch: update/pre-commit-autoupdate + title: Auto-update pre-commit hooks + commit-message: Auto-update pre-commit hooks + body: Update versions of tools in pre-commit configs to latest version + labels: update From 01ed7bd31705df3989b6c98ed84f171814a90cb4 Mon Sep 17 00:00:00 2001 From: GeoJulien Date: Mon, 4 Jan 2021 12:56:55 +0100 Subject: [PATCH 52/59] Bump precommit --- .pre-commit-config.yaml | 2 +- requirements/local.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 503b4f3f..24921c5f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ exclude: "node_modules|migrations|.venv|tests/dev/|tests/fixtures/" fail_fast: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.3.0 + rev: v3.4.0 hooks: - id: check-added-large-files args: ['--maxkb=500'] diff --git a/requirements/local.txt b/requirements/local.txt index 6b90851b..54227f76 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -30,8 +30,8 @@ validator-collection== 1.4.* # https://github.com/insightindustry/validator-c # ---------------------- black==20.8b1 # https://github.com/ambv/black django-coverage-plugin==1.8.* # https://github.com/nedbat/django_coverage_plugin -flake8==3.8.* # https://github.com/PyCQA/flake8 -pre-commit==2.7.* # https://github.com/pre-commit/pre-commit +flake8>=3.8,<3.9 # https://github.com/PyCQA/flake8 +pre-commit>=2.9,<2.10 # https://github.com/pre-commit/pre-commit pylint-django==2.0.* # https://github.com/PyCQA/pylint-django # Django From b941548404e4b3b3741e6a05bcebcbb8cad6901a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 11:57:53 +0000 Subject: [PATCH 53/59] Bump actions/labeler from v2 to v3 Bumps [actions/labeler](https://github.com/actions/labeler) from v2 to v3. - [Release notes](https://github.com/actions/labeler/releases) - [Commits](https://github.com/actions/labeler/compare/v2...9794b1493b6f1fa7b006c5f8635a19c76c98be95) Signed-off-by: dependabot[bot] --- .github/workflows/pr-auto-labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-auto-labeler.yml b/.github/workflows/pr-auto-labeler.yml index dcafb97d..b70f4c56 100644 --- a/.github/workflows/pr-auto-labeler.yml +++ b/.github/workflows/pr-auto-labeler.yml @@ -6,6 +6,6 @@ jobs: triage: runs-on: ubuntu-latest steps: - - uses: actions/labeler@v2 + - uses: actions/labeler@v3 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" From 9fdfa449e972874d32dc913e191aac76ab66a560 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 13:04:26 +0100 Subject: [PATCH 54/59] Update actions/setup-python requirement to v2.2.1 (#119) Updates the requirements on [actions/setup-python](https://github.com/actions/setup-python) to permit the latest version. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/commits/3105fb18c05ddd93efea5f9e0bef7a03a6e9e7df) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Julien --- .github/workflows/ci_cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index f4566fe9..47676ff4 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2.2.1 with: python-version: ${{ matrix.python-version }} @@ -65,7 +65,7 @@ jobs: - uses: actions/checkout@v2 # Install Python runtime and dependencies - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v2.2.1 with: python-version: 3.x From d242ea700e28ef983b48a8e2be788de97d47de64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 12:05:01 +0000 Subject: [PATCH 55/59] Update actions/cache requirement to v2.1.3 Updates the requirements on [actions/cache](https://github.com/actions/cache) to permit the latest version. - [Release notes](https://github.com/actions/cache/releases) - [Commits](https://github.com/actions/cache/commits/0781355a23dac32fd3bac414512f4b903437991a) Signed-off-by: dependabot[bot] --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 47676ff4..9f8b3966 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -25,7 +25,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Cache pip - uses: actions/cache@v1 + uses: actions/cache@v2.1.3 with: path: ~/.cache/pip # This path is specific to Ubuntu # Look to see if there is a cache hit for the corresponding requirements file From 82353c24bf2f5520321d46abcd2020635272cd26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 12:08:02 +0000 Subject: [PATCH 56/59] Update validator-collection requirement from ==1.4.* to ==1.5.* Updates the requirements on [validator-collection](https://github.com/insightindustry/validator-collection) to permit the latest version. - [Release notes](https://github.com/insightindustry/validator-collection/releases) - [Changelog](https://github.com/insightindustry/validator-collection/blob/master/CHANGES.rst) - [Commits](https://github.com/insightindustry/validator-collection/compare/v.1.4.0...v.1.5.0) Signed-off-by: dependabot[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 54227f76..78129bad 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -24,7 +24,7 @@ pytest==5.4.* # https://github.com/pytest-dev/pytest pytest-cov==2.10.* pytest-django==3.9.* # https://github.com/pytest-dev/pytest-django semver==2.10.* # https://github.com/python-semver/python-semver -validator-collection== 1.4.* # https://github.com/insightindustry/validator-collection +validator-collection== 1.5.* # https://github.com/insightindustry/validator-collection # Code quality # ---------------------- From 597aa899d9de7e2500e20ae0d108613b8656d7b8 Mon Sep 17 00:00:00 2001 From: GeoJulien Date: Mon, 4 Jan 2021 13:21:22 +0100 Subject: [PATCH 57/59] Bump testing deps --- requirements/local.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements/local.txt b/requirements/local.txt index 78129bad..e330b920 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -20,10 +20,10 @@ sphinx-rtd-theme==0.5.* # Testing # ---------------------- -pytest==5.4.* # https://github.com/pytest-dev/pytest -pytest-cov==2.10.* -pytest-django==3.9.* # https://github.com/pytest-dev/pytest-django -semver==2.10.* # https://github.com/python-semver/python-semver +pytest>=6.2,<6.3 # https://github.com/pytest-dev/pytest +pytest-cov>=2.10,<2.11 +pytest-django>=4.1,<4.2 # https://github.com/pytest-dev/pytest-django +semver>=2.13,<2.14 # https://github.com/python-semver/python-semver validator-collection== 1.5.* # https://github.com/insightindustry/validator-collection # Code quality From a08072ac90f73aff1b101617272da32852034814 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jan 2021 12:12:31 +0000 Subject: [PATCH 58/59] Update pylint-django requirement in /requirements Updates the requirements on [pylint-django](https://github.com/PyCQA/pylint-django) to permit the latest version. - [Release notes](https://github.com/PyCQA/pylint-django/releases) - [Changelog](https://github.com/PyCQA/pylint-django/blob/master/CHANGELOG.rst) - [Commits](https://github.com/PyCQA/pylint-django/compare/2.0...v2.3.0) Signed-off-by: dependabot[bot] --- requirements/local.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/local.txt b/requirements/local.txt index 78129bad..a207b2d7 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -32,7 +32,7 @@ black==20.8b1 # https://github.com/ambv/black django-coverage-plugin==1.8.* # https://github.com/nedbat/django_coverage_plugin flake8>=3.8,<3.9 # https://github.com/PyCQA/flake8 pre-commit>=2.9,<2.10 # https://github.com/pre-commit/pre-commit -pylint-django==2.0.* # https://github.com/PyCQA/pylint-django +pylint-django==2.3.* # https://github.com/PyCQA/pylint-django # Django # ------------------------------------------------------------------------------ From c0d04e719976ac5c4c97dc000ff208cd30e6ae03 Mon Sep 17 00:00:00 2001 From: GeoJulien Date: Mon, 4 Jan 2021 13:35:56 +0100 Subject: [PATCH 59/59] Bump doc deps --- docs/conf.py | 35 +++++++++++++++++++++++-------- docs/development/documentation.md | 9 ++++++++ docs/index.rst | 6 +++++- requirements/local.txt | 6 +++--- 4 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 docs/development/documentation.md diff --git a/docs/conf.py b/docs/conf.py index 61443682..53f12cde 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -38,6 +38,11 @@ # The full version, including alpha/beta/rc tags version = release = __about__.__version__ +# replacement variables +rst_epilog = ".. |title| replace:: %s" % project +rst_epilog += "\n.. |author| replace:: %s" % author +rst_epilog += "\n.. |repo_url| replace:: %s" % __about__.__uri__ + # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be @@ -48,6 +53,7 @@ "recommonmark", # Sphinx included "sphinx.ext.autodoc", + "sphinx.ext.autosectionlabel", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", # 3rd party @@ -78,20 +84,30 @@ # -- Options for HTML output ------------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = "sphinx_rtd_theme" - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] +# html_favicon = "static/img/sqlitetoairtable_logo.svg" +# html_logo = "static/img/sqlitetoairtable_logo.svg" # Ensure sidebar is the same along the pages html_sidebars = { "**": ["globaltoc.html", "relations.html", "sourcelink.html", "searchbox.html"] } +html_static_path = ["_static"] +html_theme = "sphinx_rtd_theme" +html_theme_options = { + # "canonical_url": __about__.__uri_homepage__, + "display_version": True, + "logo_only": False, + "prev_next_buttons_location": "both", + "style_external_links": True, + "style_nav_header_background": "SteelBlue", + # Toc options + "collapse_navigation": False, + "includehidden": False, + "navigation_depth": 4, + "sticky_navigation": False, + "titles_only": False, +} + # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: @@ -142,3 +158,4 @@ def setup(app): True, ) app.add_transform(AutoStructify) + app.connect("builder-inited", run_apidoc) diff --git a/docs/development/documentation.md b/docs/development/documentation.md new file mode 100644 index 00000000..9fb4bc36 --- /dev/null +++ b/docs/development/documentation.md @@ -0,0 +1,9 @@ +# Documentation + +## Générer la documentation + +```powershell +sphinx-build -b html docs docs/_build +``` + +Ouvrir le fichier `docs/_build/index.html` dans un navigateur. diff --git a/docs/index.rst b/docs/index.rst index 68816d42..14053f75 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,7 +8,10 @@ El Géo Paso - Documentation .. |date| date:: -Mise à jour : |date| +:Author: |author| +:Source code: |repo_url| +:Package version: |version| +:Documentation update: |date| Raccourcis ++++++++++ @@ -31,6 +34,7 @@ Raccourcis development/index development/code + development/documentation development/build development/settings development/tests diff --git a/requirements/local.txt b/requirements/local.txt index e330b920..55fd7a45 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -11,11 +11,11 @@ Werkzeug==1.0.* # https://github.com/pallets/werkzeug # Documentation # ----------------------- -recommonmark==0.6.* -Sphinx==3.1.* # https://github.com/sphinx-doc/sphinx +recommonmark>=0.6,<0.8 +Sphinx>=3.1,<3.5 # https://github.com/sphinx-doc/sphinx sphinx-autodoc-typehints==1.11.* sphinx-copybutton==0.3.* -sphinx-markdown-tables==0.0.15 # to render markdown tables +sphinx-markdown-tables==0.0.15 # to render markdown tables sphinx-rtd-theme==0.5.* # Testing