-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from jedie/dev
Dev
- Loading branch information
Showing
16 changed files
with
957 additions
and
538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,5 @@ max_line_length = 119 | |
indent_style = tab | ||
insert_final_newline = false | ||
|
||
[*.yml] | ||
[{*.yaml,*.yml}] | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
import unittest.util | ||
from pathlib import Path | ||
|
||
from bx_py_utils.test_utils.deny_requests import deny_any_real_request | ||
|
||
|
||
def pre_configure_tests() -> None: | ||
print(f'Configure unittests via "load_tests Protocol" from {Path(__file__).relative_to(Path.cwd())}') | ||
|
||
# Hacky way to display more "assert"-Context in failing tests: | ||
_MIN_MAX_DIFF = unittest.util._MAX_LENGTH - unittest.util._MIN_DIFF_LEN | ||
unittest.util._MAX_LENGTH = int(os.environ.get('UNITTEST_MAX_LENGTH', 300)) | ||
unittest.util._MIN_DIFF_LEN = unittest.util._MAX_LENGTH - _MIN_MAX_DIFF | ||
|
||
# Deny any request via docket/urllib3 because tests they should mock all requests: | ||
deny_any_real_request() | ||
|
||
|
||
def load_tests(loader, tests, pattern): | ||
""" | ||
Use unittest "load_tests Protocol" as a hook to setup test environment before running tests. | ||
https://docs.python.org/3/library/unittest.html#load-tests-protocol | ||
""" | ||
pre_configure_tests() | ||
return loader.discover(start_dir=Path(__file__).parent, pattern=pattern) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,15 @@ | ||
from pathlib import Path | ||
from unittest import TestCase | ||
import os | ||
from unittest import TestCase, skipIf | ||
|
||
from bx_py_utils.auto_doc import assert_readme_block | ||
from cli_base.cli_tools.git_history import get_git_history | ||
|
||
import for_runners | ||
|
||
|
||
PACKAGE_ROOT = Path(for_runners.__file__).parent.parent | ||
from cli_base.cli_tools.git_history import update_readme_history | ||
|
||
|
||
class ReadmeHistoryTestCase(TestCase): | ||
@skipIf( | ||
# After a release the history may be "changed" because of version bump | ||
# and we should not block merge requests because of this. | ||
'GITHUB_ACTION' in os.environ, | ||
'Skip on github actions', | ||
) | ||
def test_readme_history(self): | ||
git_history = get_git_history( | ||
current_version=for_runners.__version__, | ||
add_author=False, | ||
) | ||
history = '\n'.join(git_history) | ||
assert_readme_block( | ||
readme_path=PACKAGE_ROOT / 'README.md', | ||
text_block=f'\n{history}\n', | ||
start_marker_line='[comment]: <> (✂✂✂ auto generated history start ✂✂✂)', | ||
end_marker_line='[comment]: <> (✂✂✂ auto generated history end ✂✂✂)', | ||
) | ||
update_readme_history(raise_update_error=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
name = "django-for-runners" | ||
dynamic = ["version"] | ||
description = "Store your GPX tracks of your running (or other sports activity) in django." | ||
license = {text = "GPL-3.0-or-later"} | ||
readme = "README.md" | ||
authors = [ | ||
{name = 'Jens Diemer', email = '[email protected]'} | ||
|
@@ -11,7 +12,7 @@ dependencies = [ | |
"colorlog", # https://github.com/borntyping/python-colorlog | ||
"gunicorn", # https://github.com/benoimyproject.wsgitc/gunicorn | ||
|
||
"django", | ||
"django>=4.2,<4.3", # TODO: Update to Django v5.0 ! | ||
"django-processinfo", # https://github.com/jedie/django-processinfo/ | ||
"django-debug-toolbar", # http://django-debug-toolbar.readthedocs.io/en/stable/changes.html | ||
"django-tools", # https://github.com/jedie/django-tools/ | ||
|
@@ -38,14 +39,15 @@ dependencies = [ | |
] | ||
[project.optional-dependencies] | ||
dev = [ | ||
"manage_django_project>=0.3.0rc0", # https://github.com/jedie/manage_django_project | ||
"manage_django_project>=0.6.4", # https://github.com/jedie/manage_django_project | ||
"tblib", # https://github.com/ionelmc/python-tblib | ||
"pip-tools", # https://github.com/jazzband/pip-tools/ | ||
"tox", # https://github.com/tox-dev/tox | ||
"coverage", # https://github.com/nedbat/coveragepy | ||
"autopep8", # https://github.com/hhatto/autopep8 | ||
"pyupgrade", # https://github.com/asottile/pyupgrade | ||
"flake8", # https://github.com/pycqa/flake8 | ||
"flake8-bugbear", # https://github.com/PyCQA/flake8-bugbear | ||
"pyflakes", # https://github.com/PyCQA/pyflakes | ||
"codespell", # https://github.com/codespell-project/codespell | ||
"EditorConfig", # https://github.com/editorconfig/editorconfig-core-py | ||
|
@@ -80,6 +82,7 @@ Source = "https://github.com/jedie/django-for-runners" | |
|
||
|
||
[project.scripts] | ||
# Must be set in ./manage.py and PROJECT_SHELL_SCRIPT: | ||
for_runners_project = "for_runners_project.__main__:main" | ||
|
||
[manage_django_project] | ||
|
@@ -104,6 +107,10 @@ include = ["for_runners*", "for_runners_project*"] | |
version = {attr = "for_runners.__version__"} | ||
|
||
|
||
[tool.cli_base] | ||
version_module_name = "for_runners" # Used by update_readme_history() | ||
|
||
|
||
[tool.darker] | ||
src = ['.'] | ||
revision = "origin/main..." | ||
|
@@ -191,13 +198,15 @@ applied_migrations = [ | |
"89aadc0", # 2023-03-17T09:44:50+01:00 | ||
"2281f4b", # 2023-04-02T17:40:58+02:00 | ||
"10c547a", # 2023-04-04T20:37:52+02:00 | ||
"d65b082", # 2023-12-17T12:51:22+01:00 | ||
] | ||
|
||
[manageprojects.cookiecutter_context.cookiecutter] | ||
full_name = "Jens Diemer" | ||
github_username = "jedie" | ||
author_email = "[email protected]" | ||
package_name = "for_runners" | ||
project_name = "django-for-runners" | ||
package_version = "0.16.0rc2" | ||
package_description = "Store your GPX tracks of your running (or other sports activity) in django." | ||
package_url = "https://github.com/jedie/django-for-runners" | ||
|
Oops, something went wrong.