commit: 7a6de6b5071308f7646fe164627fc19d0bf23e12 Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in> AuthorDate: Fri Feb 3 20:05:57 2023 +0000 Commit: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in> CommitDate: Fri Feb 3 20:05:57 2023 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7a6de6b5
app-office/beancount: fix deps, enable PEP517 Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in> ...ount-2.3.5.ebuild => beancount-2.3.5-r1.ebuild} | 46 +++++++------- .../beancount-2.3.3-disable-install-test.patch | 31 --------- .../beancount-2.3.3-disable-network-tests.patch | 73 ---------------------- .../beancount-2.3.3-disable-tmp-access-tests.patch | 20 ------ 4 files changed, 23 insertions(+), 147 deletions(-) diff --git a/app-office/beancount/beancount-2.3.5.ebuild b/app-office/beancount/beancount-2.3.5-r1.ebuild similarity index 56% rename from app-office/beancount/beancount-2.3.5.ebuild rename to app-office/beancount/beancount-2.3.5-r1.ebuild index 2c0f06f5d..296a34055 100644 --- a/app-office/beancount/beancount-2.3.5.ebuild +++ b/app-office/beancount/beancount-2.3.5-r1.ebuild @@ -4,8 +4,9 @@ EAPI=8 PYTHON_COMPAT=( python3_10 ) -DITUTILS_USE_PEP517=setuptools +DISTUTILS_USE_PEP517=setuptools DISTUTILS_SINGLE_IMPL=1 + inherit distutils-r1 DESCRIPTION="A double-entry accounting system that uses text files as input" @@ -16,25 +17,22 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -PATCHES=( - "${FILESDIR}/${PN}-2.3.3-disable-network-tests.patch" - "${FILESDIR}/${PN}-2.3.3-disable-tmp-access-tests.patch" - "${FILESDIR}/${PN}-2.3.3-disable-install-test.patch" -) +RDEPEND=" + $(python_gen_cond_dep ' + dev-python/beautifulsoup4[${PYTHON_USEDEP}] + dev-python/bottle[${PYTHON_USEDEP}] + dev-python/chardet[${PYTHON_USEDEP}] + dev-python/google-api-python-client[${PYTHON_USEDEP}] + dev-python/lxml[${PYTHON_USEDEP}] + dev-python/ply[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + dev-python/python-dateutil[${PYTHON_USEDEP}] + dev-python/python-magic[${PYTHON_USEDEP}] + dev-python/requests[${PYTHON_USEDEP}] + ') +" -RDEPEND="$(python_gen_cond_dep ' - dev-python/beautifulsoup4[${PYTHON_USEDEP}] - >=dev-python/bottle-0.12[${PYTHON_USEDEP}] - dev-python/google-auth-oauthlib[${PYTHON_USEDEP}] - >=dev-python/google-api-python-client-1.8.2[${PYTHON_USEDEP}] - >=dev-python/httplib2-0.10[${PYTHON_USEDEP}] - >=dev-python/lxml-3.0[${PYTHON_USEDEP}] - >=dev-python/oauth2client-4.0[${PYTHON_USEDEP}] - >=dev-python/ply-3.4[${PYTHON_USEDEP}] - >=dev-python/python-dateutil-2.6.0[${PYTHON_USEDEP}] - >=dev-python/python-magic-0.4.12[${PYTHON_USEDEP}] - >=dev-python/requests-2.0[${PYTHON_USEDEP}] -')" +EPYTEST_DESELECT=( scripts/setup_test.py ) distutils_enable_tests pytest @@ -52,13 +50,15 @@ python_compile() { distutils-r1_python_compile # keep in sync with hashsrc.py, otherwise expect test failures - cp beancount/parser/{lexer.l,grammar.y,decimal.h,decimal.c,macros.h,parser.h,parser.c,tokens.h} \ - "${BUILD_DIR}"/lib/${PN}/parser || die + cp beancount/parser/{lexer.l,grammar.y,decimal.h,decimal.c,macros.h,parser.h,parser.c,tokens.h} "${BUILD_DIR}"/install$(python_get_sitedir)/${PN}/parser || die } python_test(){ - emake ctest - cd "${T}" || die epytest --pyargs ${PN} } + +src_test() { + emake ctest + distutils-r1_src_test +} diff --git a/app-office/beancount/files/beancount-2.3.3-disable-install-test.patch b/app-office/beancount/files/beancount-2.3.3-disable-install-test.patch deleted file mode 100644 index 03c305cd9..000000000 --- a/app-office/beancount/files/beancount-2.3.3-disable-install-test.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/beancount/scripts/setup_test.py b/beancount/scripts/setup_test.py -index 59a165d1..45717643 100644 ---- a/beancount/scripts/setup_test.py -+++ b/beancount/scripts/setup_test.py -@@ -12,6 +12,10 @@ import sys - import tarfile - import tempfile - import unittest -+import pytest -+ -+pytest.skip("these installation tests fail in portage and are un-needed" -+ , allow_module_level=True) - - from beancount.utils import test_utils - -@@ -30,7 +34,6 @@ class TestSetup(test_utils.TestCase): - if path.exists(self.installdir): - shutil.rmtree(self.installdir) - -- @unittest.skipIf(is_bazel_build(), "Cannot setup within Bazel.") - def test_setup(self): - # We need to create the installation target directory and have our - # PYTHONPATH set on it in order for setuptools to work properly in a -@@ -50,6 +53,7 @@ class TestSetup(test_utils.TestCase): - if path.exists(egg_info): - shutil.rmtree(egg_info) - -+ @pytest.mark.skip(reason="Portage will make sure things install correctly") - def run_setup(self, installdir, extra_env=None): - """Run setup.py with the given extra environment variables. - diff --git a/app-office/beancount/files/beancount-2.3.3-disable-network-tests.patch b/app-office/beancount/files/beancount-2.3.3-disable-network-tests.patch deleted file mode 100644 index 8e6db27b2..000000000 --- a/app-office/beancount/files/beancount-2.3.3-disable-network-tests.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/beancount/scripts/bake_test.py b/beancount/scripts/bake_test.py -index 67dbefc0..a95488c1 100644 ---- a/beancount/scripts/bake_test.py -+++ b/beancount/scripts/bake_test.py -@@ -6,6 +6,7 @@ import textwrap - from os import path - from unittest import mock - import unittest -+import pytest - - import lxml.html - -@@ -188,6 +189,7 @@ class TestScriptBake(test_utils.TestCase): - test_utils.run_with_args(bake.main, self.get_args() + [filename, output]) - - @test_utils.docfile -+ @pytest.mark.skip(reason="network unreachable during portage installation") - def test_bake_directory(self, filename): - """ - 2013-01-01 open Expenses:Restaurant -@@ -210,6 +212,7 @@ class TestScriptBake(test_utils.TestCase): - class TestScriptArchive(TestScriptBake): - - @test_utils.docfile -+ @pytest.mark.skip(reason="network unreachable during portage installation") - def test_bake_archive__known(self, filename): - """ - 2013-01-01 open Expenses:Restaurant -diff --git a/beancount/web/web_test.py b/beancount/web/web_test.py -index dd7059fc..1aab3e44 100644 ---- a/beancount/web/web_test.py -+++ b/beancount/web/web_test.py -@@ -4,6 +4,7 @@ __license__ = "GNU GPLv2" - import unittest - import urllib.parse - from os import path -+import pytest - - from beancount.utils import test_utils - from beancount.parser import version -@@ -48,26 +49,32 @@ class TestWeb(unittest.TestCase): - self.ignore_regexp) - - @test_utils.docfile -+ @pytest.mark.skip(reason="network unreachable during portage installation") - def test_scrape_empty_file(self, filename): - """ - ;; A file with no entries in it. - """ - self.scrape(filename) - -+ @pytest.mark.skip(reason="network unreachable during portage installation") - def test_scrape_basic(self): - self.scrape('simple/basic.beancount') - -+ @pytest.mark.skip(reason="network unreachable during portage installation") - def test_scrape_basic_view(self): - self.scrape('simple/basic.beancount', extra_args=['--view', 'year/2013']) - -+ @pytest.mark.skip(reason="network unreachable during portage installation") - def test_scrape_in_incognito(self): - self.scrape('simple/basic.beancount', extra_args=['--incognito']) - -+ @pytest.mark.skip(reason="network unreachable during portage installation") - def test_scrape_starterkit(self): - self.scrape('simple/starter.beancount') - - # Note: Great idea, but sorry, too slow (approx. 50s on MBA). We need to - # find some way to enable this on demand. -+ @pytest.mark.skip(reason="network unreachable during portage installation") - def __test_scrape_example(self): - self.scrape('example.beancount') - diff --git a/app-office/beancount/files/beancount-2.3.3-disable-tmp-access-tests.patch b/app-office/beancount/files/beancount-2.3.3-disable-tmp-access-tests.patch deleted file mode 100644 index e12d8012b..000000000 --- a/app-office/beancount/files/beancount-2.3.3-disable-tmp-access-tests.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/beancount/projects/will_test.py b/beancount/projects/will_test.py -index 0a8e92b8..12d4c50a 100644 ---- a/beancount/projects/will_test.py -+++ b/beancount/projects/will_test.py -@@ -3,6 +3,7 @@ __license__ = "GNU GPLv2" - - import logging - import unittest -+import pytest - - from beancount import loader - from beancount.core import getters -@@ -95,6 +96,7 @@ class TestWillFunctions(test_utils.TestCase): - class TestWillReport(test_utils.TestCase): - - @loader.load_doc() -+ @pytest.mark.skip(reason="Cannot access /tmp during portage installation") - def test_create_report(self, entries, _, options_map): - """ - option "title" "Report Creation Test"