Skip to content

docs: remove redundant :py: prefix from docstring cross-references#1248

Open
indoor47 wants to merge 1 commit intocollective:mainfrom
indoor47:fix/doc-links-remove-py-prefix
Open

docs: remove redundant :py: prefix from docstring cross-references#1248
indoor47 wants to merge 1 commit intocollective:mainfrom
indoor47:fix/doc-links-remove-py-prefix

Conversation

@indoor47
Copy link
Copy Markdown

Summary

  • Removed the :py: prefix from 18 cross-reference roles across 8 Python source files
  • Affected roles: :py:class:, :py:mod:, :py:meth:
  • Replaced with the preferred short forms: :class:, :mod:, :meth:
  • Per the icalendar style guide: "Because icalendar uses the Python domain exclusively, it is safe to omit the :py prefix when creating references to Python objects."

Files changed

  • src/icalendar/cal/availability.py (1 fix)
  • src/icalendar/cal/calendar.py (5 fixes)
  • src/icalendar/cal/component.py (6 fixes)
  • src/icalendar/parser/property.py (1 fix)
  • src/icalendar/prop/dt/date.py (1 fix)
  • src/icalendar/prop/dt/datetime.py (2 fixes)
  • src/icalendar/prop/dt/duration.py (1 fix)
  • src/icalendar/prop/dt/time.py (1 fix)

Test plan

  • Read the Docs preview build shows no broken cross-reference links in the affected API pages
  • Verify the fixed roles resolve correctly in the rendered HTML docs

Closes part of #1158.

Generated with Claude Code

The icalendar project uses the Python domain exclusively, so the :py:
prefix on Sphinx cross-reference roles is redundant and causes broken
links. Removed it from 18 occurrences across 8 files in the docstrings,
replacing forms like :py:class:, :py:mod:, :py:meth: with :class:,
:mod:, :meth: respectively, per the project's style guide.

Fixes part of collective#1158.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@niccokunzmann
Copy link
Copy Markdown
Member

Thanks for the AI disclosure! Could you add a changelog entry in the docs section?

@niccokunzmann
Copy link
Copy Markdown
Member

@indoor47 Please make sure that you review the changes yourself and that it is actually doing what is said in the issue. You need to take responsibility for what the AI does. Otherwise, we can also just do it with AI and review it ourselves.

@indoor47
Copy link
Copy Markdown
Author

Yes, I'm reviewing them.

@stevepiercy
Copy link
Copy Markdown
Member

@indoor47 please let us know when you're done reviewing these changes, specifically by verifying that they still link to their respective objects. You can verify on the Read the Docs pull request preview at:

https://icalendar--1248.org.readthedocs.build/en/1248/

Also this PR needs to be updated with main, and a change log entry.

Thank you!

@niccokunzmann
Copy link
Copy Markdown
Member

Hi, thanks for the work, how is it progressing?

@SashankBhamidi
Copy link
Copy Markdown
Member

Hi, thanks for the work, how is it progressing?

HI, following up on Nicco's comment.

Could you also resolve conflicts please? Thanks!

@niccokunzmann
Copy link
Copy Markdown
Member

Hi, we created a new release, please move your edits in CHANGES.rst to the new section.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants