Skip to content

Commit

Permalink
Add changelog to docs and fix external links
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Morin <[email protected]>
  • Loading branch information
JeanChristopheMorinPerso committed Nov 18, 2023
1 parent 26ce215 commit 77dde32
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 16 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# 0.3.1 (2023-11-17)
# Changelog

<!-- start-here-sphinx-start-after -->

## 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)
* Update pip from 23.1.2 to 23.2 (#44)
* 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.

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ sphinx ~= 7.2
furo
sphinx-autobuild
sphinx-inline-tabs
myst-parser
5 changes: 5 additions & 0 deletions docs/source/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

```{include} ../../CHANGELOG.md
:start-after: <!-- start-here-sphinx-start-after -->
```
58 changes: 58 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -21,6 +26,7 @@
"sphinx.ext.autosectionlabel",
# Third-part
"sphinx_inline_tabs",
"myst_parser",
]

templates_path = ["_templates"]
Expand All @@ -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)
5 changes: 3 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/AcademySoftwareFoundation/rez/blob/master/install.py>`_ script).
automatically created by the `install.py <https://github.com/AcademySoftwareFoundation/rez/blob/main/install.py>`_ script).

.. tab:: Linux/macOS

Expand Down Expand Up @@ -68,4 +68,5 @@ automatically created by the `install.py <https://github.com/AcademySoftwareFoun
user_guide
transition
metadata
faq.rst
faq
changelog
6 changes: 2 additions & 4 deletions docs/source/transition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ package (positional) package(**s**) (positional) Now accepts multiple packages.
``--pip-version`` ``--pip`` Pip is now bundled with rez-pip, but ``--pip`` can be used to specify a different pip zipapp.
``-i``/``--install`` Removed
``-r``/``--release`` Identical
``-p``/``--prefix`` ``--prefix`` Defaults to `local_packages_path`_.
``-p``/``--prefix`` ``--prefix`` Defaults to :external:data:`local_packages_path`.
``-e``/``--extra`` ``--`` ``--extra`` was replaced with trailing ``--``. For example ``rez-pip ... -- --index-url https://example.com``
==================== =========================== =======

.. _local_packages_path: https://github.com/AcademySoftwareFoundation/rez/wiki/Configuring-Rez#local_packages_path

Local and editable installs
===========================

Expand All @@ -43,7 +41,7 @@ I believe these functionalities would be better implemented and would better ser
users if implemented as a `build_system`_ plugin. It would allow for better integration
with rez and the user experience would be significantly better than it could with ``rez-pip``.

.. _build_system: https://github.com/AcademySoftwareFoundation/rez/tree/master/src/rezplugins/build_system
.. _build_system: https://github.com/AcademySoftwareFoundation/rez/tree/main/src/rezplugins/build_system

I also believe that python packaging/rez hybrids are bad and just causes more issues than
they solve. The python packaging ecosystem and tools have different objectives and goals
Expand Down
7 changes: 2 additions & 5 deletions docs/source/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ so you can use it multiple times to install from multiple requriement files.
The ``-c``/``--constraint`` argument is also available and can also be used multiple times.

.. note::
By default, rez-pip will install packages in your configured `local_packages_path`_.
To install in your `release_packages_path`_,
By default, rez-pip will install packages in your configured :external:data:`local_packages_path`.
To install in your :external:data:`release_packages_path`,
use the ``--release`` command line argument.

.. _local_packages_path: https://github.com/AcademySoftwareFoundation/rez/wiki/Configuring-Rez#local_packages_path
.. _release_packages_path: https://github.com/AcademySoftwareFoundation/rez/wiki/Configuring-Rez#release_packages_path

Selecting the python version
============================

Expand Down

0 comments on commit 77dde32

Please sign in to comment.