diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1d38797..c5e6f43 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,11 +7,13 @@ on: - .github/workflows/update_pip.yaml - docs/** - .readthedocs.yaml + - '*.md' pull_request: paths-ignore: - .github/workflows/update_pip.yaml - docs/** - .readthedocs.yaml + - '*.md' concurrency: cancel-in-progress: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 4852c5e..e4a5d9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,13 @@ -# 0.3.1 (2023-11-17) +# Changelog + + + +## 0.3.1 (2023-11-17) * Fix decoding error when reading pip dependency report. See [PR #63](https://github.com/JeanChristopheMorinPerso/rez-pip/pull/63). * Update vendored pip from 23.2.1 to 23.3.1 -# 0.3.0 (2023-10-12) +## 0.3.0 (2023-10-12) Most notable changes: * Don't append system PATH to context when finding the python executables (#47) @@ -11,7 +15,7 @@ Most notable changes: * Ensure Windows short paths are resolved to long paths (#50) * Read rez-pip version from distribution metadata (#53) -# 0.2.0 (2023-07-04) +## 0.2.0 (2023-07-04) This release fixes a lot of bugs and gets us closer to a more official release. diff --git a/docs/Makefile b/docs/Makefile index 790e03f..796112f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. -SPHINXOPTS ?= +SPHINXOPTS ?= -n SPHINXBUILD ?= sphinx-build SOURCEDIR = source BUILDDIR = build diff --git a/docs/make.bat b/docs/make.bat index 747ffb7..7b6551e 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -25,7 +25,7 @@ if errorlevel 9009 ( if "%1" == "" goto help -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -n %O% goto end :help diff --git a/docs/requirements.txt b/docs/requirements.txt index 9131424..3082493 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,3 +2,4 @@ sphinx ~= 7.2 furo sphinx-autobuild sphinx-inline-tabs +myst-parser diff --git a/docs/source/changelog.md b/docs/source/changelog.md new file mode 100644 index 0000000..6b4af78 --- /dev/null +++ b/docs/source/changelog.md @@ -0,0 +1,5 @@ +# Changelog + +```{include} ../../CHANGELOG.md +:start-after: +``` diff --git a/docs/source/conf.py b/docs/source/conf.py index d53701d..3abcaa3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -3,6 +3,11 @@ # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html +from sphinx.application import Sphinx +from sphinx.transforms import SphinxTransform +from docutils.nodes import reference, Text +import re + # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information @@ -21,6 +26,7 @@ "sphinx.ext.autosectionlabel", # Third-part "sphinx_inline_tabs", + "myst_parser", ] templates_path = ["_templates"] @@ -33,7 +39,59 @@ html_theme = "furo" html_static_path = ["_static"] + # -- Options for sphinx.ext.autosectionlabel --------------------------------- # https://www.sphinx-doc.org/en/master/usage/extensions/autosectionlabel.html autosectionlabel_prefix_document = True + + +# -- Options for the linkcheck builder --------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-the-linkcheck-builder + +linkcheck_allowed_redirects = { + r'https://github.com/JeanChristopheMorinPerso/rez-pip/issues/\d+': 'https://github.com/JeanChristopheMorinPerso/rez-pip/pull/\d+' +} + + +# -- Options for sphinx.ext.intersphinx_mapping ------------------------------ +# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html + +intersphinx_mapping = { + 'rez': ('https://rez.readthedocs.io/en/stable/', None), +} + +# Force usage of :external: +intersphinx_disabled_reftypes = ["*"] + + +# -- Custom ------------------------------------------------------------------ +# Custom stuff + + +class ReplaceGHRefs(SphinxTransform): + default_priority = 750 + prefix = "https://github.com/JeanChristopheMorinPerso/rez-pip/issues" + + def apply(self): + istext = lambda o: isinstance(o, Text) + + for node in self.document.traverse(istext): + match = re.match(r".*\((\#(\d+))\)\.?$", str(node)) + if not match: + continue + + newtext = Text(str(node)[: match.start(1)]) + newreference = reference( + "", match.group(1), refuri=f"{self.prefix}/{match.group(2)}" + ) + trailingtext = Text(str(node)[match.end(1) :]) + node.parent.replace(node, newtext) + node.parent.insert(node.parent.index(newtext) + 1, newreference) + node.parent.insert(node.parent.index(newtext) + 2, trailingtext) + + return + + +def setup(app: Sphinx): + app.add_transform(ReplaceGHRefs) diff --git a/docs/source/index.rst b/docs/source/index.rst index 75f81df..eb7848c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -35,7 +35,7 @@ Installation ``rez-pip`` can be installed by using pip. We highly recommend that you install it into your rez's virtual environment (the virtualenv that is -automatically created by the `install.py `_ script). +automatically created by the `install.py `_ script). .. tab:: Linux/macOS @@ -68,4 +68,5 @@ automatically created by the `install.py