Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace uses of celery.utils.time #245

Merged
merged 1 commit into from
May 19, 2023
Merged

Replace uses of celery.utils.time #245

merged 1 commit into from
May 19, 2023

Conversation

jkseppan
Copy link
Contributor

The FixedOffset and timezone imports were actually from pytz, which has been deprecated and therefore removed as a celery dependency. Instead, use zoneinfo in Python 3.9+ and backports.zoneinfo in earlier Python 3 versions to look up timezones by name, and use dateutil.timezone.utc and dateutil.timezone(timedelta(...)) to construct timezones that are a fixed offset from UTC.

For background and inspiration, see pganssle/pytz-deprecation-shim, but that is not necessary as a dependency for these uses.

Fixes #244.


This passes tests for me but I haven't run extensive experiments yet.

@jkseppan jkseppan changed the title Replace uses of celery.utlis.time Replace uses of celery.utils.time May 16, 2023
@sibson
Copy link
Owner

sibson commented May 18, 2023

Looks like requirements-dev.txt needs an update for backports.timezone for 3.8.

@sibson
Copy link
Owner

sibson commented May 18, 2023

fixes #219

The FixedOffset and timezone imports were actually from pytz, which has
been deprecated and therefore removed as a celery dependency. Instead,
use zoneinfo in Python 3.9+ and backports.zoneinfo in earlier Python 3
versions to look up timezones by name, and use dateutil.timezone.utc
and dateutil.timezone(timedelta(...)) to construct timezones that are a
fixed offset from UTC.

For background and inspiration, see pganssle/pytz-deprecation-shim, but
that is not necessary as a dependency for these uses.

Fixes sibson#244.
@jkseppan
Copy link
Contributor Author

I pushed a new version that adds the requirement to requirements-dev.txt and fixes the import order flagged by the linter.

@sibson sibson merged commit 4240e17 into sibson:main May 19, 2023
miketheman added a commit to miketheman/redbeat that referenced this pull request Jun 12, 2023
Was implicitly being installed via Celery, which was removed in
5.3.0 celery/celery#8159

Related to sibson#245

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@DArtagan DArtagan mentioned this pull request Nov 21, 2023
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.

Celery 5.3.0rc1 not useable with redbeat anymore.
2 participants