mirror of
https://github.com/YunoHost-Apps/django-for-runners_ynh.git
synced 2024-09-03 18:26:16 +02:00
commit
9edb4d78af
11 changed files with 68 additions and 26 deletions
|
@ -1,4 +1,4 @@
|
||||||
# see http://editorconfig.org
|
# see https://editorconfig.org
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
|
@ -17,4 +17,4 @@ indent_style = tab
|
||||||
insert_final_newline = false
|
insert_final_newline = false
|
||||||
|
|
||||||
[*.yml]
|
[*.yml]
|
||||||
indent_style = tab
|
indent_size = 2
|
||||||
|
|
2
.flake8
2
.flake8
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Move to pyproject.toml after: https://gitlab.com/pycqa/flake8/-/issues/428
|
# Move to pyproject.toml after: https://github.com/PyCQA/flake8/issues/234
|
||||||
#
|
#
|
||||||
[flake8]
|
[flake8]
|
||||||
exclude = .*, dist, htmlcov, local_test
|
exclude = .*, dist, htmlcov, local_test
|
||||||
|
|
18
.github/workflows/package_linter.yml
vendored
18
.github/workflows/package_linter.yml
vendored
|
@ -1,6 +1,8 @@
|
||||||
name: YunoHost apps package linter
|
name: YunoHost apps package linter
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
# Allow to manually trigger the workflow
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
@ -12,21 +14,25 @@ jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
# https://github.com/marketplace/actions/checkout
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
|
# https://github.com/marketplace/actions/cache
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/
|
path: ~/.cache/
|
||||||
key: dot-cache-files
|
key: dot-cache-files
|
||||||
|
|
||||||
|
- name: 'Install dependencies'
|
||||||
|
run: |
|
||||||
|
pip install toml
|
||||||
|
|
||||||
- name: 'Clone YunoHost apps package linter'
|
- name: 'Clone YunoHost apps package linter'
|
||||||
run: |
|
run: |
|
||||||
git clone --depth=1 https://github.com/YunoHost/package_linter ~/package_linter
|
git clone --depth=1 https://github.com/YunoHost/package_linter ~/package_linter
|
||||||
|
|
||||||
- name: 'Install requirements'
|
|
||||||
run: |
|
|
||||||
pip3 install toml
|
|
||||||
|
|
||||||
- name: 'Run linter'
|
- name: 'Run linter'
|
||||||
run: |
|
run: |
|
||||||
~/package_linter/package_linter.py .
|
~/package_linter/package_linter.py .
|
||||||
|
|
20
.github/workflows/pytest.yml
vendored
20
.github/workflows/pytest.yml
vendored
|
@ -1,6 +1,8 @@
|
||||||
name: pytest
|
name: pytest
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
# Allow to manually trigger the workflow
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
@ -12,22 +14,29 @@ jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 2
|
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["3.11", "3.10", "3.9"]
|
python-version: ["3.11", "3.10", "3.9"]
|
||||||
|
env:
|
||||||
|
PYTHONUNBUFFERED: 1
|
||||||
|
PYTHONWARNINGS: always
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
# https://github.com/marketplace/actions/checkout
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: 'fetch master'
|
|
||||||
|
- name: 'fetch master and testing (for Darker/Black)'
|
||||||
run: |
|
run: |
|
||||||
git fetch origin master
|
git fetch origin master
|
||||||
|
git fetch origin testing
|
||||||
|
|
||||||
- name: 'Set up Python ${{ matrix.python-version }}'
|
- name: 'Set up Python ${{ matrix.python-version }}'
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '${{ matrix.python-version }}'
|
python-version: '${{ matrix.python-version }}'
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
|
# https://github.com/marketplace/actions/cache
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/
|
path: ~/.cache/
|
||||||
key: dot-cache-files
|
key: dot-cache-files
|
||||||
|
@ -50,7 +59,8 @@ jobs:
|
||||||
make safety
|
make safety
|
||||||
|
|
||||||
- name: 'Upload coverage report'
|
- name: 'Upload coverage report'
|
||||||
uses: codecov/codecov-action@v2
|
uses: codecov/codecov-action@v3
|
||||||
|
# https://github.com/marketplace/actions/codecov
|
||||||
with:
|
with:
|
||||||
fail_ci_if_error: false
|
fail_ci_if_error: false
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -3,12 +3,10 @@
|
||||||
!.editorconfig
|
!.editorconfig
|
||||||
!.flake8
|
!.flake8
|
||||||
!.gitignore
|
!.gitignore
|
||||||
!.safety-policy.yml
|
|
||||||
|
|
||||||
!/doc/screenshots/.gitkeep
|
!/doc/screenshots/.gitkeep
|
||||||
|
|
||||||
__pycache__
|
__pycache__
|
||||||
secret.txt
|
secret.txt
|
||||||
/local_test/
|
/local_test/
|
||||||
|
/coverage.json
|
||||||
/coverage.xml
|
/coverage.xml
|
||||||
/htmlcov/
|
/htmlcov/
|
||||||
|
|
|
@ -34,7 +34,7 @@ This package for YunoHost used [django-yunohost-integration](https://github.com/
|
||||||
More screenshots are here: [jedie.github.io/tree/master/screenshots/django-for-runners](https://github.com/jedie/jedie.github.io/tree/master/screenshots/django-for-runners/README.creole)
|
More screenshots are here: [jedie.github.io/tree/master/screenshots/django-for-runners](https://github.com/jedie/jedie.github.io/tree/master/screenshots/django-for-runners/README.creole)
|
||||||
|
|
||||||
|
|
||||||
**Shipped version:** 0.17.3~ynh2
|
**Shipped version:** 0.17.3~ynh3
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ This package for YunoHost used [django-yunohost-integration](https://github.com/
|
||||||
More screenshots are here: [jedie.github.io/tree/master/screenshots/django-for-runners](https://github.com/jedie/jedie.github.io/tree/master/screenshots/django-for-runners/README.creole)
|
More screenshots are here: [jedie.github.io/tree/master/screenshots/django-for-runners](https://github.com/jedie/jedie.github.io/tree/master/screenshots/django-for-runners/README.creole)
|
||||||
|
|
||||||
|
|
||||||
**Version incluse :** 0.17.3~ynh2
|
**Version incluse :** 0.17.3~ynh3
|
||||||
|
|
||||||
## Captures d’écran
|
## Captures d’écran
|
||||||
|
|
||||||
|
|
|
@ -54,15 +54,22 @@ YNH_SETUP_USER = 'setup_user.setup_project_user'
|
||||||
|
|
||||||
SECRET_KEY = __get_or_create_secret(FINALPATH / 'secret.txt') # /opt/yunohost/$app/secret.txt
|
SECRET_KEY = __get_or_create_secret(FINALPATH / 'secret.txt') # /opt/yunohost/$app/secret.txt
|
||||||
|
|
||||||
|
|
||||||
|
if 'axes' not in INSTALLED_APPS:
|
||||||
|
INSTALLED_APPS.append('axes') # https://github.com/jazzband/django-axes
|
||||||
|
|
||||||
INSTALLED_APPS.append('django_yunohost_integration.apps.YunohostIntegrationConfig')
|
INSTALLED_APPS.append('django_yunohost_integration.apps.YunohostIntegrationConfig')
|
||||||
|
|
||||||
|
|
||||||
MIDDLEWARE.insert(
|
MIDDLEWARE.insert(
|
||||||
MIDDLEWARE.index('django.contrib.auth.middleware.AuthenticationMiddleware') + 1,
|
MIDDLEWARE.index('django.contrib.auth.middleware.AuthenticationMiddleware') + 1,
|
||||||
# login a user via HTTP_REMOTE_USER header from SSOwat:
|
# login a user via HTTP_REMOTE_USER header from SSOwat:
|
||||||
'django_yunohost_integration.sso_auth.auth_middleware.SSOwatRemoteUserMiddleware',
|
'django_yunohost_integration.sso_auth.auth_middleware.SSOwatRemoteUserMiddleware',
|
||||||
)
|
)
|
||||||
# AxesMiddleware should be the last middleware:
|
if 'axes.middleware.AxesMiddleware' not in MIDDLEWARE:
|
||||||
MIDDLEWARE.append('axes.middleware.AxesMiddleware')
|
# AxesMiddleware should be the last middleware:
|
||||||
|
MIDDLEWARE.append('axes.middleware.AxesMiddleware')
|
||||||
|
|
||||||
|
|
||||||
# Keep ModelBackend around for per-user permissions and superuser
|
# Keep ModelBackend around for per-user permissions and superuser
|
||||||
AUTHENTICATION_BACKENDS = (
|
AUTHENTICATION_BACKENDS = (
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"description": {
|
"description": {
|
||||||
"en": "Store your GPX tracks of your running (or other sports activity)"
|
"en": "Store your GPX tracks of your running (or other sports activity)"
|
||||||
},
|
},
|
||||||
"version": "0.17.3~ynh2",
|
"version": "0.17.3~ynh3",
|
||||||
"url": "https://github.com/jedie/django-for-runners",
|
"url": "https://github.com/jedie/django-for-runners",
|
||||||
"upstream": {
|
"upstream": {
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "for_runners_ynh"
|
name = "for_runners_ynh"
|
||||||
version = "0.17.3+ynh2"
|
version = "0.17.3+ynh3"
|
||||||
description = "YunoHost app package for https://github.com/jedie/django-for-runners"
|
description = "YunoHost app package for https://github.com/jedie/django-for-runners"
|
||||||
authors = ["Jens Diemer <git@jensdiemer.de>"]
|
authors = ["Jens Diemer <git@jensdiemer.de>"]
|
||||||
homepage = "https://github.com/YunoHost-Apps/django-for-runners_ynh"
|
homepage = "https://github.com/YunoHost-Apps/django-for-runners_ynh"
|
||||||
|
@ -8,7 +8,7 @@ license = "GPL-3.0-or-later"
|
||||||
readme = 'README.md'
|
readme = 'README.md'
|
||||||
|
|
||||||
[tool.poetry.urls]
|
[tool.poetry.urls]
|
||||||
"Bug Tracker" = "https://github.com/YunoHost-Apps/django-for-runners_ynh/issues"
|
"Bug Tracker" = "https://github.com/jedie/django-for-runners/issues"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = ">=3.9,<4.0.0" # Stay with 3.9 until YunoHost used >=Debian 11 (Bullseye)
|
python = ">=3.9,<4.0.0" # Stay with 3.9 until YunoHost used >=Debian 11 (Bullseye)
|
||||||
|
@ -149,6 +149,9 @@ initial_revision = "2281f4b"
|
||||||
initial_date = 2023-04-02T17:40:58+02:00
|
initial_date = 2023-04-02T17:40:58+02:00
|
||||||
cookiecutter_template = "https://github.com/jedie/cookiecutter_templates/"
|
cookiecutter_template = "https://github.com/jedie/cookiecutter_templates/"
|
||||||
cookiecutter_directory = "yunohost_django_package"
|
cookiecutter_directory = "yunohost_django_package"
|
||||||
|
applied_migrations = [
|
||||||
|
"183124a", # 2023-04-04T12:26:15+02:00
|
||||||
|
]
|
||||||
|
|
||||||
[manageprojects.cookiecutter_context.cookiecutter]
|
[manageprojects.cookiecutter_context.cookiecutter]
|
||||||
project_name = "django-for-runners"
|
project_name = "django-for-runners"
|
||||||
|
@ -157,11 +160,14 @@ github_username = "jedie"
|
||||||
author_email = "git@jensdiemer.de"
|
author_email = "git@jensdiemer.de"
|
||||||
upstream_pkg_name = "django_for_runners"
|
upstream_pkg_name = "django_for_runners"
|
||||||
upstream_url = "https://github.com/jedie/django-for-runners"
|
upstream_url = "https://github.com/jedie/django-for-runners"
|
||||||
|
upstream_pkg_app_name = "for_runners"
|
||||||
|
upstream_pkg_project_name = "for_runners_project"
|
||||||
ynh_app_pkg_name = "for_runners_ynh"
|
ynh_app_pkg_name = "for_runners_ynh"
|
||||||
ynh_app_url = "https://github.com/YunoHost-Apps/django-for-runners_ynh"
|
ynh_app_url = "https://github.com/YunoHost-Apps/django-for-runners_ynh"
|
||||||
bug_tracker_url = "https://github.com/jedie/django-for-runners/issues"
|
bug_tracker_url = "https://github.com/jedie/django-for-runners/issues"
|
||||||
upstream_version = "0.0.1"
|
upstream_version = "0.17.3"
|
||||||
ynh_version = "1"
|
ynh_version = "+ynh3"
|
||||||
package_description = "YunoHost app package for https://github.com/jedie/django-for-runners"
|
package_description = "YunoHost app package for https://github.com/jedie/django-for-runners"
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
_template = "https://github.com/jedie/cookiecutter_templates/"
|
_template = "https://github.com/jedie/cookiecutter_templates/"
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from unittest import TestCase
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -140,3 +141,17 @@ def test_check_code_style():
|
||||||
_call_make('lint')
|
_call_make('lint')
|
||||||
except subprocess.CalledProcessError as err:
|
except subprocess.CalledProcessError as err:
|
||||||
raise AssertionError(f'Linting error:\n{"-"*100}\n{err.stdout}\n{"-"*100}')
|
raise AssertionError(f'Linting error:\n{"-"*100}\n{err.stdout}\n{"-"*100}')
|
||||||
|
|
||||||
|
|
||||||
|
class ConfigPanelTestCase(TestCase):
|
||||||
|
def test_config_panel_toml(self):
|
||||||
|
config_panel_path = PACKAGE_ROOT / 'config_panel.toml'
|
||||||
|
assert_is_file(config_panel_path)
|
||||||
|
|
||||||
|
cfg = tomllib.loads(config_panel_path.read_text(encoding='UTF-8'))
|
||||||
|
|
||||||
|
self.assertEqual(cfg['version'], '1.0')
|
||||||
|
self.assertEqual(
|
||||||
|
set(cfg['main']['config'].keys()),
|
||||||
|
{'name', 'default_from_email', 'admin_email', 'debug_enabled', 'log_level'},
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue