Skip to content

Commit

Permalink
Prepare for v2.5 release
Browse files Browse the repository at this point in the history
  • Loading branch information
cuu508 committed Jul 1, 2023
1 parent 7015a85 commit 0bc4031
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog
All notable changes to this project will be documented in this file.

## 2.5-dev - Unreleased
## 2.5 - 2023-07-01
- Add support for "LW" in the day-of-month field (#1)

## 2.4.1 - 2023-04-27
Expand Down
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for x in range(0, 10):
print(next(it))
```

Outputs:
Produces:

```
2044-02-29 00:00:00
Expand All @@ -47,6 +47,40 @@ Outputs:
2292-02-29 00:00:00
```

If CronSim receives an invalid cron expression, it raises `cronsim.CronSimError`:

```python
from datetime import datetime
from cronsim import CronSim

CronSim("123 * * * *", datetime.now())
```

Produces:

```
cronsim.cronsim.CronSimError: Bad minute
```

If CronSim cannot find a matching datetime in the next 50 years from the start
date or from the previous match, it stops iteration by raising `StopIteration`:

```python
from datetime import datetime
from cronsim import CronSim

# Every minute of 1st and 21st of month,
# if it is also the *last Monday* of the month:
it = CronSim("* * */20 * 1L", datetime.now())
print(next(it))
```

Produces:

```
StopIteration
```

## CronSim Works With zoneinfo

CronSim starting from version 2.0 is designed to work with timezones provided by
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

setup(
name="cronsim",
version="2.4.1",
version="2.5",
url="https://github.com/cuu508/cronsim",
license="BSD",
author="Pēteris Caune",
author_email="cuu508@gmail.com",
author_email="cuu508@monkeyseemonkeydo.lv",
description="Cron expression parser and evaluator",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 0bc4031

Please sign in to comment.