Subject: [bug#52721] [PATCH]v2 gnu: python-pydata-sphinx-theme: Fix build.

From: Aleksandr Vityazev <[email-masked]>
Date: Wed, 22 Dec 2021 18:17:57 +0000

Hi,
On 2021-12-22, 10:53 +0000, Maxime Devos <[email-masked]> wrote:

>> the build fails because a package is required python-docutils < 0.17.
>
> Is python-docutils<0.17 truly required, or are the version requirements
> in the source code overly strict? If it's the latter, you could patch
> the source code to relax the requirements.
>
> The latter happens often, because library developers often don't know
> in advance whether the library is compatible with future versions of
> the dependencies.

For version 0.6.3 there is a file
pydata-sphinx-theme-0.6.3/docs/requirements.txt where the last line
contains:

docutils==0.16 # temporary pin (0.17 broken captions).

Also, the master version requires "docutils!=0.17.0.

So I created a patch that adds an extra phase.

>From 7301a82b07e73c3bdbeef0d1375094d625336766 Mon Sep 17 00:00:00 2001
Message-Id: <7[email-masked]>
From: Aleksandr Vityazev <[email-masked]>
Date: Wed, 22 Dec 2021 17:25:18 +0300
Subject: [PATCH] gnu: python-pydata-sphinx-theme: Fix build.

* gnu/packages/sphinx (python-pydata-sphinx-theme):
[arguments]: add phase "relax-dependency-requirements".
---
 gnu/packages/sphinx.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/sphinx.scm b/gnu/packages/sphinx.scm
index 3ac5b5e22c..c9a9a2efbb 100644
--- a/gnu/packages/sphinx.scm
+++ b/gnu/packages/sphinx.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2021 Vinicius Monego <[email-masked]>
 ;;; Copyright © 2021 Hugo Lecomte <[email-masked]>
 ;;; Copyright © 2021 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2021 Aleksandr Vityazev <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -915,6 +916,13 @@ (define-public python-pydata-sphinx-theme
         (base32
          "055bh3hyh72pafiylvgpsjlk18wm15gg4azc5rjlsww5z475iq1j"))))
     (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'relax-dependency-requirements
+           (lambda _
+             (substitute* "setup.py"
+               (("docutils<0.17") "docutils")))))))
     (propagated-inputs
      (list python-beautifulsoup4))
     (native-inputs
-- 
2.34.0

-- 
Best regards,
Aleksandr Vityazev