Skip to content

Commit

Permalink
vendor croniter (#27045)
Browse files Browse the repository at this point in the history
Summary:
The author of croniter has stated their intention to abandon the project
and potentially remove it from PyPI. Guard against future breakages by
vendoring.

Test Plan: BK

## Changelog
The `croniter` package is now vendored in dagster.
  • Loading branch information
gibsondan authored Jan 11, 2025
1 parent 32dc531 commit 012a428
Show file tree
Hide file tree
Showing 8 changed files with 1,400 additions and 5 deletions.
1 change: 0 additions & 1 deletion docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"airflow",
"azure",
"coloredlogs",
"croniter",
"dask",
"databricks",
"databricks_api",
Expand Down
1 change: 1 addition & 0 deletions python_modules/dagster/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include LICENSE
include COPYING
include dagster/py.typed
include dagster/_grpc/__generated__/api_pb2.pyi
include dagster/_vendored/croniter/LICENSE
include dagster/_vendored/dateutil/LICENSE
exclude python_modules/dagster/dagster/_core/types/ruff.toml
recursive-include dagster *.md
Expand Down
3 changes: 1 addition & 2 deletions python_modules/dagster/dagster/_utils/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
from collections.abc import Iterator, Sequence
from typing import Optional, Union

from croniter import croniter as _croniter

import dagster._check as check
from dagster._core.definitions.partition import ScheduleType
from dagster._time import get_timezone
from dagster._vendored.croniter import croniter as _croniter
from dagster._vendored.dateutil.relativedelta import relativedelta
from dagster._vendored.dateutil.tz import datetime_ambiguous, datetime_exists

Expand Down
1 change: 1 addition & 0 deletions python_modules/dagster/dagster/_vendored/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A package could be a good candidate for vendoring if it is relatively small and
Currently vendored packages:

- dateutil is vendored at the 2.9.0post0 release: https://pypi.org/project/python-dateutil/2.9.0.post0/ due to being frequently imported from two different pypi packages, https://pypi.org/project/python-dateutil/ and https://pypi.org/project/py-dateutil/, sometimes simultaneously (including in the default AWS EMR python environment as of June 2024)
- croniter is vendored at the 6.0.0 release: https://pypi.org/project/croniter/6.0.0/ due to the author planning to remove it from PyPI.

To vendor a package:

Expand Down
7 changes: 7 additions & 0 deletions python_modules/dagster/dagster/_vendored/croniter/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (C) 2010-2012 Matsumoto Taichi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 changes: 25 additions & 0 deletions python_modules/dagster/dagster/_vendored/croniter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import

from . import croniter as cron_m
from .croniter import (
DAY_FIELD,
HOUR_FIELD,
MINUTE_FIELD,
MONTH_FIELD,
OVERFLOW32B_MODE,
SECOND_FIELD,
UTC_DT,
YEAR_FIELD,
CroniterBadCronError,
CroniterBadDateError,
CroniterBadTypeRangeError,
CroniterError,
CroniterNotAlphaError,
CroniterUnsupportedSyntaxError,
croniter,
croniter_range,
datetime_to_timestamp,
)

croniter.__name__ # make flake8 happy
Loading

2 comments on commit 012a428

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagster-docs ready!

✅ Preview
https://dagster-docs-auzwpyakw-elementl.vercel.app
https://master.dagster.dagster-docs.io

Built with commit 012a428.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

@github-actions github-actions bot commented on 012a428 Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagster-docs-beta ready!

✅ Preview
https://dagster-docs-beta-gdtzvezo7-elementl.vercel.app

Built with commit 012a428.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.