Skip to content

Commit 06b938e

Browse files
authored
Merge pull request #27 from grumBit/python-and-package-upgrades
Python and package upgrades
2 parents 9be3dcf + 5ee233e commit 06b938e

File tree

8 files changed

+72
-72
lines changed

8 files changed

+72
-72
lines changed

.github/workflows/publish-to-test-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99

1010
steps:
1111
- uses: actions/checkout@master
12-
- name: 🐍 Set up Python 3.7
12+
- name: 🐍 Set up Python 3.10
1313
uses: actions/setup-python@v3
1414
with:
15-
python-version: "3.7"
15+
python-version: "3.10"
1616
- name: 🛠 Install dev requirements
1717
run: >-
1818
python -m

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7
1+
3.10

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# AWSCronExpressionValidator
1212

13-
Validates these [AWS EventBridge cron expressions](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html#eb-cron-expressions), which are similar to, but not compatible with Unix style cron expressions;
13+
Validates these [AWS EventBridge cron expressions](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-cron-expressions.html), which are similar to, but not compatible with Unix style cron expressions;
1414

1515
| Field | Values | Wildcards |
1616
| :----------- | :-------------- | :------------- |
@@ -21,7 +21,7 @@ Validates these [AWS EventBridge cron expressions](https://docs.aws.amazon.com/e
2121
| Day-of-week | 1-7 or SUN-SAT | , - \* ? L # |
2222
| Year | 1970-2199 | , - \* / |
2323

24-
_NB: It appears AWS is supporting the Quartz Job Scheduler cron expressions. More details than AWS provides is available in the [Cron Trigger Tutorial](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html)._
24+
- It appears AWS's wildcard support borrows heavily from Quartz Job Scheduler cron expressions. More documentation about wildcard handling than AWS provides is available in the [Cron Trigger Tutorial](http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/crontrigger.html). _NB: AWS doesn't support seconds (i.e. AWS has 6 fields, while Quartz has 7), so ignore the first field in the Quartz documenation._
2525

2626
This was inspired by Niloy Chakraborty's [AWSCronValidator.py](https://gist.github.com/ultrasonex/e1fdb8354408a56df91aa4902d17aa6a) project.
2727

RELEASENOTES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Release History
22

3+
### v.1.15 [2025-11-26]
4+
5+
- New;
6+
- Drop back to oldest supported version of Python.
7+
8+
### v.1.14 [2025-11-26]
9+
10+
- New;
11+
- Upgrade of Python from 3.7 to 3.13, and upgrade to latest packages.
12+
- Fixes;
13+
- [Address security alert from dependabot: Black vulnerable to Regular Expression Denial of Service (ReDoS)](https://github.com/grumBit/aws_cron_expression_validator/pull/27) when running the Black linter. _NB: The vulnerability was only related to linting during development. The aws-cron-expression-validator package itself was not impacted._
14+
315
### v1.1.13 [2024-02-08]
416

517
- Documentation change only;

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "aws_cron_expression_validator"
7-
version = "1.1.13"
7+
version = "1.1.15"
88
authors = [
99
{ name="Graham Coster", email="bitjugglers@gmail.com" },
1010
]
1111
description = "ValidatesAWS EventBridge cron expressions, which are similar to, but not compatible with Unix style cron expressions"
1212
readme = "README.md"
13-
requires-python = ">=3.7"
13+
requires-python = ">=3.10"
1414
classifiers = [
1515
"Development Status :: 5 - Production/Stable", # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
1616
"Programming Language :: Python :: 3",

requirements_dev.txt

Lines changed: 34 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,65 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.9
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.13
3+
# by the following command:
44
#
55
# pip-compile requirements_dev.in
66
#
7-
astroid==2.12.9
7+
astroid==4.0.2
88
# via pylint
9-
attrs==22.1.0
10-
# via pytest
11-
black==22.8.0
9+
black==25.11.0
1210
# via -r requirements_dev.in
13-
build==0.8.0
11+
build==1.3.0
1412
# via -r requirements_dev.in
15-
click==8.1.3
13+
click==8.3.1
1614
# via black
17-
coverage[toml]==6.4.4
15+
coverage[toml]==7.12.0
1816
# via pytest-cov
19-
dill==0.3.5.1
17+
dill==0.4.0
2018
# via pylint
21-
exceptiongroup==1.1.0
22-
# via pytest
23-
iniconfig==1.1.1
19+
iniconfig==2.3.0
2420
# via pytest
25-
isort==5.10.1
21+
isort==7.0.0
2622
# via pylint
27-
lazy-object-proxy==1.7.1
28-
# via astroid
2923
mccabe==0.7.0
3024
# via pylint
31-
mypy==0.971
25+
mypy==1.18.2
3226
# via -r requirements_dev.in
33-
mypy-extensions==0.4.3
27+
mypy-extensions==1.1.0
3428
# via
3529
# black
3630
# mypy
37-
packaging==21.3
31+
packaging==25.0
3832
# via
33+
# black
3934
# build
4035
# pytest
41-
pathspec==0.10.1
42-
# via black
43-
pep517==0.13.0
44-
# via build
45-
platformdirs==2.5.2
36+
pathspec==0.12.1
37+
# via
38+
# black
39+
# mypy
40+
platformdirs==4.5.0
4641
# via
4742
# black
4843
# pylint
49-
pluggy==1.0.0
44+
pluggy==1.6.0
45+
# via
46+
# pytest
47+
# pytest-cov
48+
pygments==2.19.2
5049
# via pytest
51-
pylint==2.15.2
50+
pylint==4.0.3
5251
# via -r requirements_dev.in
53-
pyparsing==3.0.9
54-
# via packaging
55-
pytest==7.2.2
52+
pyproject-hooks==1.2.0
53+
# via build
54+
pytest==9.0.1
5655
# via
5756
# -r requirements_dev.in
5857
# pytest-cov
59-
pytest-cov==3.0.0
58+
pytest-cov==7.0.0
6059
# via -r requirements_dev.in
61-
tomli==2.0.1
62-
# via
63-
# black
64-
# build
65-
# coverage
66-
# mypy
67-
# pep517
68-
# pylint
69-
# pytest
70-
tomlkit==0.11.4
60+
pytokens==0.3.0
61+
# via black
62+
tomlkit==0.13.3
7163
# via pylint
72-
typing-extensions==4.3.0
73-
# via
74-
# astroid
75-
# black
76-
# mypy
77-
# pylint
78-
wrapt==1.14.1
79-
# via astroid
64+
typing-extensions==4.15.0
65+
# via mypy

src/aws_cron_expression_validator/validator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class AWSCronExpressionDayOfWeekError(AWSCronExpressionError):
3232

3333

3434
class AWSCronExpressionValidator:
35-
3635
"""
3736
Validates these AWS EventBridge cron expressions, which are similar to, but not compatible with standard
3837
unix cron expressions:

tests/aws_cron_expression_validator/test_validator.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -190,22 +190,25 @@ def test_year_regex(self):
190190

191191
def test_validator(self):
192192
valid_expressions = [
193-
"0 18 ? * MON-FRI *",
194-
"0 18 ? * L *",
195-
"0 18 ? * SATL *",
196-
"0 18 L * ? *",
197-
"0 18 31W * ? *",
198-
"0 10 * * ? *",
199-
"15 12 * * ? *",
200-
"0 8 1 * ? *",
201-
"1/5 8-17 ? * Mon-Fri *",
202-
"0 9 ? * 2#1 *",
203-
"0 07/12 ? * * *",
204-
"10,20,30,40 07/12 ? * * *",
205-
"10 10,15,20,23 ? * * *",
206-
"10 10 15,30,31 * ? *",
207-
"10 10 15 JAN,JUL,DEC ? *",
208-
"10 10 31 04,09,12 ? *",
193+
"0 18 ? * MON-FRI *", # Fire at 6pm, on Mondays to Fridays
194+
"0 18 ? * L *", # Fire at 6pm, on Saturdays
195+
"0 18 ? * SATL *", # Fire at 6pm, on the last Saturday of every month
196+
"0 18 L * ? *", # Fire at 6pm, on the last day of every month
197+
"0 18 31W * ? *", # Fire at 6pm, on the nearest weekday to the 31st of the month
198+
"0 10 * * ? *", # Fire at 10am, on every day
199+
"15 12 * * ? *", # Fire at 12:15pm, on every day
200+
"0 8 1 * ? *", # Fire at 8am on the first day of every month
201+
"1/5 8-17 ? * Mon-Fri *", # Fire every 5 minutes, starting on the 1st minute
202+
# (i.e. 1st, 6th, 11th, 16th, 21st, 26th, 31st, 36th, 41st, 46th, 51st & 56th minutes),
203+
# from 8am to 5pm, Mondays to Fridays
204+
"0 9 ? * 2#1 *", # Fire at 9am, on the 1st Monday of the every month
205+
"0 07/12 ? * * *", # Fire every 12 hours, starting on the 7th hour (i.e. 7am and 7pm), every day.
206+
"10,20,30,40 07/12 ? * * *", # Fire on the 10th, 20th, 30th & 40th minutes, every 12 hours, starting
207+
# on the 7th hour (i.e. 7am and 7pm), every day.
208+
"10 10,15,20,23 ? * * *", # Fire at 10:10am, 3:10pm, 8:10pm & 11:10pm, every day
209+
"10 10 15,30,31 * ? *", # Fire at 10:10am on the 15th, 30th & 31st day of every month
210+
"10 10 15 JAN,JUL,DEC ? *", # Fire at 10:10am on the 15th day of January, July and December
211+
"10 10 31 04,09,12 ? *", # Fire at 10:10am on the 31st day of April, September and December
209212
"0,5 07/12 ? * 1,5,7 *",
210213
"0,5 07/12 ? * 1,5,7 2020,2021,2028,2199",
211214
"0,5 07/12 ? * 1,5,7 2020-2021,2028-2199",

0 commit comments

Comments
 (0)