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

Switched to use Pendulum's C timezone implementation #58

Merged
merged 4 commits into from
Jul 17, 2021
Merged

Conversation

movermeyer
Copy link
Collaborator

@movermeyer movermeyer commented Jun 20, 2018

Removes dependency on pytz.

Maintains the same error messages so it's backwards compatible with 2.0.x versions.

Resolves #45 (See that issue for performance discussion), and fixes #101

@movermeyer movermeyer requested a review from thomasst June 20, 2018 00:24
This was referenced Jun 22, 2018
@thomasst
Copy link
Member

@movermeyer Thanks for this! Looks like there are some conflicts now. Is this otherwise ready?

timezone.c Show resolved Hide resolved
timezone.c Outdated Show resolved Hide resolved
@movermeyer movermeyer changed the title Switched to use Pendulum's C timezone implementation WIP: Switched to use Pendulum's C timezone implementation Oct 18, 2019
@movermeyer movermeyer marked this pull request as draft October 10, 2020 00:02
CHANGELOG.md Outdated Show resolved Hide resolved
timezone.c Show resolved Hide resolved
@movermeyer movermeyer marked this pull request as ready for review December 29, 2020 15:56
@movermeyer movermeyer changed the title WIP: Switched to use Pendulum's C timezone implementation Switched to use Pendulum's C timezone implementation Dec 29, 2020
timezone.c Outdated Show resolved Hide resolved
timezone.c Outdated Show resolved Hide resolved
module.c Outdated Show resolved Hide resolved
@movermeyer movermeyer requested a review from thomasst June 27, 2021 01:30
@movermeyer movermeyer marked this pull request as draft June 27, 2021 17:48
@movermeyer movermeyer force-pushed the tzinfo branch 4 times, most recently from d95048b to 8e67d21 Compare June 27, 2021 19:29
@movermeyer movermeyer marked this pull request as ready for review June 27, 2021 19:41
@movermeyer movermeyer force-pushed the tzinfo branch 3 times, most recently from 05c671d to 6cd055a Compare June 28, 2021 20:20
movermeyer and others added 2 commits June 28, 2021 16:29
… against other libraries

(ex. `from pendulum.parsing import parse_iso8601 as parse_datetime`)
module.c Outdated
}

#if PY_VERSION_AT_LEAST_37
Copy link
Member

Choose a reason for hiding this comment

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

Should we use

#if PY_VERSION_HEX < 0x03070000 || (PYPY_VERSION && PYPY_VERSION_NUM < 0x07030600)
    utc = new_fixed_offset(0);
#else
    utc = PyDateTime_TimeZone_UTC;
#endif

to be most compatible?

Copy link
Collaborator Author

@movermeyer movermeyer Jun 29, 2021

Choose a reason for hiding this comment

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

@thomasst Make sense. Added as SUPPORTS_37_TIMEZONE_API

Copy link
Collaborator Author

@movermeyer movermeyer Jun 29, 2021

Choose a reason for hiding this comment

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

I tested that the build works with pypy v7.3.5 using:

docker run -it --rm=true -v $(dirname `pwd`):/app pypy bash
cd /app
pypy3 setup.py test

It fails some of the tests due to difference in the error message printout, but runs fine.

I have also tested against the nightly build of the py3.7 branch, which includes their changes. For this I used a slightly updated version of linnik/pypy3-nightly-docker and the same test methodology as above. It had the same results.

@movermeyer movermeyer force-pushed the tzinfo branch 2 times, most recently from de3cf00 to e2dea9c Compare June 29, 2021 05:33
@movermeyer movermeyer marked this pull request as draft June 29, 2021 05:47
movermeyer and others added 2 commits June 29, 2021 02:26
Removes dependency on pytz.
Maintains the same error messages so its backwards compatible with 2.0.x versions.
@movermeyer movermeyer merged commit 9446574 into master Jul 17, 2021
movermeyer added a commit that referenced this pull request Jul 17, 2021
@movermeyer movermeyer added the performance Things that improve our performance label Jul 21, 2022
@movermeyer movermeyer deleted the tzinfo branch December 21, 2022 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Things that improve our performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build fails with GCC 10.2 and PyPy 7.3.3 Backport datetime.timezone to older Python versions?
3 participants