forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple aspects of the ebuild were changed from previous versions: - it is converted to new PEP517 mode - it supports py3.9, py3.10 and py3.11 - homepage link is fixed - it uses .gh.tar.gz suffix for source archive as suggested in Gentoo Python Guide - the doc use is removed because it is not used anymore since commit 3ca0636 ("app-admin/clustershell: version bump.") - dev-libs/openssl dependency is removed, it is not used in sources code - working tests - most of tests work with an exception of those requiring remote ssh connections, which are removed in prepare step. It was necessary to apply few fixes [1-3] taken from upstream in order to make them work. The tests are executed with unittest rather than nose which makes py3.11 support possible. - it installs man pages again, this is basically resurrected from commit 3ca0636 ("app-admin/clustershell: version bump.") - unlike legacy mode, PEP517 installs etc/* files to /usr/etc, hence it was necessary to correct installation path with move (I didn't find any better solution, this one is used across repository) [1] cea-hpc/clustershell@314767d [2] cea-hpc/clustershell#487 [3] cea-hpc/clustershell#488 Closes: https://bugs.gentoo.org/866071 Bug: https://bugs.gentoo.org/845426 Signed-off-by: Petr Vaněk <arkamar@atlas.cz>
- Loading branch information
Showing
5 changed files
with
251 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
DIST clustershell-1.8.3.tar.gz 363975 BLAKE2B 3a7bb9103398e96f57f53d0d5d5edc6895ce02b6983e8fed34d65cad83a6d4e86f40b9576f41631e499a99adc8be5f4f422005b8ddc7ac8325fe11abd2c99477 SHA512 5108773e2958d1dae0aa6966d764e9af9d41024f65271005b202468f2bd1a3b63acc977729324fe1305d400dc8b06b0c4672e8d8ded207fa77cef69fb0005108 | ||
DIST clustershell-1.8.4.gh.tar.gz 367622 BLAKE2B 1487697a49d37902f9763094da1a156f5e7cc2ab0487814207bb9da03b1109f1ce55034fc92e72262d4b9920d5c52b9f6de84ce1ff04b06d042b0a6d005f1049 SHA512 582393e56d94e62e126d91f8af074a7b57d0e781a5c929cfc374e61324c412c32fcf9a8e063a78cb805c2ff34641887a1adfc7ef9f377b881077f719dbc2adc3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Copyright 1999-2022 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
DISTUTILS_USE_PEP517=setuptools | ||
PYTHON_COMPAT=( python3_{9..11} ) | ||
PYTHON_REQ_USE="xml(+)" | ||
|
||
inherit distutils-r1 | ||
|
||
DESCRIPTION="Python framework for efficient cluster administration" | ||
HOMEPAGE="https://github.com/cea-hpc/clustershell/" | ||
SRC_URI=" | ||
https://github.com/cea-hpc/clustershell/archive/v${PV}.tar.gz | ||
-> ${P}.gh.tar.gz | ||
" | ||
|
||
LICENSE="LGPL-2.1+" | ||
SLOT="0" | ||
KEYWORDS="~amd64 ~x86" | ||
IUSE="test" | ||
RESTRICT="!test? ( test )" | ||
|
||
BDEPEND=" | ||
test? ( | ||
app-shells/pdsh | ||
net-misc/openssh | ||
sys-devel/bc | ||
) | ||
" | ||
|
||
RDEPEND="dev-python/pyyaml[${PYTHON_USEDEP}]" | ||
|
||
PATCHES=( | ||
# python3.10 related fixes taken from upstream | ||
"${FILESDIR}/${P}-setrlimit-division.patch" | ||
"${FILESDIR}/${P}-current-thread.patch" | ||
|
||
"${FILESDIR}/${P}-skip-tests.patch" | ||
) | ||
|
||
src_prepare() { | ||
default | ||
|
||
# remove test sets that require working ssh connection | ||
rm tests/{CLIClush,TaskDistant*,TreeWorker}Test.py || die | ||
} | ||
|
||
distutils_enable_tests unittest | ||
|
||
python_test() { | ||
cd tests || die | ||
# Automatic discovery does not work | ||
"${EPYTHON}" -m unittest_or_fail -v *.py || die "Tests failed with ${EPYTHON}" | ||
} | ||
|
||
src_install() { | ||
distutils-r1_src_install | ||
|
||
doman doc/man/man*/* | ||
|
||
mv "${ED}/usr/etc" "${ED}/etc" || die | ||
} | ||
|
||
pkg_postinst() { | ||
einfo | ||
einfo "Some default system-wide config files have been installed into" | ||
einfo "/etc/${PN}" | ||
einfo | ||
} |
95 changes: 95 additions & 0 deletions
95
app-admin/clustershell/files/clustershell-1.8.4-current-thread.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
Backported from upstream commit 314767d65c39 ("Fix for python-3.10") [1]. | ||
|
||
[1] https://github.com/cea-hpc/clustershell/commit/314767d65c397fadc5ce0ae205a35d7bb47a68a8 | ||
|
||
diff --git a/lib/ClusterShell/Task.py b/lib/ClusterShell/Task.py | ||
index b9142e6..8c9e1b9 100644 | ||
--- a/lib/ClusterShell/Task.py | ||
+++ b/lib/ClusterShell/Task.py | ||
@@ -254,7 +254,7 @@ class Task(object): | ||
self._cond.acquire() | ||
try: | ||
self.suspend_count = min(self.suspend_count, 0) | ||
- self._cond.notifyAll() | ||
+ self._cond.notify_all() | ||
finally: | ||
self._cond.release() | ||
|
||
@@ -347,7 +347,7 @@ class Task(object): | ||
def _is_task_self(self): | ||
"""Private method used by the library to check if the task is | ||
task_self(), but do not create any task_self() instance.""" | ||
- return self.thread == threading.currentThread() | ||
+ return self.thread == threading.current_thread() | ||
|
||
def default_excepthook(self, exc_type, exc_value, tb): | ||
"""Default excepthook for a newly Task. When an exception is | ||
@@ -765,7 +765,7 @@ class Task(object): | ||
|
||
def _resume(self): | ||
"""Resume task - called from self thread.""" | ||
- assert self.thread == threading.currentThread() | ||
+ assert self.thread == threading.current_thread() | ||
try: | ||
try: | ||
self._reset() | ||
@@ -780,7 +780,7 @@ class Task(object): | ||
# task becomes joinable | ||
self._join_cond.acquire() | ||
self._suspend_cond.atomic_inc() | ||
- self._join_cond.notifyAll() | ||
+ self._join_cond.notify_all() | ||
self._join_cond.release() | ||
|
||
def resume(self, timeout=None): | ||
@@ -954,14 +954,14 @@ class Task(object): | ||
# termination (late join()s) | ||
# must be called after _terminated is set to True | ||
self._join_cond.acquire() | ||
- self._join_cond.notifyAll() | ||
+ self._join_cond.notify_all() | ||
self._join_cond.release() | ||
|
||
# destroy task if needed | ||
if kill: | ||
Task._task_lock.acquire() | ||
try: | ||
- del Task._tasks[threading.currentThread()] | ||
+ del Task._tasks[threading.current_thread()] | ||
finally: | ||
Task._task_lock.release() | ||
|
||
@@ -1376,7 +1376,7 @@ def task_self(defaults=None): | ||
provided as a convenience is available in the top-level ClusterShell.Task | ||
package namespace. | ||
""" | ||
- return Task(thread=threading.currentThread(), defaults=defaults) | ||
+ return Task(thread=threading.current_thread(), defaults=defaults) | ||
|
||
def task_wait(): | ||
""" | ||
@@ -1385,7 +1385,7 @@ def task_wait(): | ||
convenience and is available in the top-level ClusterShell.Task package | ||
namespace. | ||
""" | ||
- Task.wait(threading.currentThread()) | ||
+ Task.wait(threading.current_thread()) | ||
|
||
def task_terminate(): | ||
""" | ||
diff --git a/tests/TaskPortTest.py b/tests/TaskPortTest.py | ||
index 697f144..4014a89 100644 | ||
--- a/tests/TaskPortTest.py | ||
+++ b/tests/TaskPortTest.py | ||
@@ -28,7 +28,7 @@ class TaskPortTest(unittest.TestCase): | ||
def ev_msg(self, port, msg): | ||
# receive msg | ||
assert msg == "toto" | ||
- assert port.task.thread == threading.currentThread() | ||
+ assert port.task.thread == threading.current_thread() | ||
TaskPortTest.got_msg = True | ||
port.task.abort() | ||
|
||
-- | ||
2.35.1 | ||
|
21 changes: 21 additions & 0 deletions
21
app-admin/clustershell/files/clustershell-1.8.4-setrlimit-division.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Python3.10 related fix taken from upstream [1,2]. | ||
|
||
[1] https://github.com/cea-hpc/clustershell/pull/487 | ||
[2] https://github.com/cea-hpc/clustershell/commit/5ac85daf74056ec7e60778efec94c746a150142c | ||
|
||
diff --git a/tests/CLIConfigTest.py b/tests/CLIConfigTest.py | ||
index 2853398..db6cec5 100644 | ||
--- a/tests/CLIConfigTest.py | ||
+++ b/tests/CLIConfigTest.py | ||
@@ -229,7 +229,7 @@ class CLIClushConfigTest(unittest.TestCase): | ||
display = Display(options, config) | ||
|
||
# force a lower soft limit | ||
- resource.setrlimit(resource.RLIMIT_NOFILE, (hard2/2, hard)) | ||
+ resource.setrlimit(resource.RLIMIT_NOFILE, (hard2//2, hard)) | ||
# max_fdlimit should increase soft limit again | ||
set_fdlimit(config.fd_max, display) | ||
# verify | ||
-- | ||
2.35.1 | ||
|
63 changes: 63 additions & 0 deletions
63
app-admin/clustershell/files/clustershell-1.8.4-skip-tests.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
This is a Gentoo specific patch for skipping tests that do not work due | ||
to various reasons: | ||
1. hostname may be set to localhost | ||
2. test fails which are most probably caused by weird test interaction. | ||
The issue is reported to upstream in [1]. | ||
|
||
[1] https://github.com/cea-hpc/clustershell/issues/488 | ||
|
||
diff --git a/tests/TaskEventTest.py b/tests/TaskEventTest.py | ||
index f8a4048..900008b 100644 | ||
--- a/tests/TaskEventTest.py | ||
+++ b/tests/TaskEventTest.py | ||
@@ -475,6 +475,7 @@ class TaskEventTest(unittest.TestCase): | ||
self.assertEqual(eh.cnt_pickup, 3) | ||
self.assertEqual(eh.cnt_hup, 3) | ||
|
||
+ @unittest.skip("because of an issue https://github.com/cea-hpc/clustershell/issues/488") | ||
def test_ev_pickup_fanout_legacy(self): | ||
"""test ev_pickup event with fanout (legacy)""" | ||
task = task_self() | ||
@@ -498,6 +499,7 @@ class TaskEventTest(unittest.TestCase): | ||
finally: | ||
task.set_info("fanout", fanout) | ||
|
||
+ @unittest.skip("because of an issue https://github.com/cea-hpc/clustershell/issues/488") | ||
def test_ev_pickup_fanout(self): | ||
"""test ev_pickup event with fanout""" | ||
task = task_self() | ||
diff --git a/tests/TreeWorkerTest.py b/tests/TreeWorkerTest.py | ||
index d5c221a..969d3c9 100644 | ||
--- a/tests/TreeWorkerTest.py | ||
+++ b/tests/TreeWorkerTest.py | ||
@@ -99,6 +99,7 @@ class TEventHandler(TEventHandlerBase): | ||
self.ev_timedout_cnt += 1 | ||
|
||
|
||
+@unittest.skipIf(HOSTNAME == 'localhost', "does not work with hostname set to 'localhost'") | ||
class TreeWorkerTest(unittest.TestCase): | ||
""" | ||
TreeWorkerTest: test TreeWorker | ||
diff --git a/tests/WorkerExecTest.py b/tests/WorkerExecTest.py | ||
index 6f99f10..0894f99 100644 | ||
--- a/tests/WorkerExecTest.py | ||
+++ b/tests/WorkerExecTest.py | ||
@@ -45,6 +45,7 @@ class ExecTest(unittest.TestCase): | ||
self.assertEqual(task_self().max_retcode(), 1) | ||
self.assertEqual(task_self().node_buffer('localhost'), b'') | ||
|
||
+ @unittest.skipIf(HOSTNAME == 'localhost', "does not work with hostname set to 'localhost'") | ||
def test_timeout(self): | ||
"""test ExecWorker with a timeout""" | ||
nodes = "localhost,%s" % HOSTNAME | ||
@@ -67,6 +68,7 @@ class ExecTest(unittest.TestCase): | ||
self.assertRaises(WorkerError, self.execw, | ||
nodes="localhost", handler=None, command="echo %") | ||
|
||
+ @unittest.skipIf(HOSTNAME == 'localhost', "does not work with hostname set to 'localhost'") | ||
def test_rank_placeholder(self): | ||
"""test ExecWorker with several nodes and %n (rank)""" | ||
nodes = "localhost,%s" % HOSTNAME | ||
-- | ||
2.35.1 | ||
|