From 655bd15749e6e76023cc92f3aaf71d6c7887d440 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:08:17 +0100 Subject: [PATCH] Adorn top-level files with a '.rst' suffix --- .github/workflows/lint.yml | 4 +++- AUTHORS => AUTHORS.rst | 0 CHANGES => CHANGES.rst | 0 CODE_OF_CONDUCT => CODE_OF_CONDUCT.rst | 0 EXAMPLES => EXAMPLES.rst | 0 LICENSE => LICENSE.rst | 0 Makefile | 2 +- doc/authors.rst | 2 +- doc/changes.rst | 2 +- doc/conf.py | 4 ++-- doc/examples.rst | 2 +- doc/internals/code-of-conduct.rst | 2 +- doc/internals/contributing.rst | 4 ++-- doc/internals/organization.rst | 2 +- doc/internals/release-process.rst | 2 +- pyproject.toml | 10 +++++----- utils/{CHANGES_template => CHANGES_template.rst} | 0 utils/bump_version.py | 4 ++-- utils/{release-checklist => release-checklist.rst} | 0 19 files changed, 21 insertions(+), 19 deletions(-) rename AUTHORS => AUTHORS.rst (100%) rename CHANGES => CHANGES.rst (100%) rename CODE_OF_CONDUCT => CODE_OF_CONDUCT.rst (100%) rename EXAMPLES => EXAMPLES.rst (100%) rename LICENSE => LICENSE.rst (100%) rename utils/{CHANGES_template => CHANGES_template.rst} (100%) rename utils/{release-checklist => release-checklist.rst} (100%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 97b8c978401..cc900f8c262 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -102,7 +102,9 @@ jobs: sphinx-lint --enable line-too-long --max-line-length 85 - CHANGES + AUTHORS.rst + CHANGES.rst + CODE_OF_CONDUCT.rst CONTRIBUTING.rst README.rst doc/ diff --git a/AUTHORS b/AUTHORS.rst similarity index 100% rename from AUTHORS rename to AUTHORS.rst diff --git a/CHANGES b/CHANGES.rst similarity index 100% rename from CHANGES rename to CHANGES.rst diff --git a/CODE_OF_CONDUCT b/CODE_OF_CONDUCT.rst similarity index 100% rename from CODE_OF_CONDUCT rename to CODE_OF_CONDUCT.rst diff --git a/EXAMPLES b/EXAMPLES.rst similarity index 100% rename from EXAMPLES rename to EXAMPLES.rst diff --git a/LICENSE b/LICENSE.rst similarity index 100% rename from LICENSE rename to LICENSE.rst diff --git a/Makefile b/Makefile index 5293f6330ca..bf6f61b267d 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ type-check: .PHONY: doclinter doclinter: - sphinx-lint --enable line-too-long --max-line-length 85 CHANGES *.rst doc/ + sphinx-lint --enable line-too-long --max-line-length 85 *.rst doc/ .PHONY: test test: diff --git a/doc/authors.rst b/doc/authors.rst index 411835bc115..015420d0149 100644 --- a/doc/authors.rst +++ b/doc/authors.rst @@ -6,4 +6,4 @@ Sphinx authors ============== -.. include:: ../AUTHORS +.. include:: ../AUTHORS.rst diff --git a/doc/changes.rst b/doc/changes.rst index 96853fe0946..54401c38da9 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -19,4 +19,4 @@ Changelog \makeatother -.. include:: ../CHANGES +.. include:: ../CHANGES.rst diff --git a/doc/conf.py b/doc/conf.py index d4915aa259d..f32bff51d3d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -212,7 +212,7 @@ def linkify_issues_in_changelog(app, docname, source): """ Linkify issue references like #123 in changelog to GitHub. """ if docname == 'changes': - changelog_path = os.path.join(os.path.dirname(__file__), "../CHANGES") + changelog_path = os.path.join(os.path.dirname(__file__), "../CHANGES.rst") # this path trickery is needed because this script can # be invoked with different working directories: # * running make in docs/ @@ -227,7 +227,7 @@ def linkify(match): linkified_changelog = re.sub(r'(?:PR)?#([0-9]+)\b', linkify, changelog) - source[0] = source[0].replace('.. include:: ../CHANGES', linkified_changelog) + source[0] = source[0].replace('.. include:: ../CHANGES.rst', linkified_changelog) def setup(app): diff --git a/doc/examples.rst b/doc/examples.rst index c28364a6ae9..492752af918 100644 --- a/doc/examples.rst +++ b/doc/examples.rst @@ -2,4 +2,4 @@ .. _examples: -.. include:: ../EXAMPLES +.. include:: ../EXAMPLES.rst diff --git a/doc/internals/code-of-conduct.rst b/doc/internals/code-of-conduct.rst index 8e31ef0af2f..c7e2e34e76b 100644 --- a/doc/internals/code-of-conduct.rst +++ b/doc/internals/code-of-conduct.rst @@ -2,4 +2,4 @@ .. _code_of_conduct: -.. include:: ../../CODE_OF_CONDUCT +.. include:: ../../CODE_OF_CONDUCT.rst diff --git a/doc/internals/contributing.rst b/doc/internals/contributing.rst index 195f6a56c0b..b62746806f5 100644 --- a/doc/internals/contributing.rst +++ b/doc/internals/contributing.rst @@ -114,7 +114,7 @@ These are the basic steps needed to start developing on Sphinx. Write your code along with tests that shows that the bug was fixed or that the feature works as expected. -#. Add a bullet point to :file:`CHANGES` if the fix or feature is not trivial +#. Add a bullet point to :file:`CHANGES.rst` if the fix or feature is not trivial (small doc updates, typo fixes), then commit:: git commit -m '#42: Add useful new feature that does this.' @@ -142,7 +142,7 @@ Please follow these guidelines when writing code for Sphinx: * Try to use the same code style as used in the rest of the project. -* For non-trivial changes, please update the :file:`CHANGES` file. If your +* For non-trivial changes, please update the :file:`CHANGES.rst` file. If your changes alter existing behavior, please document this. * New features should be documented. Include examples and use cases where diff --git a/doc/internals/organization.rst b/doc/internals/organization.rst index 9dec9231b06..8ca1446651f 100644 --- a/doc/internals/organization.rst +++ b/doc/internals/organization.rst @@ -24,7 +24,7 @@ The following are some general guidelines for core developers: in a good working state and that all tests pass before pushing your changes. * When committing code written by someone else, please attribute the original - author in the commit message and any relevant :file:`CHANGES` entry. + author in the commit message and any relevant :file:`CHANGES.rst` entry. Membership ~~~~~~~~~~ diff --git a/doc/internals/release-process.rst b/doc/internals/release-process.rst index 50648cd56e6..93d5ba5946c 100644 --- a/doc/internals/release-process.rst +++ b/doc/internals/release-process.rst @@ -122,4 +122,4 @@ Date Python Release procedures ------------------ -The release procedures are listed in ``utils/release-checklist``. +The release procedures are listed in :file:`utils/release-checklist.rst`. diff --git a/pyproject.toml b/pyproject.toml index 0a9bc9e62f0..a0ada3cd3ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -112,13 +112,13 @@ name = "sphinx" [tool.flit.sdist] include = [ - "LICENSE", - "AUTHORS", - "CHANGES", + "LICENSE.rst", + "AUTHORS.rst", + "CHANGES.rst", # Documentation "doc/", - "CODE_OF_CONDUCT", # used as an include in the Documentation - "EXAMPLES", # used as an include in the Documentation + "CODE_OF_CONDUCT.rst", # used as an include in the Documentation + "EXAMPLES.rst", # used as an include in the Documentation # Tests "tests/", "tox.ini", diff --git a/utils/CHANGES_template b/utils/CHANGES_template.rst similarity index 100% rename from utils/CHANGES_template rename to utils/CHANGES_template.rst diff --git a/utils/bump_version.py b/utils/bump_version.py index 6e507551ac1..c901ac0a9a8 100755 --- a/utils/bump_version.py +++ b/utils/bump_version.py @@ -129,7 +129,7 @@ def add_release(self, version_info): f'{RELEASE_TYPE.get(reltype, reltype)}{version_info[4] or ""}') heading = 'Release %s (in development)' % version - with open(os.path.join(script_dir, 'CHANGES_template'), encoding='utf-8') as f: + with open(os.path.join(script_dir, 'CHANGES_template.rst'), encoding='utf-8') as f: f.readline() # skip first two lines f.readline() tmpl = f.read() @@ -166,7 +166,7 @@ def main(): options.version, options.in_develop) with processing('Rewriting CHANGES'): - changes = Changes(os.path.join(package_dir, 'CHANGES')) + changes = Changes(os.path.join(package_dir, 'CHANGES.rst')) if changes.version_info == options.version: if changes.in_development: changes.finalize_release_date() diff --git a/utils/release-checklist b/utils/release-checklist.rst similarity index 100% rename from utils/release-checklist rename to utils/release-checklist.rst