Skip to content

Commit

Permalink
0.1.8 (#10)
Browse files Browse the repository at this point in the history
- fix #9
- Dependency update
  • Loading branch information
spacemanspiff2007 committed Dec 14, 2022
1 parent c129713 commit eeb62c8
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .gitignore
@@ -1,8 +1,8 @@
/.mypy_cache
/.pytest_cache
**/.mypy_cache
**/.pytest_cache
/.idea

__pycache__
**/__pycache__

/build
/venv
Expand Down
6 changes: 5 additions & 1 deletion readme.md
Expand Up @@ -5,7 +5,7 @@
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/eascheduler)

[![PyPI](https://img.shields.io/pypi/v/eascheduler)]((https://pypi.org/project/EAScheduler/))
[![Downloads](https://pepy.tech/badge/eascheduler/month)](https://pepy.tech/project/eascheduler/month)
[![Downloads](https://pepy.tech/badge/eascheduler/month)](https://pepy.tech/project/eascheduler)



Expand All @@ -19,6 +19,10 @@ Easy Async Scheduler (or EAScheduler) is a lightweight asyncio scheduler with a

## Changelog

#### 0.18 (14.12.2022)
- Fix for OneTimeJOb incorrectly showing a remaining time after the execution
- Dependency update

#### 0.1.7 (27.07.2022)
- Added py.typed

Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Expand Up @@ -2,13 +2,13 @@
-r requirements_setup.txt

# Testing
pytest >= 7.1, < 7.2
pytest-asyncio >= 0.19 , < 0.20
pytest >= 7.2, < 7.3
pytest-asyncio >= 0.20 , < 0.21

# Docs
sphinx >= 5.1, < 5.2
sphinx_autodoc_typehints >= 1.18, < 1.19
sphinx_rtd_theme == 1.0.0
sphinx >= 5.3, < 5.4
sphinx_autodoc_typehints >= 1.19, < 1.20
sphinx_rtd_theme == 1.1.1

# static checker
mypy >= 0.971
mypy >= 0.991
2 changes: 1 addition & 1 deletion requirements_setup.txt
@@ -1,3 +1,3 @@
# Requirements to install and use this library
pendulum == 2.1.2
astral == 2.2
astral == 3.2
2 changes: 1 addition & 1 deletion src/eascheduler/__version__.py
@@ -1 +1 @@
__version__ = '0.1.7'
__version__ = '0.1.8'
2 changes: 2 additions & 0 deletions src/eascheduler/jobs/job_one_time.py
Expand Up @@ -3,6 +3,7 @@
from datetime import timedelta
from typing import Union

from eascheduler.const import FAR_FUTURE
from eascheduler.jobs.job_base import get_first_timestamp, ScheduledJobBase


Expand All @@ -12,4 +13,5 @@ def _schedule_first_run(self, first_run: Union[None, int, float, timedelta, dt_t
self._set_next_run(get_first_timestamp(first_run))

def _schedule_next_run(self):
self._next_run = FAR_FUTURE
self._parent = None
19 changes: 19 additions & 0 deletions tests/jobs/test_job_onetime.py
Expand Up @@ -50,6 +50,23 @@ async def test_init():
j.cancel()


async def test_next_run():
set_now(2001, 1, 1, 12, 0, 0)

s = AsyncScheduler()
j = OneTimeJob(s, SyncExecutor(lambda: 1 / 0))

j._schedule_first_run(None)

assert j.remaining() is not None
assert j._parent is not None
cmp_local(j._next_run, datetime(2001, 1, 1, 12, 0, 0))

j._schedule_next_run()
assert j._parent is None
assert j.remaining() is None


async def test_func_remaining():
set_now(2001, 1, 1, 12, 0, 0)

Expand All @@ -69,3 +86,5 @@ async def test_func_remaining():
assert j.remaining() == timedelta(hours=2)

j.cancel()

assert j.remaining() is None
2 changes: 1 addition & 1 deletion tests/jobs/test_job_sun.py
Expand Up @@ -16,7 +16,7 @@
[
(DawnJob, time( 6, 34, 4), time( 6, 12, 6)),
(SunriseJob, time( 7, 15, 39), time( 6, 49, 53)),
(SunsetJob, time(15, 4, 48), time(15, 50, 24)),
(SunsetJob, time(15, 4, 49), time(15, 50, 25)),
(DuskJob, time(15, 46, 23), time(16, 28, 14)),
]
)
Expand Down

0 comments on commit eeb62c8

Please sign in to comment.