From d67b7285343368efb5da6efa50341e1c025f5a2b Mon Sep 17 00:00:00 2001 From: k4leg Date: Fri, 27 Aug 2021 01:05:08 +0300 Subject: [PATCH 1/5] New package: python3-debian-0.1.40 --- .../0001-Disable-apt_pkg-support.patch | 146 ++++++++++++++++++ srcpkgs/python3-debian/template | 17 ++ srcpkgs/python3-debian/update | 2 + 3 files changed, 165 insertions(+) create mode 100644 srcpkgs/python3-debian/patches/0001-Disable-apt_pkg-support.patch create mode 100644 srcpkgs/python3-debian/template create mode 100644 srcpkgs/python3-debian/update diff --git a/srcpkgs/python3-debian/patches/0001-Disable-apt_pkg-support.patch b/srcpkgs/python3-debian/patches/0001-Disable-apt_pkg-support.patch new file mode 100644 index 000000000000..6765b2f6c3a0 --- /dev/null +++ b/srcpkgs/python3-debian/patches/0001-Disable-apt_pkg-support.patch @@ -0,0 +1,146 @@ +From e87972d4ae499d7049338ddb0d5009b6527a93dc Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Mon, 8 Feb 2021 22:24:33 -0500 +Subject: [PATCH] Disable apt_pkg support + +--- + lib/debian/deb822.py | 4 +-- + lib/debian/tests/test_deb822.py | 58 --------------------------------- + 2 files changed, 2 insertions(+), 60 deletions(-) + +diff --git a/lib/debian/deb822.py b/lib/debian/deb822.py +index 46cf81a..158033f 100644 +--- a/lib/debian/deb822.py ++++ b/lib/debian/deb822.py +@@ -2286,7 +2286,7 @@ class Sources(Dsc, _PkgRelationMixin): + def iter_paragraphs(cls, + sequence, # type: InputDataType + fields=None, # type: Optional[List[str]] +- use_apt_pkg=True, # type: bool ++ use_apt_pkg=False, # type: bool + shared_storage=False, # type: bool + encoding="utf-8", # type: str + strict=None, # type: Optional[Dict[str, bool]] +@@ -2328,7 +2328,7 @@ class Packages(Deb822, _PkgRelationMixin, _VersionAccessorMixin): + def iter_paragraphs(cls, + sequence, # type: InputDataType + fields=None, # type: Optional[List[str]] +- use_apt_pkg=True, # type: bool ++ use_apt_pkg=False, # type: bool + shared_storage=False, # type: bool + encoding="utf-8", # type: str + strict=None, # type: Optional[Dict[str, bool]] +diff --git a/lib/debian/tests/test_deb822.py b/lib/debian/tests/test_deb822.py +index f386391..7fb11fa 100755 +--- a/lib/debian/tests/test_deb822.py ++++ b/lib/debian/tests/test_deb822.py +@@ -42,8 +42,6 @@ else: + from StringIO import StringIO + BytesIO = StringIO + +-import apt_pkg +- + from debian import deb822 + from debian.debian_support import Version + +@@ -541,11 +539,6 @@ with open("test_deb822.pickle", "wb") as fh: + for d in deb822.Deb822.iter_paragraphs(text, use_apt_pkg=False): + self.assertWellParsed(d, PARSED_PACKAGE) + +- with self.assertWarns(UserWarning): +- # The StringIO is not a real file so this will raise a warning +- for d in deb822.Deb822.iter_paragraphs(text, use_apt_pkg=True): +- self.assertWellParsed(d, PARSED_PACKAGE) +- + def test_iter_paragraphs_file(self): + # type: () -> None + text = StringIO() +@@ -564,10 +557,6 @@ with open("test_deb822.pickle", "wb") as fh: + for d in deb822.Deb822.iter_paragraphs(fh, use_apt_pkg=False): + self.assertWellParsed(d, PARSED_PACKAGE) + +- fh.seek(0) +- for d in deb822.Deb822.iter_paragraphs(fh, use_apt_pkg=True): +- self.assertWellParsed(d, PARSED_PACKAGE) +- + + def test_iter_paragraphs_with_gpg(self): + # type: () -> None +@@ -640,12 +629,7 @@ with open("test_deb822.pickle", "wb") as fh: + test_count(deb822.Deb822.iter_paragraphs, 2) + test_count(deb822.Deb822.iter_paragraphs, 2, use_apt_pkg=False) + +- # apt_pkg used, should not split +- test_count(deb822.Deb822.iter_paragraphs, 1, use_apt_pkg=True) +- + # Specialised iter_paragraphs force use of apt_pkg and don't split +- test_count(deb822.Packages.iter_paragraphs, 1, use_apt_pkg=True) +- test_count(deb822.Sources.iter_paragraphs, 1, use_apt_pkg=True) + test_count(deb822.Packages.iter_paragraphs, 1, use_apt_pkg=False) + test_count(deb822.Sources.iter_paragraphs, 1, use_apt_pkg=False) + +@@ -692,32 +676,12 @@ with open("test_deb822.pickle", "wb") as fh: + s.write(b"\n") + self.assertEqual(s.getvalue(), packages_content) + +- def test_iter_paragraphs_apt_shared_storage_packages(self): +- # type: () -> None +- self._test_iter_paragraphs(find_test_file("test_Packages"), +- deb822.Packages, +- use_apt_pkg=True, shared_storage=True) +- def test_iter_paragraphs_apt_no_shared_storage_packages(self): +- # type: () -> None +- self._test_iter_paragraphs(find_test_file("test_Packages"), +- deb822.Packages, +- use_apt_pkg=True, shared_storage=False) + def test_iter_paragraphs_no_apt_no_shared_storage_packages(self): + # type: () -> None + self._test_iter_paragraphs(find_test_file("test_Packages"), + deb822.Packages, + use_apt_pkg=False, shared_storage=False) + +- def test_iter_paragraphs_apt_shared_storage_sources(self): +- # type: () -> None +- self._test_iter_paragraphs(find_test_file("test_Sources"), +- deb822.Sources, +- use_apt_pkg=True, shared_storage=True) +- def test_iter_paragraphs_apt_no_shared_storage_sources(self): +- # type: () -> None +- self._test_iter_paragraphs(find_test_file("test_Sources"), +- deb822.Sources, +- use_apt_pkg=True, shared_storage=False) + def test_iter_paragraphs_no_apt_no_shared_storage_sources(self): + # type: () -> None + self._test_iter_paragraphs(find_test_file("test_Sources"), +@@ -1091,28 +1055,6 @@ Description: python modules to work with Debian-related data formats + self.assertWellParsed(paragraphs[i], + PARSED_PARAGRAPHS_WITH_COMMENTS[i]) + +- def test_iter_paragraphs_comments_use_apt_pkg(self): +- # type: () -> None +- """ apt_pkg does not support comments within multiline fields +- +- This test checks that a file with comments inside multiline fields +- generates an error from the apt_pkg parser. +- +- See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750247#35 +- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807351 +- """ +- try: +- fd, filename = tempfile.mkstemp() +- fp = os.fdopen(fd, 'wb') +- fp.write(UNPARSED_PARAGRAPHS_WITH_COMMENTS.encode('utf-8')) +- fp.close() +- +- with open_utf8(filename) as fh: +- with self.assertRaises(apt_pkg.Error): +- list(deb822.Deb822.iter_paragraphs(fh, use_apt_pkg=True)) +- finally: +- os.remove(filename) +- + def test_iter_paragraphs_comments_native(self): + # type: () -> None + paragraphs = list(deb822.Deb822.iter_paragraphs( +-- +2.30.0 + diff --git a/srcpkgs/python3-debian/template b/srcpkgs/python3-debian/template new file mode 100644 index 000000000000..fddcf5cc6eb1 --- /dev/null +++ b/srcpkgs/python3-debian/template @@ -0,0 +1,17 @@ +# Template file for 'python3-debian' +pkgname=python3-debian +_pkgname=python-debian +version=0.1.40 +revision=1 +wrksrc="${_pkgname}-${version}" +build_style=python3-module +hostmakedepends="python3-setuptools" +depends="python3>=3.3 python3-chardet python3-six" +checkdepends="python3-pip dpkg tar" +short_desc="Python modules work with Debian-related data formats" +maintainer="k4leg " +license="GPL-2.0-or-later" +homepage="https://salsa.debian.org/python-debian-team/python-debian" +# Don't use PyPI because it has no tests. +distfiles="${homepage}/-/archive/${version}/${_pkgname}-${version}.tar.gz" +checksum=f7f726ffd678f9ce2e099b6b036f63c1793da4898d5de1fcec31cab2630f8096 diff --git a/srcpkgs/python3-debian/update b/srcpkgs/python3-debian/update new file mode 100644 index 000000000000..3937dc8b373c --- /dev/null +++ b/srcpkgs/python3-debian/update @@ -0,0 +1,2 @@ +site='https://salsa.debian.org/python-debian-team/python-debian/tags?format=atom' +pattern='\K[\d.]+(?=)' From 41c45da2bb335c63acac944efebbdefd63608d4f Mon Sep 17 00:00:00 2001 From: k4leg Date: Fri, 27 Aug 2021 14:45:59 +0300 Subject: [PATCH 2/5] New package: python-boolean.py-3.8 --- srcpkgs/python-boolean.py/template | 32 ++++++++++++++++++++++++++++++ srcpkgs/python3-boolean.py | 1 + 2 files changed, 33 insertions(+) create mode 100644 srcpkgs/python-boolean.py/template create mode 120000 srcpkgs/python3-boolean.py diff --git a/srcpkgs/python-boolean.py/template b/srcpkgs/python-boolean.py/template new file mode 100644 index 000000000000..86e5fd002774 --- /dev/null +++ b/srcpkgs/python-boolean.py/template @@ -0,0 +1,32 @@ +# Template file for 'python-boolean.py' +pkgname=python-boolean.py +_pkgname=boolean.py +version=3.8 +revision=1 +wrksrc="${_pkgname}-${version}" +build_style=python-module +hostmakedepends="python-setuptools python3-setuptools" +depends="python>=2.7" +checkdepends="tox>=2.7" +short_desc="Small library implementing a boolean algebra" +maintainer="k4leg " +license="BSD-2-Clause" +homepage="https://github.com/bastikr/boolean.py" +distfiles="${PYPI_SITE}/${_pkgname::1}/${_pkgname}/${_pkgname}-${version}.tar.gz" +checksum=cc24e20f985d60cd4a3a5a1c0956dd12611159d32a75081dabd0c9ab981acaa4 + +do_check() { + tox -e "py${py2_ver/.},py${py3_ver/.}" +} + +post_install() { + vlicense LICENSE.txt +} + +python3-boolean.py_package() { + depends="python3" + pkg_install() { + vmove "$py3_lib" + vlicense LICENSE.txt + } +} diff --git a/srcpkgs/python3-boolean.py b/srcpkgs/python3-boolean.py new file mode 120000 index 000000000000..173e275406a9 --- /dev/null +++ b/srcpkgs/python3-boolean.py @@ -0,0 +1 @@ +python-boolean.py \ No newline at end of file From 000a406a3a7ff667c46ba987d66bfff4720c801b Mon Sep 17 00:00:00 2001 From: k4leg Date: Fri, 27 Aug 2021 15:32:40 +0300 Subject: [PATCH 3/5] New package: python-binaryornot-0.4.4 --- .../patches/0001-fix-failing-test.patch | 22 +++++++++++++ srcpkgs/python-binaryornot/template | 33 +++++++++++++++++++ srcpkgs/python3-binaryornot | 1 + 3 files changed, 56 insertions(+) create mode 100644 srcpkgs/python-binaryornot/patches/0001-fix-failing-test.patch create mode 100644 srcpkgs/python-binaryornot/template create mode 120000 srcpkgs/python3-binaryornot diff --git a/srcpkgs/python-binaryornot/patches/0001-fix-failing-test.patch b/srcpkgs/python-binaryornot/patches/0001-fix-failing-test.patch new file mode 100644 index 000000000000..2070485b6a0d --- /dev/null +++ b/srcpkgs/python-binaryornot/patches/0001-fix-failing-test.patch @@ -0,0 +1,22 @@ +From 38dee57986c6679d9936a1da6f6c8182da3734f8 Mon Sep 17 00:00:00 2001 +From: Greg +Date: Sat, 10 Aug 2019 15:10:33 +0000 +Subject: [PATCH] fix failing test + +--- + tests/test_check.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/test_check.py b/tests/test_check.py +index 1ea31a4..f800583 100755 +--- a/tests/test_check.py ++++ b/tests/test_check.py +@@ -216,7 +216,7 @@ def bytes_in_file(data): + + + class TestDetectionProperties(unittest.TestCase): +- @given(binary(average_size=512)) ++ @given(binary(max_size=512)) + def test_never_crashes(self, data): + with bytes_in_file(data) as f: + is_binary(f) diff --git a/srcpkgs/python-binaryornot/template b/srcpkgs/python-binaryornot/template new file mode 100644 index 000000000000..eb360a4349e5 --- /dev/null +++ b/srcpkgs/python-binaryornot/template @@ -0,0 +1,33 @@ +# Template file for 'python-binaryornot' +pkgname=python-binaryornot +_pkgname=binaryornot +version=0.4.4 +revision=1 +wrksrc="${_pkgname}-${version}" +build_style=python-module +hostmakedepends="python-setuptools python3-setuptools" +depends="python>=2.7 python-chardet>=3.0.2" +checkdepends="tox" +short_desc="Pure Python package to check if a file is binary or text" +maintainer="k4leg " +license="BSD-3-Clause" +homepage="https://github.com/audreyfeldroy/binaryornot" +# Don't use PyPI because some files for testing are missing. +distfiles="${homepage}/archive/${version}.tar.gz" +checksum=8cca04876a5e9d01f0dda79390e99089da87f3c1948ab2720661ba379d1b23f2 + +do_check() { + tox -e "py${py2_ver/.},py${py3_ver/.}" +} + +post_install() { + vlicense LICENSE +} + +python3-binaryornot_package() { + depends="python3>=3.3 python3-chardet>=3.0.2" + pkg_install() { + vmove "$py3_lib" + vlicense LICENSE + } +} diff --git a/srcpkgs/python3-binaryornot b/srcpkgs/python3-binaryornot new file mode 120000 index 000000000000..7a220c40a9b7 --- /dev/null +++ b/srcpkgs/python3-binaryornot @@ -0,0 +1 @@ +python-binaryornot \ No newline at end of file From 155c5513755ecfabd8d434bbd9182a6cae4eef82 Mon Sep 17 00:00:00 2001 From: k4leg Date: Fri, 27 Aug 2021 18:46:32 +0300 Subject: [PATCH 4/5] New package: python3-license-expression-21.6.14 --- srcpkgs/python3-license-expression/template | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 srcpkgs/python3-license-expression/template diff --git a/srcpkgs/python3-license-expression/template b/srcpkgs/python3-license-expression/template new file mode 100644 index 000000000000..2144ff39366a --- /dev/null +++ b/srcpkgs/python3-license-expression/template @@ -0,0 +1,20 @@ +# Template file for 'python3-license-expression' +pkgname=python3-license-expression +_pkgname=license-expression +version=21.6.14 +revision=1 +wrksrc="${_pkgname}-${version}" +build_style=python3-module +hostmakedepends="python3-setuptools>=50 python3-wheel python3-pip" +depends="python3>=3.6 python3-boolean.py>=3.6<4" +checkdepends="tox" +short_desc="Library to parse, normalize and compare license expressions" +maintainer="k4leg " +license="Apache-2.0" +homepage="https://github.com/nexB/license-expression" +distfiles="${PYPI_SITE}/${_pkgname::1}/${_pkgname}/${_pkgname}-${version}.tar.gz" +checksum=9de87a427c9a449eee7913472fb9ed03b63036295547369fdbf95f76a8b924b2 + +do_check() { + tox -e "py${py3_ver/.}" +} From 47c9b713700911fada1a9ff4037d2dfa06dd0501 Mon Sep 17 00:00:00 2001 From: k4leg Date: Fri, 27 Aug 2021 19:09:05 +0300 Subject: [PATCH 5/5] New package: reuse-0.13.0 --- srcpkgs/reuse/template | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 srcpkgs/reuse/template diff --git a/srcpkgs/reuse/template b/srcpkgs/reuse/template new file mode 100644 index 000000000000..d2643c303f1a --- /dev/null +++ b/srcpkgs/reuse/template @@ -0,0 +1,21 @@ +# Template file for 'reuse' +pkgname=reuse +version=0.13.0 +revision=1 +build_style=python3-module +hostmakedepends="python3-setuptools>=52 python3-setuptools_scm>=5.0.1" +depends="python3>=3.6 python3-binaryornot>=0.4.4 python3-boolean.py>=3.8 + python3-debian>=0.1.38 python3-Jinja2>=2.11.3 python3-license-expression>=1.2 + python3-requests>=2.25.1" +checkdepends="tox>=3.21.2" +short_desc="Helper tool for compliance with REUSE Specification" +maintainer="k4leg " +license="GPL-3.0-or-later, CC-BY-SA-4.0, CC0-1.0, Apache-2.0" +homepage="https://github.com/fsfe/reuse-tool" +distfiles="${PYPI_SITE}/${pkgname::1}/${pkgname}/${pkgname}-${version}.tar.gz" +checksum=89c87bd49308c8059cc36f8116872d73dc6e5788a29af8869be6532202bff801 +make_check=ci-skip + +do_check() { + tox -e "py${py3_ver/.}" +}