Skip to content

Commit a1cec5b

Browse files
authored
Merge pull request #403 from PnX-SI/dev
prepare v1.1.0
2 parents a8a23bc + 3684e38 commit a1cec5b

110 files changed

Lines changed: 1108 additions & 682 deletions

File tree

Some content is hidden

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

.angulardoc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"repoId": "2b14cce7-db7a-476a-a8b9-f41927e3728b",
33
"lastSync": 0
4-
}
4+
}

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ exclude =
3939
build,
4040
dist,
4141
migrations
42-
max-complexity = 10
42+
max-complexity = 10
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: "📚 Documentation"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- ".github/workflows/documentation.yml"
9+
- "docs/*/**"
10+
tags:
11+
- "*"
12+
13+
pull_request:
14+
branches:
15+
- master
16+
paths:
17+
- ".github/workflows/documentation.yml"
18+
- docs/**/*
19+
20+
workflow_dispatch:
21+
22+
# Allow one concurrent deployment per branch/pr
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: true
26+
27+
env:
28+
PYTHON_VERSION: 3.11
29+
30+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
31+
permissions:
32+
contents: read
33+
pages: write
34+
id-token: write
35+
36+
jobs:
37+
build:
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Get source code
42+
uses: actions/checkout@v4
43+
44+
- name: Run image
45+
uses: abatilo/actions-poetry@v3
46+
#------------------------------------
47+
# ----- Install dependencies -----
48+
#------------------------------------
49+
- name: Install dependencies
50+
run: |
51+
cd backend
52+
poetry install --only=docs
53+
54+
- name: Build doc using Sphinx
55+
run: |
56+
cd backend
57+
poetry run sphinx-build -b html -d ../docs/_build/cache -j auto ../docs ../docs/_build/html
58+
59+
- name: Save build doc as artifact
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: documentation
63+
path: docs/_build/html/*
64+
if-no-files-found: error
65+
retention-days: 30
66+
67+
- name: Setup Pages
68+
uses: actions/configure-pages@v4
69+
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
70+
71+
- name: Upload artifact
72+
uses: actions/upload-pages-artifact@v3
73+
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
74+
with:
75+
path: docs/_build/html/
76+
77+
- name: Deploy to GitHub Pages
78+
id: deployment
79+
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
80+
uses: actions/deploy-pages@v4

.github/workflows/linter.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "✅ Linter"
2+
3+
on:
4+
push:
5+
branches: [master, dev]
6+
paths:
7+
- "backend/**/*.py"
8+
- "frontend/*"
9+
10+
pull_request:
11+
branches: [master, dev]
12+
paths:
13+
- "backend/**/*.py"
14+
- "frontend/*"
15+
16+
env:
17+
BACKEND_FOLDER: "backend"
18+
FRONTEND_FOLDER: "frontend"
19+
PYTHON_VERSION: 3.9
20+
21+
jobs:
22+
lint-py:
23+
name: Python 🐍
24+
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Get source code
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ env.PYTHON_VERSION }}
35+
36+
- name: Install project requirements
37+
run: |
38+
python -m pip install -U pip setuptools wheel
39+
python -m pip install -U flake8
40+
41+
- name: Lint with flake8
42+
run: |
43+
# stop the build if there are Python syntax errors or undefined names
44+
flake8 ${{ env.BACKEND_FOLDER }} --count --select=E9,F63,F7,F82 --show-source --statistics
45+
# exit-zero treats all errors as warnings.
46+
flake8 ${{ env.BACKEND_FOLDER }} --count --exit-zero --statistics
47+
48+
lint-node:
49+
name: NodeJS 🐍
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: actions/setup-node@v4
54+
with:
55+
node-version-file: "${{ env.FRONTEND_FOLDER }}/.nvmrc"
56+
- run: cd ${{ env.FRONTEND_FOLDER }} && npm ci
57+
- run: cd ${{ env.FRONTEND_FOLDER }} && npm run lint

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
exclude: ".venv|__pycache__|tests/dev/|tests/fixtures/"
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: check-added-large-files
8+
args: ["--maxkb=500"]
9+
- id: check-case-conflict
10+
- id: check-xml
11+
- id: check-yaml
12+
- id: detect-private-key
13+
- id: end-of-file-fixer
14+
- id: fix-byte-order-marker
15+
- id: fix-encoding-pragma
16+
args: [--remove]
17+
- id: trailing-whitespace
18+
args: [--markdown-linebreak-ext=md]
19+
20+
- repo: https://github.com/psf/black
21+
rev: 24.3.0
22+
hooks:
23+
- id: black
24+
25+
# - repo: https://github.com/pycqa/isort
26+
# rev: 5.13.2
27+
# hooks:
28+
# - id: isort
29+
# args: ["--profile", "black", "--filter-files"]
30+
31+
- repo: https://github.com/pycqa/flake8
32+
rev: 7.0.0
33+
hooks:
34+
- id: flake8
35+
files: ^pyqgis_resource_browser/.*\.py$
36+
additional_dependencies: ["flake8-qgis<2"]
37+
args:
38+
[
39+
"--config=setup.cfg",
40+
"--select=E9,F63,F7,F82,QGS101,QGS102,QGS103,QGS104,QGS106",
41+
]
42+
43+
ci:
44+
autoupdate_schedule: quarterly
45+
skip: []
46+
submodules: false

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ENV LANG fr_FR.utf8
1313
ENV TERM xterm
1414

1515
RUN adduser --uid 1001 --gecos "" --disabled-password appuser
16-
RUN usermod -aG sudo appuser
16+
RUN usermod -aG sudo appuser
1717
RUN echo "appuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
1818

1919
COPY . /home/appuser/citizen

backend/.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tests
22
.venv
3-
__pycache__
3+
__pycache__

backend/Dockerfile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ WORKDIR /app
44

55
RUN pip install --upgrade pip \
66
&& pip install poetry
7-
8-
CMD poetry install; poetry run python3 wsgi.py
7+
8+
CMD poetry install; poetry run python3 wsgi.py

backend/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Moteur de la plateforme
1+
# Moteur de la plateforme
22

33
Déployé avec le framework python Flask
4-

backend/gncitizen/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
"""gncitizen __init__ to retrieve VERSION"""
2+
13
from pathlib import Path
24

35
ROOT_DIR = Path(__file__).absolute().parent.parent.parent
46

5-
with open(str((ROOT_DIR / "VERSION"))) as v:
7+
with open(str((ROOT_DIR / "VERSION")), encoding="utf-8") as v:
68
__version__ = v.read()

0 commit comments

Comments
 (0)