apply manageprojects updates

This commit is contained in:
Jens Diemer 2022-12-21 20:02:02 +01:00
parent 063a6124f3
commit 9cc9dbe681
4 changed files with 30 additions and 3 deletions

View file

@ -14,7 +14,7 @@ jobs:
strategy: strategy:
max-parallel: 2 max-parallel: 2
matrix: matrix:
python-version: ["3.10", "3.9"] python-version: ["3.11", "3.10", "3.9"]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:

View file

@ -31,11 +31,12 @@ update: check-poetry ## update the sources and installation and generate "conf/
poetry export -f requirements.txt --output conf/requirements.txt poetry export -f requirements.txt --output conf/requirements.txt
lint: ## Run code formatters and linter lint: ## Run code formatters and linter
poetry run darker --check
poetry run isort --check-only . poetry run isort --check-only .
poetry run flake8 . poetry run flake8 .
fix-code-style: ## Fix code formatting fix-code-style: ## Fix code formatting
poetry run black --verbose --safe --line-length=${MAX_LINE_LENGTH} --skip-string-normalization . poetry run darker
poetry run isort . poetry run isort .
tox-listenvs: check-poetry ## List all tox test environments tox-listenvs: check-poetry ## List all tox test environments

View file

@ -108,7 +108,7 @@ omit = ['.*', '*/tests/*']
legacy_tox_ini = """ legacy_tox_ini = """
[tox] [tox]
isolated_build = True isolated_build = True
envlist = py{39,310} envlist = py{311,310,39}
skip_missing_interpreters = True skip_missing_interpreters = True
[testenv] [testenv]
@ -127,6 +127,7 @@ cookiecutter_directory = "yunohost_django_package"
applied_migrations = [ applied_migrations = [
"4dbd146", # 2022-11-06T17:59:58+01:00 "4dbd146", # 2022-11-06T17:59:58+01:00
"baf1ebc", # 2022-11-30T21:19:10+01:00 "baf1ebc", # 2022-11-30T21:19:10+01:00
"44aa620", # 2022-12-21T19:59:39+01:00
] ]
[manageprojects.cookiecutter_context.cookiecutter] [manageprojects.cookiecutter_context.cookiecutter]

View file

@ -108,3 +108,28 @@ def test_screenshot_filenames():
def test_check_editor_config(): def test_check_editor_config():
check_editor_config(package_root=PACKAGE_ROOT) check_editor_config(package_root=PACKAGE_ROOT)
def _call_make(*args):
make_bin = shutil.which('make')
assert make_bin
return subprocess.check_output(
(make_bin,) + args,
text=True,
env=dict(PATH=os.environ['PATH']),
stderr=subprocess.STDOUT,
cwd=str(PACKAGE_ROOT),
)
def test_check_code_style():
# First try:
try:
_call_make('lint')
except subprocess.CalledProcessError:
# Fix and test again:
_call_make('fix-code-style')
try:
_call_make('lint')
except subprocess.CalledProcessError as err:
raise AssertionError(f'Linting error:\n{"-"*100}\n{err.stdout}\n{"-"*100}')