Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Make change-log visible in mypy documentation #17742

Merged
merged 10 commits into from
Sep 15, 2024

Conversation

quinn-sasha
Copy link
Contributor

@quinn-sasha quinn-sasha commented Sep 6, 2024

Resolves #17717

Why

changelog-search

  • Problem: a change log cannot be found in official mypy documentation.
  • Enabling change log will improve the guidance of the official documentation.

Changes

(Explain how this PR changes mypy.)

This change will make change log visible in mypy documentation.

  1. Adding MyST-Parser into requirements.txt.
  2. Created changelog.md int mypy/docs/source/ to include mypy/CHANGELOG.md into mypy documentation.
  3. Added change log entry into table of contents.

Checklist:


  • make linkcheck
    The test had some warnings, but they were not caused from this pull request change.
  • runtests.py:
    Got error FileNotFoundError: [Errno 2] No such file or directory: 'pre-commit', but I guess it has nothing to do with documentation changes
  • tox run -e py

  • Make sure CI passes.
  • Do not force push to PR once reviewed

@quinn-sasha
Copy link
Contributor Author

About documentation build error

The error said ERROR: No matching distribution found for myst-parser>=4.0.0.
Maybe, it needs lower version of myst-parser.

hauntsaninja added a commit to hauntsaninja/mypy that referenced this pull request Sep 7, 2024
hauntsaninja added a commit that referenced this pull request Sep 7, 2024
@hauntsaninja
Copy link
Collaborator

Thanks, let's see if #17747 fixes the build

@quinn-sasha
Copy link
Contributor Author

Next warning was caused by Non-consecutive header level increase; H2 to H4 in mypy/CHANGELOG.md.

However, it is not strange that there is a increasing header level in change log.
So I added suppress_warnings = ["myst.header"] line into conf.py to suppress the warning.
reference

extensions = ["sphinx.ext.intersphinx", "docs.source.html_builder", "myst_parser"]

# To prevent myst-parser from warning header level increases
suppress_warnings = ["myst.header"]

Choose a reason for hiding this comment

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

Don't do this. Instead, decrease the indentation in CHANGELOG.md. Look at https://github.com/python/mypy/blob/72c413d/CHANGELOG.md?plain=1#L14 — it uses #### (H4) right after ## (H2). So MyST-Parser is correct to flag this. It's a real problem that needs to be fixed rather than ignored.

Choose a reason for hiding this comment

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

Looks like it should be auto-replaced across that entire file. Running sed -i 's/^####/###/g' CHANGELOG.md should do what's needed to correct the mistake.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you very much for your guide!

@webknjaz
Copy link

Relevant issue: #17717

@quinn-sasha

Tip

Pro tip: replace this with Resolves #17717 and GitHub will link it properly, and auto-close on merge.

… header level increase; H2 to H4' warnings in CHANGELOG.md
@hauntsaninja hauntsaninja merged commit 8b1e606 into python:master Sep 15, 2024
2 checks passed
@hauntsaninja
Copy link
Collaborator

Thank you!

@quinn-sasha quinn-sasha deleted the changelog_issue branch September 16, 2024 01:08
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.

[good-first-issue] Expose the change log via Sphinx docs
3 participants