diff options
Diffstat (limited to 'net-libs')
-rw-r--r-- | net-libs/Manifest.gz | bin | 32799 -> 32806 bytes | |||
-rw-r--r-- | net-libs/stem/Manifest | 6 | ||||
-rw-r--r-- | net-libs/stem/files/1.8.0-replace-all-usages-of-inspect.getargspec.patch | 53 | ||||
-rw-r--r-- | net-libs/stem/files/1.8.1-Add-an-exclude-test-argument.patch | 219 | ||||
-rw-r--r-- | net-libs/stem/stem-1.8.0_p20211118.ebuild | 51 | ||||
-rw-r--r-- | net-libs/stem/stem-1.8.1.ebuild | 50 |
6 files changed, 326 insertions, 53 deletions
diff --git a/net-libs/Manifest.gz b/net-libs/Manifest.gz Binary files differindex 5e763d41ac05..6fe514259395 100644 --- a/net-libs/Manifest.gz +++ b/net-libs/Manifest.gz diff --git a/net-libs/stem/Manifest b/net-libs/stem/Manifest index d56df8850e3f..69bcb4525f30 100644 --- a/net-libs/stem/Manifest +++ b/net-libs/stem/Manifest @@ -1,5 +1,7 @@ +AUX 1.8.0-replace-all-usages-of-inspect.getargspec.patch 1842 BLAKE2B eef46aa34262df0b7c08596c5040f4688508764cf07bfcefb4368c5cc4cbdf62542880a57c1d53e135d3b70ed3da24dc02225d520afb5972d55175c7930088d3 SHA512 d06d668303bb0b23c223c25d0978ed4573560870c9cb054509ca3244213c76257e165c2ea0789955e045f28067e09fc4833bcf4cbd714f3d7dd96d93a8e8e5e1 +AUX 1.8.1-Add-an-exclude-test-argument.patch 7797 BLAKE2B eff2398cf44ee619075be6e49c32d82f99715bfe542922eaa28dc8efd665686411c093174fb19aff084b2f4c25a16219006cf6bcf1396351148a3f737b81c9c4 SHA512 ef9f394be7069e13e303512a2ea73dfe628588f09123df7f72b4f32b17d1eb7d17a5801406f4167f630547adcd5bad84688b5a35471930ad02c70653ba87be87 DIST stem-1.8.0.tar.gz 2853802 BLAKE2B a275a38e53c5a4a3771a30528fd5781c51370352dd384a77ce27b31f034bece6fef448d74008adb82d2d909104b7338b5168a1a343c799637f9e12d39028bd09 SHA512 aa2033567b79aef960f8321e4c6cbc28105c59d6513ff49a9f12509d8f97b1a2e8a3b04dc28abb07fad59b0f6ba66443b92bbefa0d08b26038bbaf24f7f2846d -DIST stem-1.8.0_p20211118.tar.gz 2862928 BLAKE2B 0c284be96332e11c011eb69d4448fab5c33cc59e4107abad44d7bc1186629112ca8658aade28e486c0eed873524e18ed87edf5920520d5c8dd854b2fec7867ea SHA512 b8afb5d2203b19930e8c1eaa3cad331c0df8b8bcffe4b224b8bab549866f53a5f06001d2141a0a8b7becfa8b7c1281ef5d9584423c8ba25dc4198cfaf07d3a14 +DIST stem-1.8.1.tar.gz 2859634 BLAKE2B f78da079791583a17eb439a4e2459c7e0af454e45300202df1085d1b1ba150ee097cfa1b93df5ad0d7090644fad6e035604382c73b94744076cad490ab52459a SHA512 bad2f4f96e37caa3ee2928bb027318c4941ca3f6c0072c5f6e87fe647d2b68400ad352d9c27fa2a35c00f4f327aa9cc00e2907b21a9cbd26fab46ec21e2a038a EBUILD stem-1.8.0-r1.ebuild 1483 BLAKE2B f884d47f8f42506d30b1a894d6fa889b01250435eab9a838fcbc0b99ba4ff494e95c6b007fb5ea1709d4b0e8a7fcef330a57aaade1e016c7e98fc7caff092722 SHA512 bf98642a919f9fc063275566086486d32828e7628648ab0168d2cd01a3e6ff15a59217623100a856da5a0440f97435dfa275d4d8f0f440d13add568460ad09d4 -EBUILD stem-1.8.0_p20211118.ebuild 1604 BLAKE2B 9c80ce50bd98ba645423cf6f0967eca7b8be43d78458edfc2dc883f44a33e00d8157bb4bc390a572a72c9d16beedcbd67abd3df657d89cc3d966181defdf9f25 SHA512 8694d921674896763c270341db6bd19d6b038688753d28cccf37a04fe574a55560bfc52c09063207b65cb920fd54d3722f913274f2895820335db50c1cc9eef8 +EBUILD stem-1.8.1.ebuild 1482 BLAKE2B 74799c4c26538e682a771e321515cd228e866ab7448e65672bbc3a90675de3be49b34122f11cd10f1c348e467241102b741ad309451676d3c9a53975d61fb486 SHA512 920e1ca2e66d0a70180d7eebbb06ddd56bb69cd37a2154c09c5c056e2f5b595b54acc23f3b45a6859e5e893880573d4d6dd95438fc11b687501082ef83c0a85f MISC metadata.xml 240 BLAKE2B 096a3a6ec7c8a3119276647c93876dbd71fe43e2a69b522b5cbfa15d1943320ed2690dd7f4e0e700c825987f23076ead0487be968c3071a5761724c910c542ff SHA512 49d25fa55c369e3664049c6de2fc78baf445600faca18a2d97840e0db8e45d6e784ec21afce86af2b27f8c116fdd19381e739c4b715589f6bf7ccc3cdf59da7d diff --git a/net-libs/stem/files/1.8.0-replace-all-usages-of-inspect.getargspec.patch b/net-libs/stem/files/1.8.0-replace-all-usages-of-inspect.getargspec.patch new file mode 100644 index 000000000000..608fe5f5224f --- /dev/null +++ b/net-libs/stem/files/1.8.0-replace-all-usages-of-inspect.getargspec.patch @@ -0,0 +1,53 @@ +From 6497514ea89ba44d404b661d495a8cd2649ac628 Mon Sep 17 00:00:00 2001 +From: Juan Orti Alcaine <jortialc@redhat.com> +Date: Fri, 1 Jul 2022 09:40:41 +0200 +Subject: [PATCH] Replace all usages of inspect.getargspec + +--- + stem/control.py | 2 +- + stem/prereq.py | 2 +- + stem/util/conf.py | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/stem/control.py b/stem/control.py +index 42736486..3b29898d 100644 +--- a/stem/control.py ++++ b/stem/control.py +@@ -474,7 +474,7 @@ def with_default(yields = False): + + def decorator(func): + def get_default(func, args, kwargs): +- arg_names = inspect.getargspec(func).args[1:] # drop 'self' ++ arg_names = inspect.getfullargspec(func).args[1:] # drop 'self' + default_position = arg_names.index('default') if 'default' in arg_names else None + + if default_position is not None and default_position < len(args): +diff --git a/stem/prereq.py b/stem/prereq.py +index 4af6c093..4009c317 100644 +--- a/stem/prereq.py ++++ b/stem/prereq.py +@@ -241,7 +241,7 @@ def is_mock_available(): + + # check for mock's new_callable argument for patch() which was introduced in version 0.8.0 + +- if 'new_callable' not in inspect.getargspec(mock.patch).args: ++ if 'new_callable' not in inspect.getfullargspec(mock.patch).args: + raise ImportError() + + return True +diff --git a/stem/util/conf.py b/stem/util/conf.py +index 80399810..15c4db8b 100644 +--- a/stem/util/conf.py ++++ b/stem/util/conf.py +@@ -285,7 +285,7 @@ def uses_settings(handle, path, lazy_load = True): + config.load(path) + config._settings_loaded = True + +- if 'config' in inspect.getargspec(func).args: ++ if 'config' in inspect.getfullargspec(func).args: + return func(*args, config = config, **kwargs) + else: + return func(*args, **kwargs) +-- +2.36.1 + diff --git a/net-libs/stem/files/1.8.1-Add-an-exclude-test-argument.patch b/net-libs/stem/files/1.8.1-Add-an-exclude-test-argument.patch new file mode 100644 index 000000000000..88d5e48ccb74 --- /dev/null +++ b/net-libs/stem/files/1.8.1-Add-an-exclude-test-argument.patch @@ -0,0 +1,219 @@ +From e24fe02265186b1649e3813a51eff11cd2e1cc21 Mon Sep 17 00:00:00 2001 +From: Damian Johnson <atagar@torproject.org> +Date: Thu, 30 Jan 2020 15:49:36 -0800 +Subject: [PATCH] Add an --exclude-test argument + +Implementing a great suggestion from teor for an --exclude-test argument... + + https://github.com/torproject/stem/issues/53 + +This can be used to skip both modules... + + % run_tests.py --unit --exclude-test interpreter.commands + [ runs all the tests except the interpreter.commands module ] + +... and individual tests... + + % run_tests.py --unit --test interpreter.commands --exclude-test interpreter.commands.test_events --verbose + [ only runs interpreter.commands tests, but skips test_events ] +--- + run_tests.py | 58 +++++++++++++++++++++++++++++++++++------------ + test/arguments.py | 5 +++- + test/settings.cfg | 7 +++++- + 3 files changed, 54 insertions(+), 16 deletions(-) + +diff --git a/run_tests.py b/run_tests.py +index a3a90d04..490be50b 100755 +--- a/run_tests.py ++++ b/run_tests.py +@@ -7,6 +7,7 @@ Runs unit and integration tests. For usage information run this with '--help'. + """ + + import errno ++import io + import importlib + import logging + import multiprocessing +@@ -115,40 +116,57 @@ def log_traceback(sig, frame): + os._exit(-1) + + +-def get_unit_tests(module_prefixes = None): ++def get_unit_tests(module_prefixes, exclude): + """ + Provides the classes for our unit tests. + + :param list module_prefixes: only provide the test if the module starts with + any of these substrings ++ :param list exclude: test modules explicitly excluded + + :returns: an **iterator** for our unit tests + """ + +- return _get_tests(CONFIG['test.unit_tests'].splitlines(), module_prefixes) ++ return _get_tests(CONFIG['test.unit_tests'].splitlines(), module_prefixes, exclude) + + +-def get_integ_tests(module_prefixes = None): ++def get_integ_tests(module_prefixes, exclude): + """ + Provides the classes for our integration tests. + + :param list module_prefixes: only provide the test if the module starts with + any of these substrings ++ :param list exclude: test modules explicitly excluded + + :returns: an **iterator** for our integration tests + """ + +- return _get_tests(CONFIG['test.integ_tests'].splitlines(), module_prefixes) ++ return _get_tests(CONFIG['test.integ_tests'].splitlines(), module_prefixes, exclude) + + +-def _get_tests(modules, module_prefixes): ++def _get_tests(modules, module_prefixes, exclude): + for import_name in modules: ++ cropped_name = test.arguments.crop_module_name(import_name) ++ cropped_name = cropped_name.rsplit('.', 1)[0] # exclude the class name ++ ++ if exclude: ++ # Check if '--exclude-test' says we should skip this whole module. The ++ # argument can also skip individual tests, but that must be handled ++ # elsewhere. ++ ++ skip = False ++ ++ for exclude_prefix in exclude: ++ if cropped_name.startswith(exclude_prefix): ++ skip = True ++ break ++ ++ if skip: ++ continue ++ + if not module_prefixes: + yield import_name + else: +- cropped_name = test.arguments.crop_module_name(import_name) +- cropped_name = cropped_name.rsplit('.', 1)[0] # exclude the class name +- + for prefix in module_prefixes: + if cropped_name.startswith(prefix): + yield import_name +@@ -277,8 +295,8 @@ def main(): + test.output.print_divider('UNIT TESTS', True) + error_tracker.set_category('UNIT TEST') + +- for test_class in get_unit_tests(args.specific_test): +- run_result = _run_test(args, test_class, output_filters) ++ for test_class in get_unit_tests(args.specific_test, args.exclude_test): ++ run_result = _run_test(args, test_class, args.exclude_test, output_filters) + test.output.print_logging(logging_buffer) + skipped_tests += len(getattr(run_result, 'skipped', [])) + +@@ -296,8 +314,8 @@ def main(): + + println('Running tests...\n', STATUS) + +- for test_class in get_integ_tests(args.specific_test): +- run_result = _run_test(args, test_class, output_filters) ++ for test_class in get_integ_tests(args.specific_test, args.exclude_test): ++ run_result = _run_test(args, test_class, args.exclude_test, output_filters) + test.output.print_logging(logging_buffer) + skipped_tests += len(getattr(run_result, 'skipped', [])) + +@@ -401,7 +419,7 @@ def _print_static_issues(static_check_issues): + println() + + +-def _run_test(args, test_class, output_filters): ++def _run_test(args, test_class, exclude, output_filters): + # When logging to a file we don't have stdout's test delimiters to correlate + # logs with the test that generated them. + +@@ -442,7 +460,19 @@ def _run_test(args, test_class, output_filters): + traceback.print_exc(exc) + return None + +- test_results = StringIO() ++ # check if we should skip any individual tests within this module ++ ++ if exclude: ++ cropped_name = test.arguments.crop_module_name(test_class) ++ cropped_name = cropped_name.rsplit('.', 1)[0] # exclude the class name ++ ++ for prefix in exclude: ++ if prefix.startswith(cropped_name): ++ test_name = prefix.split('.')[-1] ++ ++ suite._tests = list(filter(lambda test: test.id().split('.')[-1] != test_name, suite._tests)) ++ ++ test_results = io.StringIO() + run_result = stem.util.test_tools.TimedTestRunner(test_results, verbosity = 2).run(suite) + + if args.verbose: +diff --git a/test/arguments.py b/test/arguments.py +index a871b4e5..4a31aa48 100644 +--- a/test/arguments.py ++++ b/test/arguments.py +@@ -27,6 +27,7 @@ DEFAULT_ARGS = { + 'run_unit': False, + 'run_integ': False, + 'specific_test': [], ++ 'exclude_test': [], + 'logging_runlevel': None, + 'logging_path': None, + 'tor_path': 'tor', +@@ -38,7 +39,7 @@ DEFAULT_ARGS = { + } + + OPT = 'auit:l:qvh' +-OPT_EXPANDED = ['all', 'unit', 'integ', 'targets=', 'test=', 'log=', 'log-file=', 'tor=', 'quiet', 'verbose', 'help'] ++OPT_EXPANDED = ['all', 'unit', 'integ', 'targets=', 'test=', 'exclude-test=', 'log=', 'log-file=', 'tor=', 'quiet', 'verbose', 'help'] + + + def parse(argv): +@@ -105,6 +106,8 @@ def parse(argv): + args['attribute_targets'] = attribute_targets + elif opt == '--test': + args['specific_test'].append(crop_module_name(arg)) ++ elif opt == '--exclude-test': ++ args['exclude_test'].append(crop_module_name(arg)) + elif opt in ('-l', '--log'): + arg = arg.upper() + +diff --git a/test/settings.cfg b/test/settings.cfg +index 2c18110f..97286543 100644 +--- a/test/settings.cfg ++++ b/test/settings.cfg +@@ -67,7 +67,6 @@ msg.help + | -a, --all runs unit, integ, and style checks (same as '-ui') + | -u, --unit runs unit tests + | -i, --integ runs integration tests +-| --test TEST_NAME only run tests with this in the module name + | + | -t, --target TARGET comma separated list of integ targets (see below) + | --tor PATH custom tor binary to run testing against +@@ -76,6 +75,9 @@ msg.help + | TRACE, DEBUG, INFO, NOTICE, WARN, ERROR + | --log-file PATH logs to this file, otherwise logging is to stdout + | ++| --test TEST_NAME only run this test or or test module ++| --exclude-test TEST_NAME skip this test or test module ++| + | -q, --quiet only present failures + | -v, --verbose provides additional test output + | -h, --help presents this help +@@ -91,6 +93,9 @@ msg.help + | run_tests.py --integ --test test.integ.util + | Only run integration tests for the util modules. + | ++| run_tests.py --unit --test interpreter.commands --exclude-test interpreter.commands.test_events --verbose ++| Only run interpreter.commands tests, but skip test_events. ++| + | Integration targets: + | + +-- +2.39.2 + diff --git a/net-libs/stem/stem-1.8.0_p20211118.ebuild b/net-libs/stem/stem-1.8.0_p20211118.ebuild deleted file mode 100644 index f409826d624a..000000000000 --- a/net-libs/stem/stem-1.8.0_p20211118.ebuild +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -# Fails w/ 3.11: https://github.com/torproject/stem/issues/130 (breaks net-misc/nyx) -PYTHON_COMPAT=( python3_{9..10} pypy3 ) -DISTUTILS_USE_SETUPTOOLS=no - -inherit distutils-r1 - -DESCRIPTION="Stem is a Python controller library for Tor" -HOMEPAGE="https://stem.torproject.org" -COMMIT="57364fae7269ec562c5fc8cdb073ff9463d9a0f0" -SRC_URI="https://github.com/torproject/stem/archive/${COMMIT}.tar.gz -> ${P}.tar.gz" -S="${WORKDIR}/${PN}-${COMMIT}" - -LICENSE="LGPL-3" -SLOT="0" -KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~riscv ~x86" -IUSE="test" -RESTRICT="!test? ( test )" - -DEPEND="test? ( dev-python/mock[${PYTHON_USEDEP}] - net-vpn/tor ) - dev-python/setuptools[${PYTHON_USEDEP}]" - -RDEPEND="net-vpn/tor" - -DOCS=( docs/{_static,_templates,api,tutorials,{change_log,api,contents,download,faq,index,tutorials}.rst} ) - -python_prepare_all() { - # Disable failing test - sed -i -e "/test_expand_path/a \ - \ \ \ \ return" test/integ/util/system.py || die - sed -i -e "/test_parsing_with_example/a \ - \ \ \ \ return" test/unit/manual.py || die - sed -i -e "/test_parsing_with_unknown_options/a \ - \ \ \ \ return" test/unit/manual.py || die - sed -i -e "/test_saving_manual/a \ - \ \ \ \ return" test/unit/manual.py || die - sed -i -e "/test_sdist_matches_git/a \ - \ \ \ \ return" test/integ/installation.py || die - sed -i -e "/test_connections_by_ss/a \ - \ \ \ \ return" test/integ/util/connection.py || die - distutils-r1_python_prepare_all -} - -python_test() { - ${PYTHON} run_tests.py --all --target RUN_ALL || die -} diff --git a/net-libs/stem/stem-1.8.1.ebuild b/net-libs/stem/stem-1.8.1.ebuild new file mode 100644 index 000000000000..6cd30508aeaa --- /dev/null +++ b/net-libs/stem/stem-1.8.1.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..11} pypy3 ) +DISTUTILS_USE_PEP517=setuptools + +inherit distutils-r1 pypi + +DESCRIPTION="Stem is a Python controller library for Tor" +HOMEPAGE="https://stem.torproject.org" + +LICENSE="LGPL-3" +SLOT="0" +KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~riscv ~x86" +IUSE="test" +RESTRICT="!test? ( test )" + +DEPEND="test? ( dev-python/pyflakes[${PYTHON_USEDEP}] + net-vpn/tor )" + +RDEPEND="net-vpn/tor" + +DOCS=( docs/{_static,_templates,api,tutorials,{api,change_log,contents,download,faq,index,tutorials}.rst} ) + +src_prepare() { + default + + # https://bugzilla.redhat.com/2021902 + eapply "${FILESDIR}/1.8.0-replace-all-usages-of-inspect.getargspec.patch" + + # https://github.com/torproject/stem/issues/53 + eapply "${FILESDIR}/${PV}-Add-an-exclude-test-argument.patch" + + # https://github.com/torproject/stem/issues/56 + sed -i '/MOCK_VERSION/d' run_tests.py || die +} + +python_test() { + # Disable failing test + ${PYTHON} run_tests.py --all --target RUN_ALL \ + --exclude-test test.integ.installation.TestInstallation.test_install \ + --exclude-test test.integ.util.system.TestSystem.test_expand_path \ + --exclude-test test.integ.control.controller.TestController.test_get_listeners \ + --exclude-test test.integ.control.controller.TestController.test_get_ports \ + --exclude-test test.integ.control.controller.TestController.test_getinfo_freshrelaydescs \ + || die + +} |