mirror of
https://github.com/YunoHost-Apps/django_example_ynh.git
synced 2024-09-03 18:26:21 +02:00
Apply manageprojects update
This commit is contained in:
parent
376e4f3cac
commit
9013003ef6
10 changed files with 49 additions and 28 deletions
4
.flake8
4
.flake8
|
@ -1,7 +1,7 @@
|
||||||
#
|
#
|
||||||
# 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 = .pytest_cache, .tox, dist, htmlcov, local_test
|
exclude = .*, dist, htmlcov, local_test
|
||||||
ignore = F405
|
ignore = F405
|
||||||
max-line-length = 119
|
max-line-length = 119
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -20,9 +20,11 @@ install-poetry: ## install or update poetry
|
||||||
curl -sSL https://install.python-poetry.org | python3 -
|
curl -sSL https://install.python-poetry.org | python3 -
|
||||||
|
|
||||||
install: check-poetry ## install project via poetry
|
install: check-poetry ## install project via poetry
|
||||||
|
python3 -m venv .venv
|
||||||
poetry install
|
poetry install
|
||||||
|
|
||||||
update: check-poetry ## update the sources and installation and generate "conf/requirements.txt"
|
update: check-poetry ## update the sources and installation and generate "conf/requirements.txt"
|
||||||
|
python3 -m venv .venv
|
||||||
poetry self update
|
poetry self update
|
||||||
poetry update -v
|
poetry update -v
|
||||||
poetry install
|
poetry install
|
||||||
|
|
|
@ -15,7 +15,7 @@ from django_yunohost_integration.base_settings import * # noqa:F401,F403
|
||||||
from django_yunohost_integration.secret_key import get_or_create_secret as __get_or_create_secret
|
from django_yunohost_integration.secret_key import get_or_create_secret as __get_or_create_secret
|
||||||
|
|
||||||
|
|
||||||
# https://github.com/jedie/django-example/
|
# https://github.com/jedie/django_example/
|
||||||
from django_example.settings.prod import * # noqa:F401,F403 isort:skip
|
from django_example.settings.prod import * # noqa:F401,F403 isort:skip
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
[](https://github.com/YunoHost-Apps/django_example_ynh/actions/workflows/pytest.yml) [](https://github.com/YunoHost-Apps/django_example_ynh/actions/workflows/package_linter.yml)
|
[](https://github.com/YunoHost-Apps/django_example_ynh/actions/workflows/tests.yml)
|
||||||
|
[](https://codecov.io/github/jedie/django_example_ynh)
|
||||||
|
[](https://pypi.org/project/django_example_ynh/)
|
||||||
|
[](https://github.com/YunoHost-Apps/django_example_ynh/blob/main/pyproject.toml)
|
||||||
|
[](https://github.com/YunoHost-Apps/django_example_ynh/blob/main/LICENSE)
|
||||||
|
|
||||||
Demo [YunoHost Application](https://install-app.yunohost.org/?app=django_example_ynh) to demonstrate the integration of a [Python](https://www.python.org/)/[Django](https://www.djangoproject.com/) project under YunoHost using [django_yunohost_integration](https://github.com/YunoHost-Apps/django_yunohost_integration).
|
Demo [YunoHost Application](https://install-app.yunohost.org/?app=django_example_ynh) to demonstrate the integration of a [Python](https://www.python.org/)/[Django](https://www.djangoproject.com/) project under YunoHost using [django_yunohost_integration](https://github.com/YunoHost-Apps/django_yunohost_integration).
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,20 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "django_example_ynh"
|
name = "django_example_ynh"
|
||||||
version = "0.1.0rc0~ynh1"
|
version = "0.1.0rc0+ynh1"
|
||||||
description = "Demo YunoHost Application to demonstrate the integration of a Django project under YunoHost."
|
description = "Demo YunoHost Application to demonstrate the integration of a Django project under YunoHost."
|
||||||
authors = ["Jens Diemer <django_example_ynh@jensdiemer.de>"]
|
authors = ["Jens Diemer <django_example_ynh@jensdiemer.de>"]
|
||||||
license = "GPL-3.0"
|
|
||||||
homepage = "https://github.com/YunoHost-Apps/django_example_ynh"
|
homepage = "https://github.com/YunoHost-Apps/django_example_ynh"
|
||||||
|
license = "GPL-3.0"
|
||||||
|
readme = 'README.md'
|
||||||
|
|
||||||
[tool.poetry.urls]
|
[tool.poetry.urls]
|
||||||
"Bug Tracker" = "https://github.com/YunoHost-Apps/django_example_ynh/issues"
|
"Bug Tracker" = "https://github.com/YunoHost-Apps/django_example_ynh/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)
|
||||||
|
#
|
||||||
django_example = ">=0.1.0rc0" # https://github.com/jedie/django-example
|
django_example = ">=0.1.0rc0" # https://github.com/jedie/django-example
|
||||||
|
#
|
||||||
# extras "ynh" will install: gunicorn, psycopg2, django-redis and django-axes
|
# extras "ynh" will install: gunicorn, psycopg2, django-redis and django-axes
|
||||||
# see: https://github.com/YunoHost-Apps/django_yunohost_integration/blob/main/pyproject.toml
|
# see: https://github.com/YunoHost-Apps/django_yunohost_integration/blob/main/pyproject.toml
|
||||||
django_yunohost_integration = {version = ">=0.5.0rc1", extras = ["ynh"]} # https://github.com/YunoHost-Apps/django_yunohost_integration
|
django_yunohost_integration = {version = ">=0.5.0rc1", extras = ["ynh"]} # https://github.com/YunoHost-Apps/django_yunohost_integration
|
||||||
|
@ -22,16 +23,21 @@ django_yunohost_integration = {version = ">=0.5.0rc1", extras = ["ynh"]} # http
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
bx_py_utils = "*" # https://github.com/boxine/bx_py_utils
|
bx_py_utils = "*" # https://github.com/boxine/bx_py_utils
|
||||||
bx_django_utils = "*" # https://github.com/boxine/bx_django_utils
|
bx_django_utils = "*" # https://github.com/boxine/bx_django_utils
|
||||||
tox = "*"
|
tox = "*" # https://github.com/tox-dev/tox
|
||||||
|
coveralls = "*" # http://github.com/TheKevJames/coveralls-python
|
||||||
|
darker = "*" # https://github.com/akaihola/pytest-darker
|
||||||
|
isort = "*" # https://github.com/pycqa/isort
|
||||||
|
flake8 = "*" # https://github.com/pycqa/flake8
|
||||||
|
EditorConfig = "*" # https://github.com/editorconfig/editorconfig-core-py
|
||||||
|
safety = "*" # https://github.com/pyupio/safety
|
||||||
|
mypy = "*" # https://github.com/python/mypy
|
||||||
|
tomli = "*" # https://github.com/hukkin/tomli
|
||||||
|
twine = "*" # https://github.com/pypa/twine
|
||||||
|
poetry-publish = "*" # https://github.com/jedie/poetry-publish
|
||||||
pytest = "*"
|
pytest = "*"
|
||||||
pytest-cov = "*"
|
pytest-cov = "*"
|
||||||
pytest-django = "*"
|
pytest-django = "*"
|
||||||
pytest-darker = "*" # https://github.com/akaihola/pytest-darker
|
pytest-darker = "*" # https://github.com/akaihola/pytest-darker
|
||||||
coveralls = "*"
|
|
||||||
isort = "*"
|
|
||||||
flake8 = "*"
|
|
||||||
EditorConfig = "*" # https://github.com/editorconfig/editorconfig-core-py
|
|
||||||
safety = "*" # https://github.com/pyupio/safety
|
|
||||||
requests = "*" # https://github.com/psf/requests
|
requests = "*" # https://github.com/psf/requests
|
||||||
packaging = "*" # https://github.com/pypa/packagi
|
packaging = "*" # https://github.com/pypa/packagi
|
||||||
beautifulsoup4 = "*" # https://pypi.org/project/beautifulsoup4/
|
beautifulsoup4 = "*" # https://pypi.org/project/beautifulsoup4/
|
||||||
|
@ -62,7 +68,7 @@ log_level = "INFO"
|
||||||
# https://pycqa.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format
|
# https://pycqa.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format
|
||||||
atomic=true
|
atomic=true
|
||||||
profile='black'
|
profile='black'
|
||||||
skip_glob=["*/htmlcov/*","*/migrations/*","*/local_test/*"]
|
skip_glob=[".*", "*/htmlcov/*","*/migrations/*","*/local_test/*"]
|
||||||
known_first_party=['django_example']
|
known_first_party=['django_example']
|
||||||
line_length=100
|
line_length=100
|
||||||
lines_after_imports=2
|
lines_after_imports=2
|
||||||
|
@ -96,7 +102,7 @@ addopts = """
|
||||||
|
|
||||||
|
|
||||||
[tool.coverage.run]
|
[tool.coverage.run]
|
||||||
omit = [".*"]
|
omit = ['.*', '*/tests/*']
|
||||||
|
|
||||||
|
|
||||||
[tool.tox]
|
[tool.tox]
|
||||||
|
@ -122,6 +128,7 @@ cookiecutter_template = "https://github.com/jedie/cookiecutter_templates/"
|
||||||
cookiecutter_directory = "yunohost_django_package"
|
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
|
||||||
]
|
]
|
||||||
|
|
||||||
[manageprojects.cookiecutter_context.cookiecutter]
|
[manageprojects.cookiecutter_context.cookiecutter]
|
||||||
|
@ -137,6 +144,7 @@ bug_tracker_url = "https://github.com/jedie/django-example/issues"
|
||||||
upstream_version = "0.1.0rc0"
|
upstream_version = "0.1.0rc0"
|
||||||
ynh_version = "1"
|
ynh_version = "1"
|
||||||
description = "Demo YunoHost Application to demonstrate the integration of a Django project under YunoHost."
|
description = "Demo YunoHost Application to demonstrate the integration of a Django project under YunoHost."
|
||||||
|
package_description = "Demo YunoHost Application to demonstrate the integration of a Django project under YunoHost."
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
_template = "https://github.com/jedie/cookiecutter_templates/"
|
_template = "https://github.com/jedie/cookiecutter_templates/"
|
||||||
_output_dir = "~/repos_ynh/django_example_ynh"
|
_output_dir = "~/repos_ynh/django_example_ynh"
|
||||||
|
|
|
@ -11,7 +11,6 @@ import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import django
|
import django
|
||||||
|
|
||||||
from django_yunohost_integration.local_test import create_local_test
|
from django_yunohost_integration.local_test import create_local_test
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ from django.contrib.auth.models import User
|
||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
from django.test.testcases import TestCase
|
from django.test.testcases import TestCase
|
||||||
from django.urls.base import reverse
|
from django.urls.base import reverse
|
||||||
|
|
||||||
from django_yunohost_integration.test_utils import generate_basic_auth
|
from django_yunohost_integration.test_utils import generate_basic_auth
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ from bx_django_utils.test_utils.html_assertion import (
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test.testcases import TestCase
|
from django.test.testcases import TestCase
|
||||||
from django.urls.base import reverse
|
from django.urls.base import reverse
|
||||||
|
|
||||||
from django_example import __version__
|
from django_example import __version__
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +29,7 @@ class ExampleProjectTestCase(HtmlAssertionMixin, TestCase):
|
||||||
response,
|
response,
|
||||||
parts=(
|
parts=(
|
||||||
f'<h2>YunoHost Django Example Project v{__version__}</h2>',
|
f'<h2>YunoHost Django Example Project v{__version__}</h2>',
|
||||||
'<p>Go to <a href="/app_path/admin/">Django Admin</a>.</p>',
|
'<li><a href="/app_path/admin/">Django Admin</a></li>',
|
||||||
'<p>Log in to see more information</p>',
|
'<p>Log in to see more information</p>',
|
||||||
'<tr><td>User:</td><td>AnonymousUser</td></tr>',
|
'<tr><td>User:</td><td>AnonymousUser</td></tr>',
|
||||||
'<tr><td>META:</td><td></td></tr>',
|
'<tr><td>META:</td><td></td></tr>',
|
||||||
|
@ -56,7 +57,7 @@ class ExampleProjectTestCase(HtmlAssertionMixin, TestCase):
|
||||||
response,
|
response,
|
||||||
parts=(
|
parts=(
|
||||||
f'<h2>YunoHost Django Example Project v{__version__}</h2>',
|
f'<h2>YunoHost Django Example Project v{__version__}</h2>',
|
||||||
'<p>Go to <a href="/app_path/admin/">Django Admin</a>.</p>',
|
'<li><a href="/app_path/admin/">Django Admin</a></li>',
|
||||||
'<tr><td>User:</td><td>test</td></tr>',
|
'<tr><td>User:</td><td>test</td></tr>',
|
||||||
f'<tr><td>Process ID:</td><td>{os.getpid()}</td></tr>',
|
f'<tr><td>Process ID:</td><td>{os.getpid()}</td></tr>',
|
||||||
),
|
),
|
||||||
|
|
|
@ -64,6 +64,14 @@
|
||||||
AnonymousUser
|
AnonymousUser
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Remote Address:
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
127.0.0.1
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
Process User:
|
Process User:
|
||||||
|
@ -135,7 +143,7 @@
|
||||||
<hr/>
|
<hr/>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://github.com/jedie/django-example">
|
<a href="https://github.com/jedie/django-example">
|
||||||
github.com/jedie/django-example
|
github.com/jedie/django_example
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,10 +8,10 @@ import tomli
|
||||||
from bx_django_utils.filename import clean_filename
|
from bx_django_utils.filename import clean_filename
|
||||||
from bx_py_utils.path import assert_is_dir, assert_is_file
|
from bx_py_utils.path import assert_is_dir, assert_is_file
|
||||||
from django_tools.unittest_utils.project_setup import check_editor_config
|
from django_tools.unittest_utils.project_setup import check_editor_config
|
||||||
|
|
||||||
import django_yunohost_integration
|
|
||||||
from django_yunohost_integration.test_utils import assert_project_version
|
from django_yunohost_integration.test_utils import assert_project_version
|
||||||
|
|
||||||
|
from django_example import __version__
|
||||||
|
|
||||||
|
|
||||||
PACKAGE_ROOT = Path(__file__).parent.parent
|
PACKAGE_ROOT = Path(__file__).parent.parent
|
||||||
|
|
||||||
|
@ -25,17 +25,17 @@ def assert_file_contains_string(file_path, string):
|
||||||
|
|
||||||
|
|
||||||
def test_version():
|
def test_version():
|
||||||
upstream_version = django_yunohost_integration.__version__
|
|
||||||
|
|
||||||
assert_project_version(
|
assert_project_version(
|
||||||
current_version=upstream_version,
|
current_version=__version__,
|
||||||
github_project_url='https://github.com/YunoHost-Apps/django_yunohost_integration',
|
github_project_url='https://github.com/jedie/django-example',
|
||||||
)
|
)
|
||||||
|
|
||||||
pyproject_toml_path = Path(PACKAGE_ROOT, 'pyproject.toml')
|
pyproject_toml_path = Path(PACKAGE_ROOT, 'pyproject.toml')
|
||||||
pyproject_toml = tomli.loads(pyproject_toml_path.read_text(encoding='UTF-8'))
|
pyproject_toml = tomli.loads(pyproject_toml_path.read_text(encoding='UTF-8'))
|
||||||
pyproject_version = pyproject_toml['tool']['poetry']['version']
|
pyproject_version = pyproject_toml['tool']['poetry']['version']
|
||||||
assert pyproject_version.startswith(f'{upstream_version}+ynh')
|
assert pyproject_version.startswith(f'{__version__}+ynh'), (
|
||||||
|
f'{pyproject_version!r} does not start with "{__version__}+ynh"'
|
||||||
|
)
|
||||||
|
|
||||||
# pyproject.toml needs a PEP 440 conform version and used "+ynh"
|
# pyproject.toml needs a PEP 440 conform version and used "+ynh"
|
||||||
# the YunoHost syntax is: "~ynh", just "convert this:
|
# the YunoHost syntax is: "~ynh", just "convert this:
|
||||||
|
|
Loading…
Add table
Reference in a new issue