Skip to content

feat(cal/todo): add COMPLETED property to VTODO (#1797) - #2023

Open
RajGahoi wants to merge 5 commits into
PyCalendar:mainfrom
RajGahoi:feat/todo-completed
Open

RajGahoi wants to merge 5 commits into
PyCalendar:mainfrom
RajGahoi:feat/todo-completed

Conversation

@RajGahoi

@RajGahoi RajGahoi commented Oct 24, 2026 •

Copy link
Copy Markdown

Linked issue

Description

This pull request implements the COMPLETED property for Todo (VTODO) components per RFC 5545 section 3.8.2.1, fully adapting the functionally approved implementation and review feedback from #1803 as requested by @angatha:

  1. COMPLETED Property: Implemented via single_utc_property, guaranteeing UTC timezone normalization and RFC 5545 compliance. Conforms to project conventions by exposing only the uppercase property attribute (matching Event and Alarm).
  2. Todo.new() constructor: Added completed: date | datetime | None = None keyword argument with type hints and documentation.
  3. Documentation & Doctests: Updated Todo class docstring doctest to demonstrate todo.COMPLETED = ... and assert conformant serialized output (COMPLETED:20070501T120000Z).
  4. Validation in test_property_docstrings.py: Added Todo.COMPLETED to UTC_PROPERTIES to verify docstring composition rules.
  5. Fixtures & Tests: Added todo_completed.ics, completed.ics, and rfc5545_completed.ics fixtures, alongside comprehensive test suite covering UTC normalization, VALUE=DATE handling, getter/setter/deleter, constructor ergonomics, and invalid type exceptions.
  6. Changelog: News fragment included at news/1797.feature.

Checklist

  • I added a change log entry, following the instructions in all subsections under Change log requirements.
  • I followed icalendar's Artificial intelligence policy and disclosed my Responsible AI use in my commit messages, if applicable.
  • I added or updated tests, if applicable.
  • I ran and ensured all tests pass locally by following Run tests.
  • I added or edited documentation as necessary, both as docstrings to be rendered in the API documentation and narrative documentation, following the Style guide.

Additional information

Builds upon and carries forward the work from #1803 which was functionally approved by @niccokunzmann.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the pull request, @RajGahoi! A maintainer will review it shortly.

@github-actions

Copy link
Copy Markdown
Contributor

Automation signals

Activity patterns show signs of automation.

View full analysis →

Report this account →

Evidence
  • Rapid fork→PR pattern: 20/30 fork branches followed by upstream PRs within 74s
  • Multiple forks: 6 repositories forked in a single 24-hour window

Last 5 PRs:

This is an automated analysis by AgentScan

@github-actions github-actions Bot added the agentscan:automated-account AgentScan flagged this item as coming from an automated account, and it needs review label Oct 24, 2026
@angatha

angatha commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

First thank you for the contribution.

There are three other PRs for the issue:

This does also not follow the PR tempalte, why?

@angatha

angatha commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

Can you please have a look at #1803 and adapt the changes there, which you are missing? Then I suggest we proceed with this one.

…implementation (PyCalendar#1797)

- Use single_utc_property without lowercase .completed alias
- Support completed parameter in Todo.new()
- Update Todo class docstring doctest to assert RFC-conformant COMPLETED serialization
- Register COMPLETED in test_property_docstrings UTC_PROPERTIES
- Add RFC 5545 and CalDAV VTODO fixture tests
@RajGahoi

Copy link
Copy Markdown
Author

Thank you for pointing me to #1803 and the repository PR template, @angatha!

I have updated the PR to strictly follow the PR template and adapted all missing changes from #1803:

  1. Property Conventions: Standardized on COMPLETED = single_utc_property(...) without the lowercase alias to match Event and Alarm.
  2. Todo.new() Constructor: Added completed: date | datetime | None = None parameter and documentation.
  3. Documentation & Doctests: Updated the Todo class docstring doctest so o_ical() outputs RFC 5545 conformant COMPLETED:20070501T120000Z (resolving the documentation item raised during Add COMPLETED and completed properties to Todo (#1797) #1803 review).
  4. Validation: Registered COMPLETED under UTC_PROPERTIES in est_property_docstrings.py.
  5. Fixtures & Tests: Ported odo_completed.ics, completed.ics, and
    fc5545_completed.ics, with the complete test suite in est_issue_1797_todo_completed.py.

All local tests, doctests, and ruff checks pass cleanly. Ready for your review!

angatha
angatha previously approved these changes Oct 27, 2026

@angatha angatha left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@niccokunzmann since you reviewed #1803, do you want to have a look?

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RajGahoi nice work! I made a few suggestions to make links work and follow our style guide. Would you please take care? Thank you!

Comment thread news/1797.feature Resolved
Comment thread src/icalendar/cal/todo.py Resolved
Comment thread src/icalendar/cal/todo.py Resolved
… fragment

Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
@RajGahoi

Copy link
Copy Markdown
Author

Applied all three suggestions for the docstring and news fragment. Ready for another look, @stevepiercy!

@stevepiercy stevepiercy mentioned this pull request Nov 18, 2026
1 of 5 tasks

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation looks good. Thank you!

Needs a final review from @niccokunzmann or @angatha.

@SemTiOne SemTiOne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, 1 nit.

Comment thread news/1797.feature
@@ -0,0 +1 @@
Added property :attr:`Todo.COMPLETED <icalendar.cal.todo.Todo.COMPLETED>` per :rfc:`5545#section-3.8.2.1`. @RajGahoi

@SemTiOne SemTiOne Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Added property :attr:`Todo.COMPLETED <icalendar.cal.todo.Todo.COMPLETED>` per :rfc:`5545#section-3.8.2.1`. @RajGahoi
Added property :attr:`Todo.COMPLETED <icalendar.cal.todo.Todo.COMPLETED>` per :rfc:`5545#section-3.8.2.1`. :user:`RajGahoi`

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentscan:automated-account AgentScan flagged this item as coming from an automated account, and it needs review PR quality: good

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Todo.COMPLETED

5 participants