Skip to content

Commit

Permalink
Merge branch 'master' into multi-maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Jan 4, 2021
2 parents 6ae30fa + 8a45fea commit 1771f9d
Show file tree
Hide file tree
Showing 38 changed files with 1,427 additions and 94 deletions.
7 changes: 3 additions & 4 deletions .deploy/apache/elgeopaso.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<VirtualHost *:80>
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
</VirtualHost>
1 change: 1 addition & 0 deletions .deploy/release-tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 34 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: 2
updates:

- 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
10 changes: 5 additions & 5 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ 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 }}

- 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
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- 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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-auto-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
47 changes: 47 additions & 0 deletions .github/workflows/pre-commit_autoupdate.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/_apidoc/

# PyBuilder
target/
Expand Down Expand Up @@ -101,6 +102,7 @@ nltk_data/*
# bash
.bash_history

# tests and PEP8
*.whl
dev_flake8_report.txt
junit/test-results.xml
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.0
hooks:
- id: check-added-large-files
args: ['--maxkb=500']
Expand All @@ -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,]
Expand Down
28 changes: 28 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -19,4 +19,5 @@
"python.testing.nosetestsEnabled": false,
"autoDocstring.customTemplatePath": ".vscode\\docstring-config.mustache",
"autoDocstring.generateDocstringOnEnter": false,
"restructuredtext.confPath": "${workspaceFolder}\\docs",
}
61 changes: 4 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +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/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 : <https://elgeopaso.rtfd.io/>

## Développement
[![](docs/_static/icon_doc.png)](https://elgeopaso.rtfd.io/)

### Docker

```shell
docker-compose -f "docker-compose.dev.yml" up --build
```

Ouvrir le site sur <http://localhost:8000>.

----

> 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).
> Source icône : Book by Smalllike from the Noun Project
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -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)
Binary file added docs/_static/icon_doc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1771f9d

Please sign in to comment.