This thread contains a patchset. You're looking at the original emails,
but you may wish to use the patch review UI.
Review patch
4
2
[PATCH sr.ht-apkbuilds 1/3] py3-ansi2html: Remove setuptools_scm_git_archive dep
py3-setuptools-scm-git-archive has been removed from Alpine Edge, but it
wasn't needed to begin with.
---
...etuptools_scm_git_archive-dependency.patch | 26 +++++++++++++++++++
sr.ht/py3-ansi2html/APKBUILD | 8 ++++ --
2 files changed, 32 insertions(+), 2 deletions(-)
create mode 100644 sr.ht/py3-ansi2html/0001-Remove-setuptools_scm_git_archive-dependency.patch
diff --git a/sr.ht/py3-ansi2html/0001-Remove-setuptools_scm_git_archive-dependency.patch b/sr.ht/py3-ansi2html/0001-Remove-setuptools_scm_git_archive-dependency.patch
new file mode 100644
index 0000000..4b33257
--- /dev/null
+++ b/sr.ht/py3-ansi2html/0001-Remove-setuptools_scm_git_archive-dependency.patch
@@ -0,0 +1,26 @@
+ From b58b0c66f1bb1ff11396caae8ada6fee63506c2d Mon Sep 17 00:00:00 2001
+ From: Maxwell G <gotmax@e.email>
+ Date: Mon, 14 Nov 2022 12:23:12 -0600
+ Subject: [PATCH] Remove setuptools_scm_git_archive dependency
+
+ This package sets SETUPTOOLS_SCM_PRETEND_VERSION, so this functionality
+ is not needed.
+ ---
+ pyproject.toml | 1 -
+ 1 file changed, 1 deletion(-)
+
+ diff --git a/pyproject.toml b/pyproject.toml
+ index 737ec35..536c25f 100644
+ --- a/pyproject.toml
+ +++ b/pyproject.toml
+ @@ -2,7 +2,6 @@
+ requires = [
+ "setuptools >= 41.0.0",
+ "setuptools_scm >= 6.0.1",
+ - "setuptools_scm_git_archive >= 1.0",
+ "wheel",
+ ]
+ build-backend = "setuptools.build_meta"
+ --
+ 2.38.1
+
diff --git a/sr.ht/py3-ansi2html/APKBUILD b/sr.ht/py3-ansi2html/APKBUILD
index 273c9ba..92505a5 100644
--- a/sr.ht/py3-ansi2html/APKBUILD
+++ b/sr.ht/py3-ansi2html/APKBUILD
@@ -9,11 +9,14 @@ url="http://github.com/ralphbean/ansi2html/"
arch="noarch"
license="LGPL-3.0-or-later"
depends="py3-six"
- makedepends="py3-setuptools_scm py3-setuptools-scm-git-archive py3-wheel py3-installer py3-build"
+ makedepends="py3-setuptools_scm py3-wheel py3-installer py3-build"
checkdepends="py3-pytest py3-mock py3-nose"
replaces="py-ansi2html py2-ansi2html"
_pypiprefix="${_pyname%${_pyname#?}}"
- source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
+ source="
+ https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz
+ 0001-Remove-setuptools_scm_git_archive-dependency.patch
+ "
builddir="$srcdir"/$_pyname-$pkgver
options="!check" # Upstream tests are stupid
@@ -33,4 +36,5 @@ package() {
sha512sums="
cbdda41f206ced5b19761a1ff9747acc6cadca3a5a2f58c97c6073db7d517e59fea7601bba28a8e7e105f3c0c9c4d78ca4f242100cbded6c8a9ca2d598de0ab4 ansi2html-1.8.0.tar.gz
+ 4113ab8ebab86e7ea28e341a6b0486c31676f82f89ac8214f3a636c9f7abcd6d6768de65483866752d557d4e63f13feebb1bcf1440d41b94936108730ff0bf63 0001-Remove-setuptools_scm_git_archive-dependency.patch
"
--
2.38.1
[PATCH sr.ht-apkbuilds 2/3] py3-ansi2html: Run unit tests
---
sr.ht/py3-ansi2html/APKBUILD | 7 +++++ --
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sr.ht/py3-ansi2html/APKBUILD b/sr.ht/py3-ansi2html/APKBUILD
index 92505a5..1fb6dfb 100644
--- a/sr.ht/py3-ansi2html/APKBUILD
+++ b/sr.ht/py3-ansi2html/APKBUILD
@@ -18,7 +18,6 @@ https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$p
0001-Remove-setuptools_scm_git_archive-dependency.patch
"
builddir="$srcdir"/$_pyname-$pkgver
- options="!check" # Upstream tests are stupid
build() {
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
@@ -26,7 +25,11 @@ build() {
}
check() {
- PYTHONPATH="$(pwd)" pytest-3
+ python3 -m venv --system-site-packages testenv
+ source testenv/bin/activate
+ python3 -m installer \
+ dist/ansi2html-$pkgver-py3-none-any.whl
+ python3 -m pytest
}
package() {
--
2.38.1
[PATCH sr.ht-apkbuilds 3/3] py3-ansi2html: Clean up dependencies
---
sr.ht/py3-ansi2html/APKBUILD | 5 ++ ---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sr.ht/py3-ansi2html/APKBUILD b/sr.ht/py3-ansi2html/APKBUILD
index 1fb6dfb..ca6d9a0 100644
--- a/sr.ht/py3-ansi2html/APKBUILD
+++ b/sr.ht/py3-ansi2html/APKBUILD
@@ -8,9 +8,8 @@ pkgdesc="Convert text with ANSI color codes to HTML"
url="http://github.com/ralphbean/ansi2html/"
arch="noarch"
license="LGPL-3.0-or-later"
- depends="py3-six"
- makedepends="py3-setuptools_scm py3-wheel py3-installer py3-build"
- checkdepends="py3-pytest py3-mock py3-nose"
+ makedepends="py3-setuptools py3-setuptools_scm py3-wheel py3-installer py3-build"
+ checkdepends="py3-pytest"
replaces="py-ansi2html py2-ansi2html"
_pypiprefix="${_pyname%${_pyname#?}}"
source="
--
2.38.1
Re: [PATCH sr.ht-apkbuilds 2/3] py3-ansi2html: Run unit tests
I am very much not fond of using a virtualenv here
Re: [PATCH sr.ht-apkbuilds 2/3] py3-ansi2html: Run unit tests
On Mon Nov 21, 2022 at 16:59 +0100, Drew DeVault wrote:
> I am very much not fond of using a virtualenv here
Me neither, but I'm not sure how else to accomplish this. The tests need
access to the binaries installed by the package. The Alpine Linux wiki
suggests this venv approach. It wouldn't be necessary if abuild ran
check() after package(). In my book, this is better than not running the
tests at all.
```
Sometimes you might have to pass the path to the built package to run tests:
<pre>
check() {
python3 -m venv --system-site-packages testenv
testenv/bin/python3 -m installer \
dist/PyFoo-$pkgver-py3-none-any.whl
testenv/bin/python3 -m pytest
}
</pre>
```
-- https://wiki.alpinelinux.org/wiki/APKBUILD_examples:Python
--
Maxwell G (@gotmax23)
Pronouns: He/Him/His