ci: add pre-commit and tests workflows
All checks were successful
checks / pre-commit (push) Successful in 1m39s
checks / tests-10 (push) Successful in 1m17s
checks / tests-11 (push) Successful in 1m10s
checks / tests-12 (push) Successful in 1m13s

This commit is contained in:
cătălin 2024-08-04 15:23:55 +02:00
commit bdb5c984fa
No known key found for this signature in database
13 changed files with 339 additions and 297 deletions

View file

@ -2,14 +2,16 @@ import sys
from collections.abc import Callable
from functools import wraps
import pendulum
from pendulum.tz import local_timezone
from rich import print
from whenever import Instant
def now():
tz = local_timezone()
return pendulum.now(tz) # type: ignore[reportArgumentType]
return Instant.now()
def now_as_date():
return now().py_datetime().date()
def capture(fn: Callable):