update prohject setup

This commit is contained in:
JensDiemer 2021-01-17 11:32:28 +01:00
parent af3c334f46
commit 7245702d58
5 changed files with 49 additions and 5 deletions

7
.flake8 Normal file
View file

@ -0,0 +1,7 @@
#
# Move to pyproject.toml after: https://gitlab.com/pycqa/flake8/-/issues/428
#
[flake8]
exclude = .pytest_cache, .tox, dist, htmlcov, local_test
ignore = F405
max-line-length = 119

4
.gitignore vendored
View file

@ -1,8 +1,10 @@
.*
!.github
!.editorconfig
!.flake8
!.gitignore
__pycache__
secret.txt
/local_test/
/poetry.lock
/coverage.xml
/htmlcov/

View file

@ -1,4 +1,5 @@
SHELL := /bin/bash
MAX_LINE_LENGTH := 119
all: help
@ -16,16 +17,38 @@ check-poetry:
fi
install-poetry: ## install or update poetry
pip3 install -U pip
pip3 install -U poetry
install: check-poetry ## install project via poetry
poetry install
update: install-poetry ## update the sources and installation
update: install-poetry ## update the sources and installation and generate "conf/requirements.txt"
poetry run pip install -U pip
poetry update
poetry export -f requirements.txt --output conf/requirements.txt
local-test: check-poetry ## Run local_test.py to run the project locally
poetry run ./local_test.py
lint: ## Run code formatters and linter
poetry run flynt --fail-on-change --line_length=${MAX_LINE_LENGTH} .
poetry run isort --check-only .
poetry run flake8 .
fix-code-style: ## Fix code formatting
poetry run flynt --line_length=${MAX_LINE_LENGTH} .
poetry run black --verbose --safe --line-length=${MAX_LINE_LENGTH} --skip-string-normalization .
poetry run isort .
tox-listenvs: check-poetry ## List all tox test environments
poetry run tox --listenvs
tox: check-poetry ## Run pytest via tox with all environments
poetry run tox
pytest: install ## Run pytest
poetry run python3 ./run_pytest.py
local-test: install ## Run local_test.py to run the project locally
poetry run python3 ./local_test.py
local-diff-settings: ## Run "manage.py diffsettings" with local test
poetry run python3 local_test/opt_yunohost/manage.py diffsettings

View file

@ -34,7 +34,7 @@ You can edit the file `$final_path/local_settings.py` to enable or disable featu
## SSO authentication
[SSOwat](https://github.com/YunoHost/SSOwat) is fully supported:
[SSOwat](https://github.com/YunoHost/SSOwat) is fully supported via [django_ynh](https://github.com/YunoHost-Apps/django_ynh):
* First user (`$YNH_APP_ARG_ADMIN`) will be created as Django's super user
* All new users will be created as normal users

View file

@ -8,8 +8,20 @@ license = "GPL"
[tool.poetry.dependencies]
python = ">=3.7,<4.0.0"
django-for-runners = "*"
django_ynh = "*"
[tool.poetry.dev-dependencies]
bx_py_utils = "*"
tox = "*"
pytest = "*"
pytest-cov = "*"
pytest-django = "*"
coveralls = "*"
isort = "*"
flake8 = "*"
flynt = "*"
black = "*"
pyupgrade = "*"
[build-system]
requires = ["poetry-core>=1.0.0"]