mirror of
https://github.com/YunoHost-Apps/django-for-runners_ynh.git
synced 2024-09-03 18:26:16 +02:00
Apply manageprojects updates
This commit is contained in:
parent
ca90670d3f
commit
bfb3758d6e
6 changed files with 22 additions and 11 deletions
4
.github/workflows/package_linter.yml
vendored
4
.github/workflows/package_linter.yml
vendored
|
@ -17,9 +17,9 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|
6
.github/workflows/tests.yml
vendored
6
.github/workflows/tests.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.12", "3.11"]
|
python-version: ['3.12', '3.11']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
run: |
|
||||||
|
@ -29,7 +29,7 @@ jobs:
|
||||||
git fetch origin master
|
git fetch origin master
|
||||||
|
|
||||||
- name: 'Set up Python ${{ matrix.python-version }}'
|
- name: 'Set up Python ${{ matrix.python-version }}'
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
# https://github.com/marketplace/actions/setup-python
|
# https://github.com/marketplace/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '${{ matrix.python-version }}'
|
python-version: '${{ matrix.python-version }}'
|
||||||
|
@ -58,7 +58,7 @@ jobs:
|
||||||
./dev-cli.py coverage
|
./dev-cli.py coverage
|
||||||
|
|
||||||
- name: 'Upload coverage report'
|
- name: 'Upload coverage report'
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v4
|
||||||
# https://github.com/marketplace/actions/codecov
|
# https://github.com/marketplace/actions/codecov
|
||||||
with:
|
with:
|
||||||
fail_ci_if_error: false
|
fail_ci_if_error: false
|
||||||
|
|
|
@ -48,7 +48,7 @@ else:
|
||||||
BASE_PATH = Path(__file__).parent
|
BASE_PATH = Path(__file__).parent
|
||||||
VENV_PATH = BASE_PATH / '.venv'
|
VENV_PATH = BASE_PATH / '.venv'
|
||||||
BIN_PATH = VENV_PATH / BIN_NAME
|
BIN_PATH = VENV_PATH / BIN_NAME
|
||||||
PYTHON_PATH = BIN_PATH / f'python{FILE_EXT}'
|
PYTHON_PATH = BIN_PATH / f'python3{FILE_EXT}'
|
||||||
PIP_PATH = BIN_PATH / f'pip{FILE_EXT}'
|
PIP_PATH = BIN_PATH / f'pip{FILE_EXT}'
|
||||||
PIP_SYNC_PATH = BIN_PATH / f'pip-sync{FILE_EXT}'
|
PIP_SYNC_PATH = BIN_PATH / f'pip-sync{FILE_EXT}'
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,12 @@ import django
|
||||||
from bx_py_utils.test_utils.deny_requests import deny_any_real_request
|
from bx_py_utils.test_utils.deny_requests import deny_any_real_request
|
||||||
from cli_base.cli_tools.verbosity import MAX_LOG_LEVEL, setup_logging
|
from cli_base.cli_tools.verbosity import MAX_LOG_LEVEL, setup_logging
|
||||||
from django_yunohost_integration.local_test import CreateResults, create_local_test
|
from django_yunohost_integration.local_test import CreateResults, create_local_test
|
||||||
from django_yunohost_integration.path_utils import get_project_root
|
|
||||||
from rich import print # noqa
|
from rich import print # noqa
|
||||||
|
from typeguard import install_import_hook
|
||||||
|
|
||||||
|
|
||||||
|
# Check type annotations via typeguard in all tests:
|
||||||
|
install_import_hook(packages=('for_runners_ynh',))
|
||||||
|
|
||||||
|
|
||||||
def pre_configure_tests() -> None:
|
def pre_configure_tests() -> None:
|
||||||
|
@ -27,12 +31,16 @@ def pre_configure_tests() -> None:
|
||||||
|
|
||||||
|
|
||||||
def setup_ynh_tests() -> None:
|
def setup_ynh_tests() -> None:
|
||||||
|
# Import after "install_import_hook" to check type annotations:
|
||||||
|
import for_runners_ynh
|
||||||
|
from for_runners_ynh.constants import PACKAGE_ROOT
|
||||||
|
|
||||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
||||||
|
|
||||||
print('Compile YunoHost files...')
|
print('Compile YunoHost files...')
|
||||||
result: CreateResults = create_local_test(
|
result: CreateResults = create_local_test(
|
||||||
django_settings_path=get_project_root() / 'conf' / 'settings.py',
|
django_settings_path=PACKAGE_ROOT / 'conf' / 'settings.py',
|
||||||
destination=get_project_root() / 'local_test',
|
destination=PACKAGE_ROOT / 'local_test',
|
||||||
runserver=False,
|
runserver=False,
|
||||||
extra_replacements={
|
extra_replacements={
|
||||||
'__DEBUG_ENABLED__': '0', # "1" or "0" string
|
'__DEBUG_ENABLED__': '0', # "1" or "0" string
|
||||||
|
@ -50,6 +58,8 @@ def setup_ynh_tests() -> None:
|
||||||
|
|
||||||
django.setup()
|
django.setup()
|
||||||
|
|
||||||
|
os.chdir(Path(for_runners_ynh.__file__).parent)
|
||||||
|
|
||||||
|
|
||||||
def load_tests(loader, tests, pattern):
|
def load_tests(loader, tests, pattern):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -26,8 +26,8 @@ class DjangoYnhTestCase(HtmlAssertionMixin, TestCase):
|
||||||
|
|
||||||
assert settings.PATH_URL == 'app_path'
|
assert settings.PATH_URL == 'app_path'
|
||||||
|
|
||||||
assert str(settings.DATA_DIR_PATH).endswith('/local_test/opt_yunohost')
|
assert str(settings.DATA_DIR_PATH).endswith('/local_test/opt_yunohost'), f'{settings.DATA_DIR_PATH=}'
|
||||||
assert str(settings.INSTALL_DIR_PATH).endswith('/local_test/var_www')
|
assert str(settings.INSTALL_DIR_PATH).endswith('/local_test/var_www'), f'{settings.INSTALL_DIR_PATH=}'
|
||||||
assert str(settings.LOG_FILE_PATH).endswith(
|
assert str(settings.LOG_FILE_PATH).endswith(
|
||||||
'/local_test/var_log_django-for-runners.log'
|
'/local_test/var_log_django-for-runners.log'
|
||||||
), f'{settings.LOG_FILE_PATH=}'
|
), f'{settings.LOG_FILE_PATH=}'
|
||||||
|
|
|
@ -167,6 +167,7 @@ applied_migrations = [
|
||||||
"4abd4c0", # 2023-11-25T15:59:31+01:00
|
"4abd4c0", # 2023-11-25T15:59:31+01:00
|
||||||
"2f9fd7b", # 2023-11-26T20:13:32+01:00
|
"2f9fd7b", # 2023-11-26T20:13:32+01:00
|
||||||
"52669d0", # 2024-08-02T15:47:04+02:00
|
"52669d0", # 2024-08-02T15:47:04+02:00
|
||||||
|
"3dac094", # 2024-08-25T15:13:50+02:00
|
||||||
]
|
]
|
||||||
|
|
||||||
[manageprojects.cookiecutter_context.cookiecutter]
|
[manageprojects.cookiecutter_context.cookiecutter]
|
||||||
|
|
Loading…
Add table
Reference in a new issue