Skip to content

Add tasktiger[cron] extra for croniter and pytz#372

Open
aaroncoville wants to merge 1 commit intocloseio:masterfrom
aaroncoville:fix/add-tasktiger-cron
Open

Add tasktiger[cron] extra for croniter and pytz#372
aaroncoville wants to merge 1 commit intocloseio:masterfrom
aaroncoville:fix/add-tasktiger-cron

Conversation

@aaroncoville
Copy link
Copy Markdown

Summary

  • Added extras_require={"cron": ["croniter>=2.0", "pytz>=2024.1"]} to setup.py.
  • tasktiger.schedule.cron_expr now raises a clear ImportError pointing users at pip install tasktiger[cron] when either dependency is missing (previously a basic ModuleNotFoundError).
  • Documented the tasktiger[cron] install path in the cron_expr section of README.rst.
  • Added tests/test_schedule_cron.py covering the happy path and both missing-dependency paths.
  • Rolled up under the 0.25.1 CHANGELOG.md entry from my earlier PR.
    • Will require a minor merge of this document

Reproduction (before the fix)

python -m venv /tmp/tt-base
/tmp/tt-base/bin/pip install tasktiger==0.25.0
/tmp/tt-base/bin/python -c "
import datetime
from tasktiger.schedule import cron_expr
fn, args = cron_expr('0 * * * *')
fn(datetime.datetime(2026, 1, 1, 0, 30), *args)
"
# → ModuleNotFoundError: No module named 'croniter'

Verification (after the fix)

Extras install works end-to-end:

python -m venv /tmp/tt-extra && /tmp/tt-extra/bin/pip install '.[cron]'
/tmp/tt-extra/bin/python -c "
import datetime
from tasktiger.schedule import cron_expr
fn, args = cron_expr('0 * * * *')
print(fn(datetime.datetime(2026, 1, 1, 0, 30), *args))
"
# → 2026-01-01 01:00:00

Base install now produces a clear error:

ImportError: tasktiger.schedule.cron_expr requires the 'croniter' and 'pytz' packages (missing: 'croniter'). Install them with: pip install tasktiger[cron]

@aaroncoville aaroncoville changed the title Add tasktiger[cron] extra for crofter and pytz Add tasktiger[cron] extra for croniter and pytz Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant