commit:     15f13b15dc8f0a1254dfe8e4424f567d326e88b8
Author:     Wolfgang E. Sanyer <WolfgangESanyer <AT> gmail <DOT> com>
AuthorDate: Mon Jan  4 22:57:46 2021 +0000
Commit:     Wolfgang E. Sanyer <ezzieyguywuf <AT> gmail <DOT> com>
CommitDate: Mon Jan  4 22:57:46 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=15f13b15

app-office/beancount: new package, a ledger-like accounting software

Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer <AT> gmail.com>

 app-office/beancount/Manifest                      |  1 +
 app-office/beancount/beancount-2.3.3.ebuild        | 56 +++++++++++++++++
 .../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 ++++++
 app-office/beancount/metadata.xml                  | 14 +++++
 6 files changed, 195 insertions(+)

diff --git a/app-office/beancount/Manifest b/app-office/beancount/Manifest
new file mode 100644
index 00000000..69ea66a1
--- /dev/null
+++ b/app-office/beancount/Manifest
@@ -0,0 +1 @@
+DIST beancount-2.3.3.tar.gz 1784037 BLAKE2B 
ff62ef30d3bcadd3f1dc195adf71cb58703e50c93e12cf71ef699c651ce67daf89ea8285b53b43811687fb132c02d8d6364651d87bc3e092f9485e6934883110
 SHA512 
420369105939bcdcf2b7caaba27ab1d486b3dfc18e0a3286d917a6380345eaf5fa64ff5e0779fd2275129b7088de24f4a2dbd0232a482aceb124064e5c56ccc4

diff --git a/app-office/beancount/beancount-2.3.3.ebuild 
b/app-office/beancount/beancount-2.3.3.ebuild
new file mode 100644
index 00000000..d6403f9d
--- /dev/null
+++ b/app-office/beancount/beancount-2.3.3.ebuild
@@ -0,0 +1,56 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7..8} )
+
+DISTUTILS_SINGLE_IMPL=1
+
+inherit distutils-r1
+
+DESCRIPTION="A double-entry accounting system that uses text files as input"
+HOMEPAGE="https://github.com/beancount/beancount";
+SRC_URI="https://github.com/beancount/beancount/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+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/beautifulsoup-4[${PYTHON_USEDEP}]
+               >=dev-python/bottle-0.12[${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}]
+       ')
+"
+
+BDEPEND="
+       test? (
+               ${RDEPEND}
+               $(python_gen_cond_dep '
+                       >=dev-python/pytest-5.4.2[${PYTHON_USEDEP}]
+               ')
+       )
+"
+
+python_test(){
+       esetup.py build_ext -i
+       make ctest
+       make 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
new file mode 100644
index 00000000..03c305cd
--- /dev/null
+++ b/app-office/beancount/files/beancount-2.3.3-disable-install-test.patch
@@ -0,0 +1,31 @@
+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
new file mode 100644
index 00000000..8e6db27b
--- /dev/null
+++ b/app-office/beancount/files/beancount-2.3.3-disable-network-tests.patch
@@ -0,0 +1,73 @@
+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
new file mode 100644
index 00000000..e12d8012
--- /dev/null
+++ b/app-office/beancount/files/beancount-2.3.3-disable-tmp-access-tests.patch
@@ -0,0 +1,20 @@
+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"

diff --git a/app-office/beancount/metadata.xml 
b/app-office/beancount/metadata.xml
new file mode 100644
index 00000000..0a83b176
--- /dev/null
+++ b/app-office/beancount/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>ezzieyguy...@gmail.com</email>
+               <name>Wolfgang E. Sanyer</name>
+       </maintainer>
+       <longdescription lang="en">
+               Beancount defines a simple data format or “language” that lets 
you
+               define financial transaction records in a text file, load them 
in memory
+               and generate and export a variety of reports, such as balance 
sheets or
+               income statements.
+       </longdescription>
+</pkgmetadata>

Reply via email to