From 7b13a7534a9a51af5f3625e64d5390645cce3ecb Mon Sep 17 00:00:00 2001 From: "build@apk-groulx" Date: Fri, 3 Feb 2023 08:17:48 +0000 Subject: [PATCH] backports/py3-sphinxcontrib-autoprogram: backported from edge/testing --- .../py3-sphinxcontrib-autoprogram/APKBUILD | 34 +++++++++++++++++++ .../fix-argparse-output-py310.patch | 19 +++++++++++ 2 files changed, 53 insertions(+) create mode 100644 backports/py3-sphinxcontrib-autoprogram/APKBUILD create mode 100644 backports/py3-sphinxcontrib-autoprogram/fix-argparse-output-py310.patch diff --git a/backports/py3-sphinxcontrib-autoprogram/APKBUILD b/backports/py3-sphinxcontrib-autoprogram/APKBUILD new file mode 100644 index 0000000..3374963 --- /dev/null +++ b/backports/py3-sphinxcontrib-autoprogram/APKBUILD @@ -0,0 +1,34 @@ +# Maintainer: Hoang Nguyen +pkgname=py3-sphinxcontrib-autoprogram +pkgver=0.1.7 +pkgrel=2 +pkgdesc="Sphinx extension to document CLI programs" +url="https://github.com/sphinx-contrib/autoprogram" +arch="noarch" +license="BSD-2-Clause" +depends="python3 py3-six py3-sphinx" +makedepends="py3-setuptools" +source=" + $pkgname-$pkgver.tar.gz::https://github.com/sphinx-contrib/autoprogram/archive/refs/tags/$pkgver.tar.gz + fix-argparse-output-py310.patch + " +builddir="$srcdir/autoprogram-$pkgver" +# fail with new docutils +options="!check" + +build() { + python3 setup.py build +} + +check() { + python3 setup.py test +} + +package() { + python3 setup.py install --skip-build --root="$pkgdir" +} + +sha512sums=" +81679a8bed93274193efb5ac784d72280db32f37156aca5a422af6c8e8abd6d4e4a22e070ee73e9b3194eacf22a8228be0df3329f6fd6a0ff2408a3c7973c8a7 py3-sphinxcontrib-autoprogram-0.1.7.tar.gz +2405814d8cf546b6078e8d3c854943e1b5603cbc52558dad67fcaf7a729e1f6a29ae049e1172fe4612ccb20f0209ddebedf7c2a214602f1d6b7720b2fbcf0caa fix-argparse-output-py310.patch +" diff --git a/backports/py3-sphinxcontrib-autoprogram/fix-argparse-output-py310.patch b/backports/py3-sphinxcontrib-autoprogram/fix-argparse-output-py310.patch new file mode 100644 index 0000000..e51ea24 --- /dev/null +++ b/backports/py3-sphinxcontrib-autoprogram/fix-argparse-output-py310.patch @@ -0,0 +1,19 @@ +Patch-Source: https://github.com/sphinx-contrib/autoprogram/pull/25 + +diff --git a/sphinxcontrib/autoprogram.py b/sphinxcontrib/autoprogram.py +index c60cf68..0e7d9a0 100644 +--- a/sphinxcontrib/autoprogram.py ++++ b/sphinxcontrib/autoprogram.py +@@ -476,7 +476,11 @@ class ScannerTestCase(unittest.TestCase): + # section: default optionals + program, options, group = sections[1] + self.assertEqual([], program) +- self.assertEqual("optional arguments", group.title) ++ # See https://github.com/sphinx-contrib/autoprogram/issues/24 ++ if sys.version_info >= (3, 10): ++ self.assertEqual("options", group.title) ++ else: ++ self.assertEqual("optional arguments", group.title) + self.assertEqual(None, group.description) + self.assertEqual(2, len(options)) + self.assertEqual(