python-jmespath fails to build with Python 3.11.0a5. + /usr/bin/pytest ============================= test session starts ============================== platform linux -- Python 3.11.0a5, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 rootdir: /builddir/build/BUILD/jmespath.py-0.10.0 plugins: hypothesis-6.36.0 collected 80 items extra/test_hypothesis.py .FF.... [ 8%] tests/test_compliance.py x [ 10%] tests/test_custom_functions.py F [ 11%] tests/test_functions.py FFFFF [ 17%] tests/test_lexer.py ................... [ 41%] tests/test_parser.py FFFFFFFFFF..FFFF......F.FFF.FFFFFFF.FFFF.. [ 93%] tests/test_search.py FFFFs [100%] =================================== FAILURES =================================== ___________________________ test_parser_api_from_str ___________________________ > ??? extra/test_hypothesis.py:77: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:155: in __exit__ self.gen.throw(typ, value, traceback) /usr/lib64/python3.11/contextlib.py:155: in __exit__ self.gen.throw(typ, value, traceback) /usr/lib/python3.11/site-packages/hypothesis/utils/dynamicvariables.py:33: in with_value yield /usr/lib/python3.11/site-packages/hypothesis/_settings.py:340: in local_settings yield s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <hypothesis.core.StateForActualGivenExecution object at 0x7f96071bf3d0> message = "Hypothesis test_parser_api_from_str(expr='w') produces unreliable results: Falsified on the first call but did not on a subsequent one" def __flaky(self, message): if len(self.falsifying_examples) <= 1: > raise Flaky(message) E hypothesis.errors.Flaky: Hypothesis test_parser_api_from_str(expr='w') produces unreliable results: Falsified on the first call but did not on a subsequent one /usr/lib/python3.11/site-packages/hypothesis/core.py:886: Flaky ---------------------------------- Hypothesis ---------------------------------- Falsifying example: test_parser_api_from_str( expr='w', ) Failed to reproduce exception. Expected: expr = 'w' @settings(**BASE_SETTINGS) @given(st.text()) def test_parser_api_from_str(expr): # Same a lexer above with the assumption that we're parsing # a valid sequence of tokens. try: list(lexer.Lexer().tokenize(expr)) except exceptions.JMESPathError as e: # We want to try to parse things that tokenize # properly. assume(False) try: > ast = parser.Parser().parse(expr) extra/test_hypothesis.py:88: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <jmespath.parser.Parser object at 0x7f96049a8310>, expression = 'w' def parse(self, expression): cached = self._CACHE.get(expression) if cached is not None: return cached parsed_result = self._do_parse(expression) self._CACHE[expression] = parsed_result if len(self._CACHE) > self._MAX_SIZE: > self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <jmespath.parser.Parser object at 0x7f96049a8310> def _free_cache_entries(self): > for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...2', 'B162', 'B102', 'B202', 'SSz', 'ILd', 'RCL', 'RRL', 'R1L', 'RLL', 'RL', 'k0', 'YY', 'rrr', 'w_', 'w0', 'www', 'w']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError During handling of the above exception, another exception occurred: expr = 'w' > ??? extra/test_hypothesis.py:77: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.11/site-packages/hypothesis/core.py:575: in test result = self.test(*args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ expr = 'w' @settings(**BASE_SETTINGS) @given(st.text()) def test_parser_api_from_str(expr): # Same a lexer above with the assumption that we're parsing # a valid sequence of tokens. try: list(lexer.Lexer().tokenize(expr)) except exceptions.JMESPathError as e: # We want to try to parse things that tokenize # properly. assume(False) try: ast = parser.Parser().parse(expr) except exceptions.JMESPathError as e: return except Exception as e: > raise AssertionError("Non JMESPathError raised: %s" % e) E AssertionError: Non JMESPathError raised: Population must be a sequence. For dicts or sets, use sorted(d). extra/test_hypothesis.py:92: AssertionError _______________________________ test_search_api ________________________________ > ??? extra/test_hypothesis.py:100: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib64/python3.11/contextlib.py:155: in __exit__ self.gen.throw(typ, value, traceback) /usr/lib64/python3.11/contextlib.py:155: in __exit__ self.gen.throw(typ, value, traceback) /usr/lib/python3.11/site-packages/hypothesis/utils/dynamicvariables.py:33: in with_value yield /usr/lib/python3.11/site-packages/hypothesis/_settings.py:340: in local_settings yield s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <hypothesis.core.StateForActualGivenExecution object at 0x7f96044f6810> message = "Hypothesis test_search_api(expr='G0', data={}) produces unreliable results: Falsified on the first call but did not on a subsequent one" def __flaky(self, message): if len(self.falsifying_examples) <= 1: > raise Flaky(message) E hypothesis.errors.Flaky: Hypothesis test_search_api(expr='G0', data={}) produces unreliable results: Falsified on the first call but did not on a subsequent one /usr/lib/python3.11/site-packages/hypothesis/core.py:886: Flaky ---------------------------------- Hypothesis ---------------------------------- Falsifying example: test_search_api( expr='G0', data={}, ) Failed to reproduce exception. Expected: expr = 'G0', data = {} > ??? extra/test_hypothesis.py:100: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.11/site-packages/hypothesis/core.py:575: in test result = self.test(*args, **kwargs) extra/test_hypothesis.py:103: in test_search_api ast = parser.Parser().parse(expr) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...Sz', 'ILd', 'RCL', 'RRL', 'R1L', 'RLL', 'RL', 'k0', 'YY', 'rrr', 'w_', 'w0', 'www', 'w', 'J_', '__', 'IQ', 'GG', 'G0']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError __________________ TestCustomFunctions.test_null_to_nonetype ___________________ self = <tests.test_custom_functions.TestCustomFunctions testMethod=test_null_to_nonetype> def test_null_to_nonetype(self): data = { 'a': { 'b': [1, 2, 3] } } > self.assertEqual(jmespath.search('length0(a.b)', data, self.options), 3) tests/test_custom_functions.py:24: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/__init__.py:23: in search return parser.Parser().parse(expression).search(data, options=options) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...', 'RRL', 'R1L', 'RLL', 'RL', 'k0', 'YY', 'rrr', 'w_', 'w0', 'www', 'w', 'J_', '__', 'IQ', 'GG', 'G0', 'length0(a.b)']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError _____________________ TestFunctions.test_can_max_datetimes _____________________ self = <tests.test_functions.TestFunctions testMethod=test_can_max_datetimes> def test_can_max_datetimes(self): # This is python specific behavior, but JMESPath does not specify what # you should do with language specific types. We're going to add the # ability that ``to_string`` will always default to str()'ing values it # doesn't understand. data = [datetime.now(), datetime.now() + timedelta(seconds=1)] > result = jmespath.search('max([*].to_string(@))', data) tests/test_functions.py:18: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/__init__.py:23: in search return parser.Parser().parse(expression).search(data, options=options) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...RL', 'k0', 'YY', 'rrr', 'w_', 'w0', 'www', 'w', 'J_', '__', 'IQ', 'GG', 'G0', 'length0(a.b)', 'max([*].to_string(@))']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError ________________ TestFunctions.test_error_message_is_pluralized ________________ self = <tests.test_functions.TestFunctions testMethod=test_error_message_is_pluralized> def test_error_message_is_pluralized(self): with self.assertRaises(exceptions.ArityError) as e: > jmespath.search('sort_by(@)', [0, 1]) tests/test_functions.py:45: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/__init__.py:23: in search return parser.Parser().parse(expression).search(data, options=options) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError _________________ TestFunctions.test_singular_in_error_message _________________ self = <tests.test_functions.TestFunctions testMethod=test_singular_in_error_message> def test_singular_in_error_message(self): with self.assertRaises(exceptions.ArityError) as e: > jmespath.search('length(@, @)', [0, 1]) tests/test_functions.py:37: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/__init__.py:23: in search return parser.Parser().parse(expression).search(data, options=options) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError ____________________ TestFunctions.test_type_error_messages ____________________ self = <tests.test_functions.TestFunctions testMethod=test_type_error_messages> def test_type_error_messages(self): with self.assertRaises(exceptions.JMESPathTypeError) as e: > jmespath.search('length(@)', 2) tests/test_functions.py:23: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/__init__.py:23: in search return parser.Parser().parse(expression).search(data, options=options) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError __________________ TestFunctions.test_variadic_is_pluralized ___________________ self = <tests.test_functions.TestFunctions testMethod=test_variadic_is_pluralized> def test_variadic_is_pluralized(self): with self.assertRaises(exceptions.VariadictArityError) as e: > jmespath.search('not_null()', 'foo') tests/test_functions.py:53: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/__init__.py:23: in search return parser.Parser().parse(expression).search(data, options=options) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError ____________________ TestParser.test_complex_or_expression _____________________ self = <tests.test_parser.TestParser testMethod=test_complex_or_expression> def test_complex_or_expression(self): > parsed = self.parser.parse('foo.foo || foo.bar') tests/test_parser.py:71: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...length0(a.b)', 'max([*].to_string(@))', 'sort_by(@)', 'length(@, @)', 'length(@)', 'not_null()', 'foo.foo || foo.bar']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError __________________________ TestParser.test_dot_syntax __________________________ self = <tests.test_parser.TestParser testMethod=test_dot_syntax> def test_dot_syntax(self): > self.assert_parsed_ast('foo.bar', ast.subexpression([ast.field('foo'), ast.field('bar')])) tests/test_parser.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_parser.py:19: in assert_parsed_ast parsed = self.parser.parse(expression) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...)', 'max([*].to_string(@))', 'sort_by(@)', 'length(@, @)', 'length(@)', 'not_null()', 'foo.foo || foo.bar', 'foo.bar']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError ____________________________ TestParser.test_field _____________________________ self = <tests.test_parser.TestParser testMethod=test_field> def test_field(self): > self.assert_parsed_ast('foo', ast.field('foo')) tests/test_parser.py:27: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_parser.py:19: in assert_parsed_ast parsed = self.parser.parse(expression) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...x([*].to_string(@))', 'sort_by(@)', 'length(@, @)', 'length(@)', 'not_null()', 'foo.foo || foo.bar', 'foo.bar', 'foo']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError _______________ TestParser.test_function_call_with_and_statement _______________ self = <tests.test_parser.TestParser testMethod=test_function_call_with_and_statement> def test_function_call_with_and_statement(self): > self.assert_parsed_ast( 'f(@ && @)', {'children': [{'children': [{'children': [], 'type': 'current'}, {'children': [], 'type': 'current'}], 'type': 'and_expression'}], 'type': 'function_expression', 'value': 'f'}) tests/test_parser.py:101: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/test_parser.py:19: in assert_parsed_ast parsed = self.parser.parse(expression) ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...ng(@))', 'sort_by(@)', 'length(@, @)', 'length(@)', 'not_null()', 'foo.foo || foo.bar', 'foo.bar', 'foo', 'f(@ && @)']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError ____________________________ TestParser.test_index _____________________________ self = <tests.test_parser.TestParser testMethod=test_index> def test_index(self): > parsed = self.parser.parse('foo[1]') tests/test_parser.py:40: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...sort_by(@)', 'length(@, @)', 'length(@)', 'not_null()', 'foo.foo || foo.bar', 'foo.bar', 'foo', 'f(@ && @)', 'foo[1]']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError ________________________ TestParser.test_multiple_dots _________________________ self = <tests.test_parser.TestParser testMethod=test_multiple_dots> def test_multiple_dots(self): > parsed = self.parser.parse('foo.bar.baz') tests/test_parser.py:35: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...ength(@, @)', 'length(@)', 'not_null()', 'foo.foo || foo.bar', 'foo.bar', 'foo', 'f(@ && @)', 'foo[1]', 'foo.bar.baz']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory requirements are kept to the smaller of a k-length # set or an n-length list. # There are other sampling algorithms that do not require # auxiliary memory, but they were rejected because they made # too many calls to _randbelow(), making them slower and # causing them to eat more entropy than necessary. if not isinstance(population, _Sequence): > raise TypeError("Population must be a sequence. " "For dicts or sets, use sorted(d).") E TypeError: Population must be a sequence. For dicts or sets, use sorted(d). /usr/lib64/python3.11/random.py:436: TypeError _________________________ TestParser.test_multiselect __________________________ self = <tests.test_parser.TestParser testMethod=test_multiselect> def test_multiselect(self): > parsed = self.parser.parse('foo.{bar: bar,baz: baz}') tests/test_parser.py:84: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:91: in parse self._free_cache_entries() ../../BUILDROOT/python-jmespath-0.10.0-5.fc37.x86_64/usr/lib/python3.11/site-packages/jmespath/parser.py:492: in _free_cache_entries for key in random.sample(self._CACHE.keys(), int(self._MAX_SIZE / 2)): _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <random.Random object at 0x560870a2e880> population = dict_keys(['T', '_', 'FF', 'I', 'II', 'T0', 'TT', 'jECE', 'g0g', 'g0', 's', 'sB', 'BB', 'wwnc', 'L', 'H', 'HH', 'XX', ...'not_null()', 'foo.foo || foo.bar', 'foo.bar', 'foo', 'f(@ && @)', 'foo[1]', 'foo.bar.baz', 'foo.{bar: bar,baz: baz}']) k = 64 def sample(self, population, k, *, counts=None): """Chooses k unique random elements from a population sequence. Returns a new list containing elements from the population while leaving the original population unchanged. The resulting list is in selection order so that all sub-slices will also be valid random samples. This allows raffle winners (the sample) to be partitioned into grand prize and second place winners (the subslices). Members of the population need not be hashable or unique. If the population contains repeats, then each occurrence is a possible selection in the sample. Repeated elements can be specified one at a time or with the optional counts parameter. For example: sample(['red', 'blue'], counts=[4, 2], k=5) is equivalent to: sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5) To choose a sample from a range of integers, use range() for the population argument. This is especially fast and space efficient for sampling from a large population: sample(range(10000000), 60) """ # Sampling without replacement entails tracking either potential # selections (the pool) in a list or previous selections in a set. # When the number of selections is small compared to the # population, then tracking selections is efficient, requiring # only a small set and an occasional reselection. For # a larger number of selections, the pool tracking method is # preferred since the list takes less space than the # set and it doesn't suffer from frequent reselections. # The number of calls to _randbelow() is kept at or near k, the # theoretical minimum. This is important because running time # is dominated by _randbelow() and because it extracts the # least entropy from the underlying random number generators. # Memory req https://docs.python.org/3.11/whatsnew/3.11.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/03527146-python-jmespath/ For all our attempts to build python-jmespath with Python 3.11, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-jmespath/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11: https://copr.fedorainfracloud.org/coprs/g/python/python3.11/ Let us know here if you have any questions. Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
FEDORA-2022-cd3246db9a has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-cd3246db9a
FEDORA-2022-cd3246db9a has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report.