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

Pendulum 2.0.2 compatibility #161

Closed
wants to merge 5 commits into from
Closed

Pendulum 2.0.2 compatibility #161

wants to merge 5 commits into from

Conversation

ViktorHaag
Copy link

Does the minimal work required to get maya working with pendulum 2.0.2, and run the test suite clean on py2.7 and py3.6.

Possible area for improvement:

  • make better use of pendulum's Duration class for parsed duration strings, and not assume that everything passed back by pendulum is a DateTime
  • be more robust around MayaInterval parsing to cope with strings that have a duration as the starting component, as well as the ending component

Addresses issue #160

- Previously, we depended on pendulum throwing a ParserError when parsing an
  interval where the end was a duration expression

- Pendulum now returns successfully parses durations and returns a
  Duration (not a DateTime), causing Maya's parser to fault because it assumes
  that pendulum always sends back a DateTime

- Now we catch the TypeError maya itself throws in this case (indicating that
  the duration hasn't been successfully parsed into a datetime object) and try
  to parse it as a duration instead
- Previously, maya depended upon pendulum falling back to datetime parsing for
  cases it couldn't handle; however, pendulum now does strict parsing by
  default, and will throw instead of delegating to stdlib parsing

- Provide a strict keyword arg on maya's parse method that defaults to False so
  that we by default can get the old delegating behaviour from pendulum when
  parsing
@timofurrer timofurrer requested review from kennethreitz and timofurrer and removed request for kennethreitz July 7, 2018 10:06
@timofurrer
Copy link
Collaborator

Thanks for this first step 🎉

Do you know of any semantic changes in pendulum 2.0 which would break mayas API?

@ViktorHaag
Copy link
Author

ViktorHaag commented Jul 9, 2018

I'm sorry, I don't -- my only knowledge of pendulum is through use of maya, and my use of maya is quite casual; the fixes to get maya at least testing clean with pendulum 2.0.2 seemed pretty straightforward, but I didn't do more investigation than just that.

@gwerbin
Copy link

gwerbin commented Aug 8, 2018

The list of 2.0.0 changes is here: https://github.com/sdispater/pendulum/releases/tag/2.0.0

The 2.0.2 changes are just bug fixes.

@luisdavim
Copy link

any updates on this one?

@timofurrer
Copy link
Collaborator

Unfortunately, not from my side. I'll find some time tomorrow to have a look at this!

@timofurrer timofurrer mentioned this pull request Dec 2, 2018
@timofurrer
Copy link
Collaborator

I'm closing this PR in favor of #166 🎉

@timofurrer timofurrer closed this Dec 2, 2018
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.

None yet

4 participants