[Bug 268018] textproc/py-sphinx: Updating to 5.3.0, ensuring themes are installed, using flit and pyproject-build

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 27 Nov 2022 18:25:22 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268018

            Bug ID: 268018
           Summary: textproc/py-sphinx: Updating to 5.3.0, ensuring themes
                    are installed, using flit and pyproject-build
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: python@FreeBSD.org
          Reporter: lab+bsd@thinkum.space
             Flags: maintainer-feedback?(python@FreeBSD.org)
          Assignee: python@FreeBSD.org

Created attachment 238375
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=238375&action=edit
py-sphinx update to 5.3.0 using the new py build system

textproc/py-sphinx is presently available in a version 5.3.0. 

An update for py-sphinx may be of interest when updating some ports that use
sphinx, e.g devel/py-nbclassic (if updating to 0.4.8) and devel/py-pip (if
updating to 22.3.1)

The attached diff introduces one approach to addressing the following concerns,
such that might be encountered in any approach updating to 5.3.0 in py-sphinx;
- Sphinx 5.3.0 uses PEP 517 conventions for the build.
- This newer build system pyrpoject.toml, rather than a setup.py
- via pyproject.toml, the upstream build then uses flit when preparing the
sources for distribution. (Contextually, this mayu be for distributions with
sdist and/or wheel archives, such that may then be published to intermediate
repositories such as PyPI)
- Using upstream conventions, the version in this updated build would be
derived from Git changelog information. This changelog information is not
available in the tar bundle downloaded from cheeseshop


In the approached presented with this patch, pyproject-build and flit are used
to prepare the sources before building with distutils. 

The approach of using pyproject-build to prepare the sources was referenced
partly on some tooling in the Debian dh-python[1] project. 

The distutils part of the build is referenced on the existing known-good
approaches used in FreeBSD ports.

To work around the concern about the dynamic versioning with the upstream
pyproject.toml, a new patch is introduced, along with a post-patch call to
inject a version string to pyproject.toml. 

This version string is then available for distutils, without further
modification on the upstream sources - e.g if there was a setup.cfg ensuring
setuptools_scm would be used directly. There isn't in this project, but it
seems it was used anyway.

In this approach - mainly, in using pyproject-build and flit to prepare the
sources before building with distutils - the package will be installed with all
source files, as filtered through flit, in addition to pyc files. This would be
for a given set of extensions and other configuration selected onto
pyproject.toml for the respective upstream build components (here, using flit,
with no extensions in this project's pyproject.toml). 

Maybe other projects with a pyproject.toml and no setup.py could use a similar
approach, however possibly further refined.

For this port, this approach has the effect that the sphinx themes and other
non-py sphinx resources will be installed along with the pkg. 

Thus, the basic sphinx theme and other sphinx themes will then be available
with the updated port.

The 'basic' theme itself may be required for the docs part of some other
py-port builds - at least, after an update in each. This may include any ports
using the textproc/py-sphinx-basic-ng them and thus transitively,
textproc/py-sphinx_rtd_theme

[1]
https://salsa.debian.org/python-team/tools/dh-python/-/blob/master/dhpython/build/plugin_pyproject.py#L105

-- 
You are receiving this mail because:
You are the assignee for the bug.