diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa0f2c8d..2821c449 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,15 +2,15 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.11.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 - repo: https://github.com/pycqa/isort - rev: 5.11.4 + rev: 5.12.0 hooks: - id: isort name: isort (python) diff --git a/Makefile b/Makefile index 7a8696e1..58aad6e3 100644 --- a/Makefile +++ b/Makefile @@ -36,5 +36,14 @@ fix: $(EXEC_CMD) poetry run black --exclude=venv . $(EXEC_CMD) poetry run isort --skip-glob="**/migrations" --extend-skip-glob="venv" . + +.PHONY: init +init: + $(EXEC_CMD) poetry install + $(EXEC_CMD) poetry run pre-commit install + $(EXEC_CMD) poetry run python manage.py migrate + $(EXEC_CMD) poetry run python manage.py collectstatic --noinput + +.PHONY: runserver runserver: $(EXEC_CMD) poetry run python manage.py runserver $(HOST_URL):$(HOST_PORT) diff --git a/README.md b/README.md index 9680f76a..f7f4376c 100644 --- a/README.md +++ b/README.md @@ -54,22 +54,18 @@ cp .env.example .env Cf. la [documentation de poetry](https://python-poetry.org/docs/#installationok) -#### Installer les dépendances +#### Installer le projet +- La commande suivante installe les dépendances, fait les migrations et collecte les fichiers ``` -poetry install +make init ``` -#### Lancer les migrations - -``` -python manage.py migrate -``` #### Lancer le serveur ``` -poetry run python manage.py runserver +make runserver ``` #### Effectuer les tests