Metadata API: remove dateutil requirement#1726
Metadata API: remove dateutil requirement#1726jku merged 1 commit intotheupdateframework:developfrom
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 <mvrachev@vmware.com>
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.
This test code is removed as if we don't make timedelta argument of Signed a Union[timedelta, relativedelta] then mypy complains.
jku
left a comment
There was a problem hiding this comment.
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
dateutilas a possible argument type forSigned.bump_expiration()as we are already testing for this andimplying it should be supported.
The problem is that
dateutilis 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
dateutilmentions 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 mvrachev@vmware.com
Please verify and check that the pull request fulfills the following
requirements: