'offset' becomes a property instead of an attribute and constructor argument.
This also removes both from the output of .to_dict().
This is step 2 of T3752
Differential D6936
TimestampWithTimezone: Make 'offset' and 'negative_utc' optional vlorentz on Jan 13 2022, 12:14 PM. Authored by Tags None Subscribers None
Details 'offset' becomes a property instead of an attribute and constructor argument. This also removes both from the output of .to_dict(). This is step 2 of T3752
Diff Detail
Event TimelineComment Actions Build has FAILED Patch application report for D6936 (id=25125)Rebasing onto dbf185c3b3... Current branch diff-target is up to date. Changes applied before testcommit 617d79017a01be824e1e453f175a773c53b2f060 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Jan 12 15:12:29 2022 +0100 TimestampWithTimezone: Make 'offset_bytes' required and remove 'negative_utc'. 'offset' becomes a property instead of an attribute and constructor argument. This also removes both from the output of `.to_dict()`. This is step 6 of https://forge.softwareheritage.org/T3752 This will break packages that still use the constructor directly, ie. swh-storage and swh-loader-git (and tests of swh-loader-core and swh-loader-svn) Link to build: https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/445/ Comment Actions Build is green Patch application report for D6936 (id=25126)Rebasing onto dbf185c3b3... Current branch diff-target is up to date. Changes applied before testcommit be894c66c88b45f621529df011e1dc5f1de2bd8e Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Jan 12 15:12:29 2022 +0100 TimestampWithTimezone: Make 'offset_bytes' required and remove 'negative_utc'. 'offset' becomes a property instead of an attribute and constructor argument. This also removes both from the output of `.to_dict()`. This is step 6 of https://forge.softwareheritage.org/T3752 This will break packages that still use the constructor directly, ie. swh-storage and swh-loader-git (and tests of swh-loader-core and swh-loader-svn) See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/446/ for more details. Comment Actions Couldn't we make the old constructor arguments optional first, to avoid breaking all dependencies at once? Comment Actions We could, but it means another round of going through all four packages and changing every constructor call, and it's a lot of busy work Comment Actions Is it? What I want is for *this* module to support *both* ways of instantiating the object, so we can avoid having to deploy everything at once. Comment Actions Oh, so you want to make all three parameters optional, but error if we don't have one of the two sets? Hmm... I'll look into it Comment Actions Looks like we need __attrs_init__ (added by attrs 21.1.0) in order to support this EDIT: I figured a solution. It's not pretty, but it will work as a temporary workaround. Comment Actions Build is green Patch application report for D6936 (id=25175)Rebasing onto dbf185c3b3... Current branch diff-target is up to date. Changes applied before testcommit 1504ec4b7f7d60c6a162efd66d36f64b2ccbefd2 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Fri Jan 14 13:12:34 2022 +0100 Restore 'offset' and 'negative_utc' arguments and make them optional This allows keeping compatibility with existing users of the TimestampWithTimezone constructor commit be894c66c88b45f621529df011e1dc5f1de2bd8e Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Jan 12 15:12:29 2022 +0100 TimestampWithTimezone: Make 'offset_bytes' required and remove 'negative_utc'. 'offset' becomes a property instead of an attribute and constructor argument. This also removes both from the output of `.to_dict()`. This is step 6 of https://forge.softwareheritage.org/T3752 This will break packages that still use the constructor directly, ie. swh-storage and swh-loader-git (and tests of swh-loader-core and swh-loader-svn) See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/447/ for more details. Comment Actions Thanks for this change! We alread have an attrs backport on our systems, so I've prepared a (trivial) backport of attrs 21.2.0; if the version with __attrs_init__ is cleaner, we could go for that. Comment Actions Build is green Patch application report for D6936 (id=25179)Rebasing onto dbf185c3b3... Current branch diff-target is up to date. Changes applied before testcommit b16a587bff89256be767aeb4e7e39bd10b7712ba Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Fri Jan 14 13:12:34 2022 +0100 Restore 'offset' and 'negative_utc' arguments and make them optional This allows keeping compatibility with existing users of the TimestampWithTimezone constructor commit be894c66c88b45f621529df011e1dc5f1de2bd8e Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Jan 12 15:12:29 2022 +0100 TimestampWithTimezone: Make 'offset_bytes' required and remove 'negative_utc'. 'offset' becomes a property instead of an attribute and constructor argument. This also removes both from the output of `.to_dict()`. This is step 6 of https://forge.softwareheritage.org/T3752 This will break packages that still use the constructor directly, ie. swh-storage and swh-loader-git (and tests of swh-loader-core and swh-loader-svn) See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/448/ for more details. Comment Actions Build is green Patch application report for D6936 (id=25180)Rebasing onto dbf185c3b3... Current branch diff-target is up to date. Changes applied before testcommit a0f5436273ef6f5b62a388ae131ed5afa7287d00 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Fri Jan 14 13:12:34 2022 +0100 Restore 'offset' and 'negative_utc' arguments and make them optional This allows keeping compatibility with existing users of the TimestampWithTimezone constructor commit be894c66c88b45f621529df011e1dc5f1de2bd8e Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Jan 12 15:12:29 2022 +0100 TimestampWithTimezone: Make 'offset_bytes' required and remove 'negative_utc'. 'offset' becomes a property instead of an attribute and constructor argument. This also removes both from the output of `.to_dict()`. This is step 6 of https://forge.softwareheritage.org/T3752 This will break packages that still use the constructor directly, ie. swh-storage and swh-loader-git (and tests of swh-loader-core and swh-loader-svn) See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/449/ for more details.
|