Add vWeekday.ical_value for the Component.decoded() polymorphy#1360
Merged
Conversation
Refs collective#876. Adds the `ical_value` property to `vWeekday`, returning the weekday string (e.g. ``MO``, ``+2TH``, ``-1SU``). This continues the polymorphy work tracked in collective#876, matching the pattern already established for `vText`, `vUri`, `vInt`, `vFloat`, `vBoolean`, `vBinary`, `vCalAddress`, and friends -- each value class exposes its underlying Python value via `ical_value` so `Component.decoded()` can stop dispatching on type. Test added alongside the existing `test_vWeekday` cases: >>> vWeekday("MO").ical_value 'MO' >>> vWeekday("+2TH").ical_value '+2TH' >>> vWeekday("-1SU").ical_value '-1SU' `pytest src/icalendar/tests/prop/test_vWeekday.py` now passes 5 tests (was 4).
Documentation build overview
11 files changed ·
|
stevepiercy
requested changes
May 5, 2026
stevepiercy
left a comment
Member
There was a problem hiding this comment.
Thank you! This looks good, with a minor change.
Also please add a change log entry, per https://icalendar.readthedocs.io/en/stable/contribute/index.html#change-log-entry-format.
- Replace Latin abbreviation in vWeekday.ical_value docstring with explicit examples (MO, +2TH, -1SU) per @stevepiercy. - Convert the RFC reference to a Sphinx Napolean See Also: section per @stevepiercy. - Add a New features changelog entry for 7.1.1 (unreleased) mirroring the vBoolean.ical_value entry from 7.1.0.
Contributor
Author
|
Thanks @stevepiercy! Applied both suggestions in ac8322a and added a |
31 tasks
Coverage Report for CI Build 25792377498Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage increased (+0.001%) to 97.775%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Member
|
This is included in v7.1.1. |
pchopinet
pushed a commit
to JaaJSoft/workspace
that referenced
this pull request
May 19, 2026
Bumps [icalendar](https://github.com/collective/icalendar) from 7.1.0 to 7.1.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/collective/icalendar/releases">icalendar's releases</a>.</em></p> <blockquote> <h2>v7.1.1</h2> <p>To view the changes, please see the <a href="https://icalendar.readthedocs.io/en/latest/reference/changelog.html">Changelog</a>. This release can be installed from <a href="https://pypi.org/project/icalendar/#history">PyPI</a>.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/collective/icalendar/blob/main/CHANGES.rst">icalendar's changelog</a>.</em></p> <blockquote> <h2>7.1.1 (2026-05-18)</h2> <p>New features</p> <pre><code> - Created an :attr:`~icalendar.prop.dt.period.vPeriod.ical_value` property for the :class:`~icalendar.prop.dt.period.vPeriod` component. @ZairKSM (`Issue [#876](collective/icalendar#876) <https://github.com/collective/icalendar/issues/876>`_) - Created a :meth:`~icalendar.prop.recur.weekday.vWeekday.ical_value` property for the :class:`~icalendar.prop.recur.weekday.vWeekday` component, mirroring the existing pattern on :class:`~icalendar.prop.boolean.vBoolean`. @mvanhorn (`Issue [#1360](collective/icalendar#1360) <https://github.com/collective/icalendar/issues/1360>`_) <p>Bug fixes</p> <pre><code> - Strictly validate BINARY property values in :attr:`vBinary.from_ical() &lt;icalendar.prop.binary.vBinary.from_ical&gt;` and reject malformed Base64 input instead of silently accepting invalid characters. @uwezkhan (`Issue [#1349](collective/icalendar#1349) &lt;https://github.com/collective/icalendar/issues/1349&gt;`_) Documentation </code></pre> <ul> <li>Replace the RFC quotations in the docstrings for :attr:<code>Alarm.REPEAT &lt;icalendar.cal.alarm.Alarm.REPEAT&gt;</code> and :attr:<code>Alarm.DURATION &lt;icalendar.cal.alarm.Alarm.DURATION&gt;</code> with Pythonic descriptions, including parameter notes, conformance references, and worked examples. <a href="https://github.com/tmchow"><code>@tmchow</code></a> (<code>Issue [#1244](collective/icalendar#1244) &lt;collective/icalendar#1244; <li>Edited contributor documentation for how to add a change log entry, and maintenance documentation for how to process news fragments. <a href="https://github.com/stevepiercy"><code>@stevepiercy</code></a> (<code>Issue [#1256](collective/icalendar#1256) &lt;collective/icalendar#1256; <li>Updated release process documentation. <a href="https://github.com/niccokunzmann"><code>@niccokunzmann</code></a> <a href="https://github.com/stevepiercy"><code>@stevepiercy</code></a> <a href="https://github.com/SashankBhamidi"><code>@SashankBhamidi</code></a> (<code>Issue [#1293](collective/icalendar#1293) &lt;collective/icalendar#1293; </ul> <p>Dependency changes</p> <pre><code> - Added `towncrier &lt;https://pypi.org/project/towncrier/&gt;`_ to development dependencies. @stevepiercy (`Issue [#1256](collective/icalendar#1256) &lt;https://github.com/collective/icalendar/issues/1256&gt;`_) Internal changes </code></pre> <ul> <li>Switched from manual change log management to <code>towncrier &lt;https://pypi.org/project/towncrier/&gt;</code>_ to automate the process. <a href="https://github.com/stevepiercy"><code>@stevepiercy</code></a> (<code>Issue [#1256](collective/icalendar#1256) &lt;https://github.com/collective/icalendar/issues/1256&gt;</code>_)</li> <li>Bump PyPy from 3.10 to 3.11 for testing. <a href="https://github.com/stevepiercy"><code>@stevepiercy</code></a> (<code>Issue [#1383](collective/icalendar#1383) &lt;https://github.com/collective/icalendar/issues/1383&gt;</code>_) </code></pre></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/collective/icalendar/commit/79ddc3e0d83250bbabf804b781a1778b8e3baee2"><code>79ddc3e</code></a> Merge branch 'main' into 7.x</li> <li><a href="https://github.com/collective/icalendar/commit/465936b1d2b0c98f5a0107341386aa185c4e82d0"><code>465936b</code></a> version 7.1.1</li> <li><a href="https://github.com/collective/icalendar/commit/39b8db8235f7005cd70dc4dcbc21b27d7a61f510"><code>39b8db8</code></a> Update release process (<a href="https://redirect.github.com/collective/icalendar/issues/1350">#1350</a>)</li> <li><a href="https://github.com/collective/icalendar/commit/c343662ca7ca674338c9dca93351dfb6ffb8de6c"><code>c343662</code></a> Switch to towncrier to automatically manage the change log (<a href="https://redirect.github.com/collective/icalendar/issues/1389">#1389</a>)</li> <li><a href="https://github.com/collective/icalendar/commit/66fb3e167063ac667aece4a248f4e2f9e5d321a6"><code>66fb3e1</code></a> Add <code>vWeekday.ical_value</code> for the <code>Component.decoded()</code> polymorphy (<a href="https://redirect.github.com/collective/icalendar/issues/1360">#1360</a>)</li> <li><a href="https://github.com/collective/icalendar/commit/933d4f0679e95bf4473a171f279a1f5497396fd9"><code>933d4f0</code></a> docs(alarm): rewrite REPEAT and DURATION docstrings (refs <a href="https://redirect.github.com/collective/icalendar/issues/1244">#1244</a>) (<a href="https://redirect.github.com/collective/icalendar/issues/1357">#1357</a>)</li> <li><a href="https://github.com/collective/icalendar/commit/e380df13d39a28a04614edf20aabdadd61b6b640"><code>e380df1</code></a> <a href="https://redirect.github.com/collective/icalendar/issues/876">#876</a> vPeriod (<a href="https://redirect.github.com/collective/icalendar/issues/1359">#1359</a>)</li> <li><a href="https://github.com/collective/icalendar/commit/5688f421e04edf950015739230da5a5747ee02d0"><code>5688f42</code></a> Bump PyPy from 3.10 to 3.11 (<a href="https://redirect.github.com/collective/icalendar/issues/1383">#1383</a>)</li> <li><a href="https://github.com/collective/icalendar/commit/7357cecd55c66dea0f5aa091a4f9ad6ea2c1e435"><code>7357cec</code></a> Strictly validate Base64 binary values (<a href="https://redirect.github.com/collective/icalendar/issues/1349">#1349</a>)</li> <li><a href="https://github.com/collective/icalendar/commit/6b887f83bb8cd6a6e4cad4159201035dbd524e75"><code>6b887f8</code></a> Merge pull request <a href="https://redirect.github.com/collective/icalendar/issues/1351">#1351</a> from collective/fund</li> <li>Additional commits viewable in <a href="https://github.com/collective/icalendar/compare/v7.1.0...v7.1.1">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
5 tasks
martimlobao
pushed a commit
to martimlobao/regybox
that referenced
this pull request
May 26, 2026
Bumps [icalendar](https://github.com/collective/icalendar) from 7.0.3 to 7.1.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/collective/icalendar/releases">icalendar's releases</a>.</em></p> <blockquote> <h2>v7.1.2</h2> <p>To view the changes, please see the <a href="https://icalendar.readthedocs.io/en/latest/reference/changelog.html">Changelog</a>. This release can be installed from <a href="https://pypi.org/project/icalendar/#history">PyPI</a>.</p> <h2>v7.1.1</h2> <p>To view the changes, please see the <a href="https://icalendar.readthedocs.io/en/latest/reference/changelog.html">Changelog</a>. This release can be installed from <a href="https://pypi.org/project/icalendar/#history">PyPI</a>.</p> <h2>v7.1.0</h2> <p>To view the changes, please see the <a href="https://icalendar.readthedocs.io/en/latest/changelog.html">Changelog</a>. This release can be installed from <a href="https://pypi.org/project/icalendar/#history">PyPI</a>.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/collective/icalendar/blob/main/CHANGES.rst">icalendar's changelog</a>.</em></p> <blockquote> <h2>7.1.2 (2026-05-22)</h2> <p>Bug fixes</p> <pre><code> - Replaced the recursive :meth:`Component.__repr__ <icalendar.cal.component.Component.__repr__>` implementation with an iterative stack-based walk so that deeply nested calendars no longer raise :exc:`RecursionError` when formatted via ``repr()``, ``str()``, or f-strings. The output format is unchanged for normally-shaped calendars. @gistrec (`Issue [#1370](collective/icalendar#1370) <https://github.com/collective/icalendar/issues/1370>`_) <p>Documentation </code></pre></p> <ul> <li>Update maintenance documentation. Fix the version switcher on "stable" on Read the Docs. <a href="https://github.com/stevepiercy"><code>@stevepiercy</code></a> (<code>Issue [#1352](collective/icalendar#1352) <https://github.com/collective/icalendar/issues/1352></code>_)</li> </ul> <h2>7.1.1 (2026-05-18)</h2> <p>New features</p> <pre><code> - Created an :attr:`~icalendar.prop.dt.period.vPeriod.ical_value` property for the :class:`~icalendar.prop.dt.period.vPeriod` component. @ZairKSM (`Issue [#876](collective/icalendar#876) <https://github.com/collective/icalendar/issues/876>`_) - Created a :meth:`~icalendar.prop.recur.weekday.vWeekday.ical_value` property for the :class:`~icalendar.prop.recur.weekday.vWeekday` component, mirroring the existing pattern on :class:`~icalendar.prop.boolean.vBoolean`. @mvanhorn (`Issue [#1360](collective/icalendar#1360) <https://github.com/collective/icalendar/issues/1360>`_) <p>Bug fixes</p> <pre><code> - Strictly validate BINARY property values in :attr:`vBinary.from_ical() &lt;icalendar.prop.binary.vBinary.from_ical&gt;` and reject malformed Base64 input instead of silently accepting invalid characters. @uwezkhan (`Issue [#1349](collective/icalendar#1349) &lt;https://github.com/collective/icalendar/issues/1349&gt;`_) Documentation </code></pre> <ul> <li>Replace the RFC quotations in the docstrings for :attr:<code>Alarm.REPEAT &lt;icalendar.cal.alarm.Alarm.REPEAT&gt;</code> and :attr:<code>Alarm.DURATION &lt;icalendar.cal.alarm.Alarm.DURATION&gt;</code> with Pythonic descriptions, including parameter notes, conformance references, and worked examples. <a href="https://github.com/tmchow"><code>@tmchow</code></a> (<code>Issue [#1244](collective/icalendar#1244) &lt;collective/icalendar#1244; <li>Edited contributor documentation for how to add a change log entry, and maintenance documentation for how to process news fragments. <a href="https://github.com/stevepiercy"><code>@stevepiercy</code></a> (<code>Issue [#1256](collective/icalendar#1256) &lt;collective/icalendar#1256; <li>Updated release process documentation. <a href="https://github.com/niccokunzmann"><code>@niccokunzmann</code></a> <a href="https://github.com/stevepiercy"><code>@stevepiercy</code></a> <a href="https://github.com/SashankBhamidi"><code>@SashankBhamidi</code></a> (<code>Issue [#1293](collective/icalendar#1293) &lt;collective/icalendar#1293; </ul> <p>Dependency changes</p> <pre><code> - Added `towncrier &lt;https://pypi.org/project/towncrier/&gt;`_ to development dependencies. @stevepiercy (`Issue [#1256](collective/icalendar#1256) &lt;https://github.com/collective/icalendar/issues/1256&gt;`_) Internal changes </code></pre> <ul> <li>Switched from manual change log management to <code>towncrier &lt;https://pypi.org/project/towncrier/&gt;</code>_ to automate the process. <a href="https://github.com/stevepiercy"><code>@stevepiercy</code></a> (<code>Issue [#1256](collective/icalendar#1256) &lt;https://github.com/collective/icalendar/issues/1256&gt;</code>_)</li> <li>Bump PyPy from 3.10 to 3.11 for testing. <a href="https://github.com/stevepiercy"><code>@stevepiercy</code></a> (<code>Issue [#1383](collective/icalendar#1383) &lt;https://github.com/collective/icalendar/issues/1383&gt;</code>_) </tr></table> </code></pre></li> </ul> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/collective/icalendar/commit/f5494e36780693f25259e3641fc660666b97a129"><code>f5494e3</code></a> Merge branch 'main' into 7.x</li> <li><a href="https://github.com/collective/icalendar/commit/6ddbd9500f6c3a6e96066868c1fb96af19d76413"><code>6ddbd95</code></a> version 7.1.2</li> <li><a href="https://github.com/collective/icalendar/commit/6efe6394f12877fd30b9ad9ff84c08f8ef9f0995"><code>6efe639</code></a> Update maintenance docs and fix version switcher for "stable" (<a href="https://redirect.github.com/collective/icalendar/issues/1393">#1393</a>)</li> <li><a href="https://github.com/collective/icalendar/commit/67d6ab9707cc5d31e4dc70a59af6d6e540a9aec2"><code>67d6ab9</code></a> Fix RecursionError in Component.<strong>repr</strong> on deeply nested calendars (Closes #...</li> <li><a href="https://github.com/collective/icalendar/commit/87057297b1276e25803cf01f7a2f7b2c6dd02bd9"><code>8705729</code></a> Restore version warning banner for 'latest' on Read the Docs</li> <li><a href="https://github.com/collective/icalendar/commit/8fccb3aa5e08fb36fee6f66bde5417e878a30b45"><code>8fccb3a</code></a> Update version switcher for 7.1.1</li> <li><a href="https://github.com/collective/icalendar/commit/79ddc3e0d83250bbabf804b781a1778b8e3baee2"><code>79ddc3e</code></a> Merge branch 'main' into 7.x</li> <li><a href="https://github.com/collective/icalendar/commit/465936b1d2b0c98f5a0107341386aa185c4e82d0"><code>465936b</code></a> version 7.1.1</li> <li><a href="https://github.com/collective/icalendar/commit/39b8db8235f7005cd70dc4dcbc21b27d7a61f510"><code>39b8db8</code></a> Update release process (<a href="https://redirect.github.com/collective/icalendar/issues/1350">#1350</a>)</li> <li><a href="https://github.com/collective/icalendar/commit/c343662ca7ca674338c9dca93351dfb6ffb8de6c"><code>c343662</code></a> Switch to towncrier to automatically manage the change log (<a href="https://redirect.github.com/collective/icalendar/issues/1389">#1389</a>)</li> <li>Additional commits viewable in <a href="https://github.com/collective/icalendar/compare/v7.0.3...v7.1.2">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #876
Why
Continuing the polymorphy work tracked in #876, this adds
ical_valuetovWeekdaysoComponent.decoded()can keep getting smaller. After this, the BYDAY/BYWEEKDAY/WKST values produced viaComponent.decoded()look like every other RFC 5545 value type instead of needing anif isinstance(..., vWeekday)branch.vWeekdayextendsstr, soical_valueis juststr(self)-- the same shape vText, vUri, vCalAddress, vUid already use.Behaviour
Tests
pytest src/icalendar/tests/prop/test_vWeekday.pynow runs 5 tests (was 4):Checklist (per #876)
-> str)MO,+2TH,-1SUand links to RFC 5545 § 3.3.10 BYDAY)vText/vUri/vCalAddress(which returnstr(self))