Merge branch 'hotfix/0.2.1'
This commit is contained in:
commit
678da4d62b
8 changed files with 31 additions and 12 deletions
|
@ -6,16 +6,26 @@ Caches events using `timed_alru_cache`.
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
from datetime import UTC, datetime
|
||||||
from typing import Annotated, Self
|
from typing import Annotated, Self
|
||||||
|
|
||||||
from pydantic import BaseModel, ConfigDict, StringConstraints
|
from pydantic import AfterValidator, BaseModel, ConfigDict, StringConstraints
|
||||||
from vobject.base import Component
|
from vobject.base import Component
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
type StrippedStr = Annotated[str, StringConstraints(strip_whitespace=True)]
|
type StrippedStr = Annotated[str, StringConstraints(strip_whitespace=True)]
|
||||||
|
|
||||||
|
|
||||||
|
def make_utc(v: datetime) -> datetime:
|
||||||
|
if v.tzinfo is None:
|
||||||
|
return v.replace(tzinfo=UTC)
|
||||||
|
|
||||||
|
return v
|
||||||
|
|
||||||
|
|
||||||
|
type UTCDateTime = Annotated[datetime, AfterValidator(make_utc)]
|
||||||
|
|
||||||
|
|
||||||
@functools.total_ordering
|
@functools.total_ordering
|
||||||
class CalEvent(BaseModel):
|
class CalEvent(BaseModel):
|
||||||
"""
|
"""
|
||||||
|
@ -31,8 +41,8 @@ class CalEvent(BaseModel):
|
||||||
|
|
||||||
summary: StrippedStr = ""
|
summary: StrippedStr = ""
|
||||||
description: StrippedStr = ""
|
description: StrippedStr = ""
|
||||||
dtstart: datetime = datetime.now()
|
dtstart: UTCDateTime = datetime.now(UTC)
|
||||||
dtend: datetime = datetime.now()
|
dtend: UTCDateTime = datetime.now(UTC)
|
||||||
|
|
||||||
def __lt__(self, other: Self) -> bool:
|
def __lt__(self, other: Self) -> bool:
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime, timedelta
|
from datetime import UTC, datetime, timedelta
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
from asyncify import asyncify
|
from asyncify import asyncify
|
||||||
|
@ -69,7 +69,7 @@ class CalDAV:
|
||||||
_logger.info(f"downloading {calendar_name!r} ...")
|
_logger.info(f"downloading {calendar_name!r} ...")
|
||||||
|
|
||||||
dt_start = datetime.combine(
|
dt_start = datetime.combine(
|
||||||
datetime.now().date(),
|
datetime.now(UTC).date(),
|
||||||
datetime.min.time(),
|
datetime.min.time(),
|
||||||
)
|
)
|
||||||
dt_end = dt_start + timedelta(days=cfg.calendar.future_days)
|
dt_end = dt_start + timedelta(days=cfg.calendar.future_days)
|
||||||
|
|
|
@ -3,7 +3,7 @@ authors = ["Jörn-Michael Miehe <jmm@yavook.de>"]
|
||||||
description = ""
|
description = ""
|
||||||
include = ["ovdashboard_api/skel/*"]
|
include = ["ovdashboard_api/skel/*"]
|
||||||
name = "ovdashboard_api"
|
name = "ovdashboard_api"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
Markdown = "^3.5.1"
|
Markdown = "^3.5.1"
|
||||||
|
@ -25,8 +25,8 @@ webdavclient3 = "^3.14.6"
|
||||||
black = "^23.11.0"
|
black = "^23.11.0"
|
||||||
flake8 = "^6.1.0"
|
flake8 = "^6.1.0"
|
||||||
flake8-isort = "^6.1.1"
|
flake8-isort = "^6.1.1"
|
||||||
types-cachetools = "^5.3.0.7"
|
|
||||||
pytest = "^7.4.3"
|
pytest = "^7.4.3"
|
||||||
|
types-cachetools = "^5.3.0.7"
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
ovdashboard-api = "ovdashboard_api.main:main"
|
ovdashboard-api = "ovdashboard_api.main:main"
|
||||||
|
|
|
@ -7,6 +7,8 @@ script_dir="$( dirname "${script}" )"
|
||||||
&& git_status="developing"
|
&& git_status="developing"
|
||||||
git rev-parse --abbrev-ref HEAD | grep -E 'release|hotfix/' >/dev/null \
|
git rev-parse --abbrev-ref HEAD | grep -E 'release|hotfix/' >/dev/null \
|
||||||
&& git_status="releasing"
|
&& git_status="releasing"
|
||||||
|
git rev-parse --abbrev-ref HEAD | grep -E 'master' >/dev/null \
|
||||||
|
&& git_status="released"
|
||||||
|
|
||||||
|
|
||||||
if [ "${git_status}" = "developing" ]; then
|
if [ "${git_status}" = "developing" ]; then
|
||||||
|
@ -23,6 +25,13 @@ elif [ "${git_status}" = "releasing" ]; then
|
||||||
git rev-parse --abbrev-ref HEAD \
|
git rev-parse --abbrev-ref HEAD \
|
||||||
| cut -d '/' -f 2
|
| cut -d '/' -f 2
|
||||||
)"
|
)"
|
||||||
|
elif [ "${git_status}" = "released" ]; then
|
||||||
|
echo "Status: Released"
|
||||||
|
# => version from current tag
|
||||||
|
git_version="$( \
|
||||||
|
git describe --tags \
|
||||||
|
| sed -E 's/^v[^0-9]*((0|[1-9][0-9]*)[0-9\.]*[0-9])$/\1/'
|
||||||
|
)"
|
||||||
else
|
else
|
||||||
echo "ERROR: Invalid git branch"
|
echo "ERROR: Invalid git branch"
|
||||||
echo "ERROR: Chores cannot be run on '$( git rev-parse --abbrev-ref HEAD )'!"
|
echo "ERROR: Chores cannot be run on '$( git rev-parse --abbrev-ref HEAD )'!"
|
||||||
|
|
|
@ -8,7 +8,7 @@ script_dir="$( dirname "${script}" )"
|
||||||
|
|
||||||
# vars defined in `check_version` script
|
# vars defined in `check_version` script
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
if [ "${git_status}" = "releasing" ]; then
|
if [ "${git_status}" = "releasing" ] || [ "${git_status}" = "released" ]; then
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
image_tag="${git_version}"
|
image_tag="${git_version}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -11,7 +11,7 @@ services:
|
||||||
- "127.0.0.1:6379:6379"
|
- "127.0.0.1:6379:6379"
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: code.yavook.de/oekzident.de/ovdashboard:0.2.0
|
image: code.yavook.de/oekzident.de/ovdashboard:0.2.1
|
||||||
restart: always
|
restart: always
|
||||||
pull_policy: always
|
pull_policy: always
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#########
|
#########
|
||||||
|
|
||||||
# env setup
|
# env setup
|
||||||
ovd_version="0.2.0"
|
ovd_version="0.2.1"
|
||||||
export DEBIAN_FRONTEND="noninteractive"
|
export DEBIAN_FRONTEND="noninteractive"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ovdashboard-ui",
|
"name": "ovdashboard-ui",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
|
|
Loading…
Reference in a new issue