-
Notifications
You must be signed in to change notification settings - Fork 277
Metadata API: remove dateutil requirement #1726
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
Conversation
I added "dateutil" as a possible argument type for `Metadata.bump_expiration()` as we are already testing for this and implying it should be supported. The problem is that "dateutil" is not added as a nontest requirement and after a discussion, we decided we don't want to add it as well. That's why we decided to remove "dateutil" mentions from the code and not confuse our users we support it. We will create a separate issue discussing the validity of `Metadata.bump_expiration()`. Signed-off-by: Martin Vrachev <[email protected]>
Pull Request Test Coverage Report for Build 1577091651
💛 - Coveralls |
# Test whether dateutil.relativedelta works, this provides a much | ||
# easier to use interface for callers | ||
delta = relativedelta(days=1) | ||
timestamp.signed.bump_expiration(delta) | ||
self.assertEqual(timestamp.signed.expires, datetime(2031, 1, 3, 0, 0)) | ||
delta = relativedelta(years=5) | ||
timestamp.signed.bump_expiration(delta) | ||
self.assertEqual(timestamp.signed.expires, datetime(2036, 1, 3, 0, 0)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test code is removed as if we don't make timedelta
argument of Signed
a Union[timedelta, relativedelta]
then mypy
complains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There are ways to test relativedelta usage without making it explicitly part of the API, and we probably want to do that... but since the expiry API has multiple related issues I think this is fine: let's remove relativedelta code completely for now to get a clean build and look for the correct solution to expiry issue in #1727.
Pull Request Test Coverage Report for Build 1577091651Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
1 similar comment
Pull Request Test Coverage Report for Build 1577091651Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Fixes #1722
Description of the changes being introduced by the pull request:
I added
dateutil
as a possible argument type forSigned.bump_expiration()
as we are already testing for this andimplying it should be supported.
The problem is that
dateutil
is not added as a nontest requirementand after a discussion, we decided we don't want to add it as well.
That's why we decided to remove
dateutil
mentions from the codeand not confuse our users we support it.
We will create a separate issue discussing the validity of
Metadata.bump_expiration()
.Signed-off-by: Martin Vrachev [email protected]
Please verify and check that the pull request fulfills the following
requirements: