From: Brian Dolbec Date: Thu, 23 Apr 2020 19:27:51 +0000 (-0700) Subject: app-portage/g-sorcery: Add py 3.7, 3.8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2ced56cbde6e937a80c58559122660e8b5c64d17;p=gentoo.git app-portage/g-sorcery: Add py 3.7, 3.8 Fix test fails due to class variables inheritence change. Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Brian Dolbec --- diff --git a/app-portage/g-sorcery/files/g-sorcery-0.2.1-py3.7.tests-fix.patch b/app-portage/g-sorcery/files/g-sorcery-0.2.1-py3.7.tests-fix.patch new file mode 100644 index 000000000000..84a702413ac8 --- /dev/null +++ b/app-portage/g-sorcery/files/g-sorcery-0.2.1-py3.7.tests-fix.patch @@ -0,0 +1,140 @@ +diff --git a/README.md b/README.md +index 9bdd5b7..c2eb5ad 100644 +--- a/README.md ++++ b/README.md +@@ -26,3 +26,5 @@ This project is aimed to create a framework for ebuild-generators for + 3rd party software providers. + + If you want to develop a new backend see [developer's instructions](https://github.com/jauhien/g-sorcery/blob/master/docs/developer_instructions.rst). ++ ++[TODO list](https://trello.com/b/8WdY2ZIs/framework-for-automated-ebuild-generators). +diff --git a/scripts/all_pythons.sh b/scripts/all_pythons.sh +index af4c1f1..3c85974 100755 +--- a/scripts/all_pythons.sh ++++ b/scripts/all_pythons.sh +@@ -2,7 +2,7 @@ + + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +-for VER in 2.7 3.3 3.4 ++for VER in 2.7 3.6 3.7 3.8 + do + echo + echo "testing python${VER}" +diff --git a/tests/server.py b/tests/server.py +index 51d49b7..aa895ea 100644 +--- a/tests/server.py ++++ b/tests/server.py +@@ -4,20 +4,21 @@ + """ + server.py + ~~~~~~~~~ +- ++ + test server +- ++ + :copyright: (c) 2013 by Jauhien Piatlicki + :license: GPL-2, see LICENSE for more details. + """ + + import os + import threading ++import time + + from g_sorcery.compatibility import py2k + + if py2k: +- from SocketServer import TCPServer as HTTPServer ++ from SocketServer import TCPServer as HTTPServer + from SimpleHTTPServer import SimpleHTTPRequestHandler + else: + from http.server import HTTPServer +@@ -26,26 +27,27 @@ else: + def HTTPRequestHandlerGenerator(direct): + + class HTTPRequestHandler(SimpleHTTPRequestHandler, object): +- directory = direct + + def __init__(self, request, client_address, server): ++ self.direct = direct + super(HTTPRequestHandler, self).__init__(request, client_address, server) + + def translate_path(self, path): +- return os.path.join(self.directory, path[1:]) ++ return os.path.join(self.direct, path[1:]) + + return HTTPRequestHandler + +- ++ + class Server(threading.Thread): + def __init__(self, directory, port=8080): + super(Server, self).__init__() + HTTPServer.allow_reuse_address = True + server_address = ('127.0.0.1', port) + self.httpd = HTTPServer(server_address, HTTPRequestHandlerGenerator(directory)) +- ++ + def run(self): + self.httpd.serve_forever() + + def shutdown(self): + self.httpd.shutdown() ++ time.sleep(0.5) +diff --git a/tests/test_DBGenerator.py b/tests/test_DBGenerator.py +index 9a47c86..3c28278 100644 +--- a/tests/test_DBGenerator.py ++++ b/tests/test_DBGenerator.py +@@ -4,9 +4,9 @@ + """ + test_DBGenerator.py + ~~~~~~~~~~~~~~~~~~~ +- ++ + DBGenerator test suite +- ++ + :copyright: (c) 2013 by Jauhien Piatlicki + :license: GPL-2, see LICENSE for more details. + """ +@@ -81,11 +81,13 @@ class TestDBGenerator(BaseTest): + srv = Server(orig_tempdir.name) + srv.start() + +- pkg_db = db_generator(self.tempdir.name, "test_repo", ++ try: ++ pkg_db = db_generator(self.tempdir.name, "test_repo", + common_config = common_config, config = config) + +- srv.shutdown() +- srv.join() ++ finally: ++ srv.shutdown() ++ srv.join() + + self.assertEqual(set(pkg_db.list_categories()), set(["app-test1", "app-test2"])) + self.assertTrue(pkg_db.in_category("app-test1", "test")) +diff --git a/tests/test_PackageDB.py b/tests/test_PackageDB.py +index 152c605..8be8f8a 100644 +--- a/tests/test_PackageDB.py ++++ b/tests/test_PackageDB.py +@@ -70,11 +70,13 @@ class TestPackageDB(BaseTest): + + srv = Server(orig_tempdir.name, port=port) + srv.start() +- self.assertRaises(IntegrityError, test_db.sync, sync_address) +- os.system("cd " + orig_tempdir.name + " && mv good.tar.gz dummy.tar.gz") +- test_db.sync(sync_address) +- srv.shutdown() +- srv.join() ++ try: ++ self.assertRaises(IntegrityError, test_db.sync, sync_address) ++ os.system("cd " + orig_tempdir.name + " && mv good.tar.gz dummy.tar.gz") ++ test_db.sync(sync_address) ++ finally: ++ srv.shutdown() ++ srv.join() + test_db.read() + self.assertEqual(orig_db.database, test_db.database) + self.assertEqual(orig_db.get_common_data("app-test1"), test_db.get_common_data("app-test1")) diff --git a/app-portage/g-sorcery/g-sorcery-0.2.1-r1.ebuild b/app-portage/g-sorcery/g-sorcery-0.2.1-r1.ebuild index 6bb6f3199cc5..7a60508035b0 100644 --- a/app-portage/g-sorcery/g-sorcery-0.2.1-r1.ebuild +++ b/app-portage/g-sorcery/g-sorcery-0.2.1-r1.ebuild @@ -3,7 +3,7 @@ EAPI=6 -PYTHON_COMPAT=(python3_6) +PYTHON_COMPAT=( python{3_6,3_7,3_8} ) inherit distutils-r1 prefix @@ -13,7 +13,7 @@ SRC_URI="https://github.com/jauhien/g-sorcery/archive/${PV}.tar.gz -> ${P}.tar.g LICENSE="GPL-2" SLOT="0" -IUSE="bson git" +IUSE="bson git test" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" DEPEND="bson? ( dev-python/pymongo[${PYTHON_USEDEP}] ) @@ -22,6 +22,10 @@ DEPEND="bson? ( dev-python/pymongo[${PYTHON_USEDEP}] ) RDEPEND="${DEPEND}" PDEPEND=">=app-portage/layman-2.2.0[g-sorcery(-),${PYTHON_USEDEP}]" +PATCHES=( + "${FILESDIR}/g-sorcery-0.2.1-py3.7.tests-fix.patch" +) + src_prepare() { hprefixify setup.py default