evhub / coconut

Simple, elegant, Pythonic functional programming.
http://coconut-lang.org
Apache License 2.0
4.07k stars 121 forks source link

2.2.0: pytest is failing in 7 units #716

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' coconut/tests ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/coconut-2.2.0 plugins: remotedata-0.3.3 collected 38 items coconut/tests/constants_test.py ..F. [ 10%] coconut/tests/main_test.py ...FF..F......................FFF. [100%] ========================================================================================= FAILURES ========================================================================================== ________________________________________________________________________________ TestConstants.test_imports _________________________________________________________________________________ self = def test_imports(self): for new_imp, (old_imp, ver_cutoff) in constants.py3_to_py2_stdlib.items(): if "/" in old_imp: new_imp, old_imp = new_imp.split(".", 1)[0], old_imp.split("./", 1)[0] if ( # don't test unix-specific dbm.gnu on Windows or PyPy new_imp == "dbm.gnu" and (WINDOWS or PYPY) # don't test ttk on Python 2.6 or PY26 and old_imp == "ttk" # don't test tkinter on PyPy or PYPY and new_imp.startswith("tkinter") # don't test trollius on PyPy or PYPY and old_imp == "trollius" # don't test typing_extensions on Python 2 or PY2 and old_imp.startswith("typing_extensions") ): pass elif sys.version_info >= ver_cutoff: > assert is_importable(new_imp), "Failed to import " + new_imp E AssertionError: Failed to import dbm.gnu E assert False E + where False = is_importable('dbm.gnu') coconut/tests/constants_test.py:106: AssertionError ________________________________________________________________________________ TestShell.test_exit_jupyter ________________________________________________________________________________ self = def test_exit_jupyter(self): p = spawn_cmd("coconut --jupyter console") p.expect("In", timeout=120) p.sendline("exit()") > p.expect("Shutting down kernel|shutting down") coconut/tests/main_test.py:715: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/pexpect/spawnbase.py:354: in expect return self.expect_list(compiled_pattern_list, /usr/lib/python3.8/site-packages/pexpect/spawnbase.py:383: in expect_list return exp.expect_loop(timeout) /usr/lib/python3.8/site-packages/pexpect/expect.py:179: in expect_loop return self.eof(e) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , err = EOF('End Of File (EOF). Exception style platform.') def eof(self, err=None): spawn = self.spawn spawn.before = spawn._before.getvalue() spawn._buffer = spawn.buffer_type() spawn._before = spawn.buffer_type() spawn.after = EOF index = self.searcher.eof_index if index >= 0: spawn.match = EOF spawn.match_index = index return index else: spawn.match = None spawn.match_index = None msg = str(spawn) msg += '\nsearcher: %s' % self.searcher if err is not None: msg = str(err) + '\n' + msg exc = EOF(msg) exc.__cause__ = None # in Python 3.x we can use "raise exc from None" > raise exc E pexpect.exceptions.EOF: End Of File (EOF). Exception style platform. E E command: /home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/bin/coconut E args: ['/home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/bin/coconut', '--jupyter', 'console'] E buffer (last 100 chars): b'' E before (last 100 chars): b'r command `jupyter-console` not found.\r\n\x1b[31mCoconut exiting with error: Jupyter error\x1b[0m\r\nexit()\r\n' E after: E match: None E match_index: None E exitstatus: None E flag_eof: True E pid: 2749693 E child_fd: 13 E closed: False E timeout: 30 E delimiter: E logfile: None E logfile_read: None E logfile_send: None E maxread: 2000 E ignorecase: False E searchwindowsize: None E delaybeforesend: 0.05 E delayafterclose: 0.1 E delayafterterminate: 0.1 E searcher: searcher_re: E 0: re.compile(b'Shutting down kernel|shutting down') /usr/lib/python3.8/site-packages/pexpect/expect.py:122: EOF ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestShell.test_exit_jupyter... =============================================================================== > coconut --jupyter console ________________________________________________________________________________ TestShell.test_import_hook _________________________________________________________________________________ name = 'runnable', path = None, target = None > ??? E AttributeError: 'CoconutImporter' object has no attribute 'find_spec' :908: AttributeError During handling of the above exception, another exception occurred: self = def test_import_hook(self): with using_sys_path(src): with using_path(runnable_py): with using_coconut(): auto_compilation(True) > import runnable coconut/tests/main_test.py:656: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ :991: in _find_and_load ??? :971: in _find_and_load_unlocked ??? :910: in _find_spec ??? :884: in _find_spec_legacy ??? coconut/convenience.py:198: in find_module self.run_compiler(filepath) coconut/convenience.py:181: in run_compiler cmd([path] + list(coconut_import_hook_args)) coconut/convenience.py:66: in cmd return get_state(state).cmd(cmd_args, interact=interact, **kwargs) coconut/command/command.py:160: in cmd self.exit_on_error() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def exit_on_error(self): """Exit if exit_code is abnormal.""" if self.exit_code: if self.errmsg is not None: # show on stdout with error color code so that stdout # listeners see the error logger.show("Coconut exiting with error: " + self.errmsg, color=error_color_code) self.errmsg = None if self.using_jobs: kill_children() > sys.exit(self.exit_code) E SystemExit: 1 coconut/command/command.py:183: SystemExit ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestShell.test_import_hook... =============================================================================== ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 908, in _find_spec AttributeError: 'CoconutImporter' object has no attribute 'find_spec' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/coconut/command/command.py", line 407, in handling_exceptions yield File "/home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/coconut/command/command.py", line 159, in cmd self.use_args(parsed_args, interact, original_args=args) File "/home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/coconut/command/command.py", line 316, in use_args self.execute(self.parse_block(sys.stdin.read())) File "/usr/lib/python3.8/site-packages/_pytest/capture.py", line 192, in read raise OSError( OSError: pytest: reading from stdin while output is captured! Consider using `-s`. (you should report this at https://github.com/evhub/coconut/issues/new) ____________________________________________________________________________ TestShell.test_kernel_installation _____________________________________________________________________________ self = def test_kernel_installation(self): > call(["coconut", "--jupyter"], assert_output=kernel_installation_msg) coconut/tests/main_test.py:703: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['coconut', '--jupyter'], assert_output = ("Coconut: Successfully installed Jupyter kernels: 'coconut', 'coconut_py', 'coconut_py2', 'coconut_py3'",), check_mypy = False check_errors = True, stderr_first = False, expect_retcode = 0, convert_to_import = False, kwargs = {}, cmd = ['coconut', '--jupyter'], @py_assert0 = 'Traceback (most recent call last):' @py_assert2 = False @py_format6 = "Traceback in 'Traceback (most recent call last):'\n>assert 'Traceback (... call last):' not in 'Traceback (... call last):'\n~'Traceback (most recent call last):' is contained here:\n~ Traceback (most recent call last):" def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) if stderr_first: out = stderr + stdout else: out = stdout + stderr out = "".join(out) raw_lines = out.splitlines() lines = [] i = 0 while True: if i >= len(raw_lines): break line = raw_lines[i] # ignore https://bugs.python.org/issue39098 errors if sys.version_info < (3, 9) and line == "Error in atexit._run_exitfuncs:": while True: i += 1 if i >= len(raw_lines): break new_line = raw_lines[i] if not new_line.startswith(" ") and not any(test in new_line for test in ignore_atexit_errors_with): i -= 1 break continue # combine mypy error lines if any(infix in line for infix in mypy_err_infixes): # always add the next line, since it might be a continuation of the error message line += "\n" + raw_lines[i + 1] i += 1 # then keep adding more lines if they start with whitespace, since they might be the referenced code for j in range(i + 2, len(raw_lines)): next_line = raw_lines[j] if next_line.lstrip() == next_line: break line += "\n" + next_line i += 1 lines.append(line) i += 1 for line in lines: for errstr in always_err_strs: assert errstr not in line, "{errstr!r} in {line!r}".format(errstr=errstr, line=line) if check_errors: > assert "Traceback (most recent call last):" not in line, "Traceback in " + repr(line) E AssertionError: Traceback in 'Traceback (most recent call last):' E assert 'Traceback (... call last):' not in 'Traceback (... call last):' E 'Traceback (most recent call last):' is contained here: E Traceback (most recent call last): coconut/tests/main_test.py:271: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestShell.test_kernel_installation... =============================================================================== Coconut: Installing Jupyter kernels 'coconut_py', 'coconut_py2', 'coconut_py3'... Coconut: Successfully installed Jupyter kernels: 'coconut_py', 'coconut_py2', 'coconut_py3' ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > coconut --jupyter Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/coconut/util.py", line 292, in install_custom_kernel os.makedirs(kernel_dest) File "/usr/lib64/python3.8/os.py", line 223, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/usr/share/jupyter/kernels/coconut' CoconutWarning: Coconut Jupyter kernel installation failed due to above error (try again with 'sudo'). __________________________________________________________________________________ TestExternal.test_bbopt __________________________________________________________________________________ self = def test_bbopt(self): with using_path(bbopt): comp_bbopt() if not PYPY and (PY2 or PY36) and not PY39: > install_bbopt() coconut/tests/main_test.py:830: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ coconut/tests/main_test.py:627: in install_bbopt call(["pip", "install", "-Ue", bbopt]) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['pip', 'install', '-Ue', './bbopt'], assert_output = ('',), check_mypy = False, check_errors = True, stderr_first = False, expect_retcode = 0, convert_to_import = False kwargs = {}, cmd = ['pip', 'install', '-Ue', './bbopt'] def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: > assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) E AssertionError: Return code not as expected (1 != 0) in: ['pip', 'install', '-Ue', './bbopt'] E assert 1 == 0 coconut/tests/main_test.py:219: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestExternal.test_bbopt... =============================================================================== Compiling bbopt/setup.coco ... Compiled to bbopt/setup.py . Compiling bbopt/bbopt-source/__init__.coco ... Compiling bbopt/bbopt-source/__main__.coco ... Compiling bbopt/bbopt-source/benchmarking.coco ... Compiling bbopt/bbopt-source/cli.coco ... Compiling bbopt/bbopt-source/constants.coco ... Compiling bbopt/bbopt-source/optimizer.coco ... Compiling bbopt/bbopt-source/params.coco ... Compiling bbopt/bbopt-source/registry.coco ... Compiling bbopt/bbopt-source/util.coco ... Compiling bbopt/bbopt-source/backends/__init__.coco ... Compiling bbopt/bbopt-source/backends/bandit.coco ... Compiling bbopt/bbopt-source/backends/bask.coco ... Compiling bbopt/bbopt-source/backends/hyperopt.coco ... Compiling bbopt/bbopt-source/backends/mixture.coco ... Compiling bbopt/bbopt-source/backends/openai.coco ... Compiling bbopt/bbopt-source/backends/pysot.coco ... Compiling bbopt/bbopt-source/backends/random.coco ... Compiling bbopt/bbopt-source/backends/serving.coco ... Compiling bbopt/bbopt-source/backends/skopt.coco ... Compiling bbopt/bbopt-source/backends/util.coco ... Compiling bbopt/bbopt-source/tests/__init__.coco ... Compiling bbopt/bbopt-source/tests/constants_test.coco ... Compiling bbopt/bbopt-source/tests/examples_test.coco ... Compiled to bbopt/bbopt/__init__.py . Compiled to bbopt/bbopt/tests/__init__.py . Compiled to bbopt/bbopt/__main__.py . Compiled to bbopt/bbopt/backends/__init__.py . Compiled to bbopt/bbopt/constants.py . Compiled to bbopt/bbopt/backends/bask.py . Compiled to bbopt/bbopt/backends/serving.py . Compiled to bbopt/bbopt/backends/random.py . Compiled to bbopt/bbopt/tests/constants_test.py . Compiled to bbopt/bbopt/backends/bandit.py . Compiled to bbopt/bbopt/cli.py . Compiled to bbopt/bbopt/backends/mixture.py . Compiled to bbopt/bbopt/registry.py . Compiled to bbopt/bbopt/benchmarking.py . Compiled to bbopt/bbopt/backends/hyperopt.py . Compiled to bbopt/bbopt/backends/skopt.py . Compiled to bbopt/bbopt/backends/pysot.py . Compiled to bbopt/bbopt/params.py . Compiled to bbopt/bbopt/tests/examples_test.py . Compiled to bbopt/bbopt/util.py . Compiled to bbopt/bbopt/backends/openai.py . Compiled to bbopt/bbopt/backends/util.py . Compiled to bbopt/bbopt/optimizer.py . Defaulting to user installation because normal site-packages is not writeable Obtaining file:///home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/bbopt Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: numpy>=1.15.1 in /usr/lib64/python3.8/site-packages (from bbopt==1.4.2) (1.24.1) Requirement already satisfied: matplotlib>=2.2.5 in /usr/lib64/python3.8/site-packages (from bbopt==1.4.2) (3.6.3) Collecting pysot>=0.3.3 Downloading pySOT-0.3.3-py2.py3-none-any.whl (72 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.7/72.7 kB 3.0 MB/s eta 0:00:00 Collecting portalocker>=2.2.1 Downloading portalocker-2.6.0-py2.py3-none-any.whl (15 kB) Collecting hyperopt>=0.2.5 Downloading hyperopt-0.2.7-py2.py3-none-any.whl (1.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 7.0 MB/s eta 0:00:00 Collecting scikit-optimize>=0.8.1 Downloading scikit_optimize-0.9.0-py2.py3-none-any.whl (100 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.3/100.3 kB 6.2 MB/s eta 0:00:00 Collecting openai>=0.6.4 Downloading openai-0.26.1.tar.gz (55 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.3/55.3 kB 5.6 MB/s eta 0:00:00 Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Collecting scikit-learn>=0.23.2 Downloading scikit_learn-1.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.7 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.7/9.7 MB 7.0 MB/s eta 0:00:00 Collecting networkx>=2.2 Downloading networkx-3.0-py3-none-any.whl (2.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 7.1 MB/s eta 0:00:00 Collecting pymongo>=3.9 Downloading pymongo-4.3.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (501 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 501.4/501.4 kB 7.3 MB/s eta 0:00:00 Collecting pyspark>=2.4 Downloading pyspark-3.3.1.tar.gz (281.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 281.4/281.4 MB 3.7 MB/s eta 0:00:00 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting bask>=0.10.6 Downloading bask-0.10.8-py3-none-any.whl (32 kB) Collecting tqdm>=4.48.2 Downloading tqdm-4.64.1-py2.py3-none-any.whl (78 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 kB 6.3 MB/s eta 0:00:00 Collecting arviz>=0.10.0 Downloading arviz-0.14.0-py3-none-any.whl (1.7 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 7.1 MB/s eta 0:00:00 Collecting scipy>=1.2 Downloading scipy-1.10.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.5 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 34.5/34.5 MB 6.4 MB/s eta 0:00:00 Collecting emcee>=3.0.2 Downloading emcee-3.1.3-py2.py3-none-any.whl (46 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.2/46.2 kB 5.0 MB/s eta 0:00:00 Collecting scikit-optimize>=0.8.1 Downloading scikit_optimize-0.8.1-py2.py3-none-any.whl (101 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 101.2/101.2 kB 6.5 MB/s eta 0:00:00 Collecting scikit-learn>=0.23.2 Downloading scikit_learn-0.23.2-cp38-cp38-manylinux1_x86_64.whl (6.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 6.9 MB/s eta 0:00:00 Collecting cloudpickle Downloading cloudpickle-2.2.0-py3-none-any.whl (25 kB) Requirement already satisfied: six in /usr/lib/python3.8/site-packages (from hyperopt>=0.2.5->bbopt==1.4.2) (1.16.0) Collecting future Downloading future-0.18.3.tar.gz (840 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 840.9/840.9 kB 7.3 MB/s eta 0:00:00 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting py4j Downloading py4j-0.10.9.7-py2.py3-none-any.whl (200 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 200.5/200.5 kB 6.0 MB/s eta 0:00:00 Requirement already satisfied: packaging>=20.0 in /usr/lib/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (21.3) Requirement already satisfied: python-dateutil>=2.7 in /usr/lib/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (2.8.2) Requirement already satisfied: kiwisolver>=1.0.1 in /usr/lib64/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (1.4.4) Requirement already satisfied: pillow>=6.2.0 in /usr/lib64/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (9.4.0) Requirement already satisfied: contourpy>=1.0.1 in /usr/lib64/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (1.0.6) Requirement already satisfied: pyparsing>=2.2.1 in /usr/lib/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (3.0.9) Requirement already satisfied: fonttools>=4.22.0 in /usr/lib64/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (4.38.0) Requirement already satisfied: cycler>=0.10 in /usr/lib/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (0.11.0) Collecting aiohttp Using cached aiohttp-3.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB) Collecting requests>=2.20 Downloading requests-2.28.2-py3-none-any.whl (62 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 5.7 MB/s eta 0:00:00 Collecting dnspython<3.0.0,>=1.16.0 Downloading dnspython-2.3.0-py3-none-any.whl (283 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 283.7/283.7 kB 7.1 MB/s eta 0:00:00 Collecting dill Using cached dill-0.3.6-py3-none-any.whl (110 kB) Collecting POAP>=0.1.25 Downloading POAP-0.1.26-py2.py3-none-any.whl (36 kB) Collecting pyDOE2 Downloading pyDOE2-1.3.0.tar.gz (19 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: pytest in /usr/lib/python3.8/site-packages (from pysot>=0.3.3->bbopt==1.4.2) (7.2.1) Collecting py4j Downloading py4j-0.10.9.5-py2.py3-none-any.whl (199 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.7/199.7 kB 6.8 MB/s eta 0:00:00 Collecting threadpoolctl>=2.0.0 Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB) Collecting joblib>=0.11 Downloading joblib-1.2.0-py3-none-any.whl (297 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 298.0/298.0 kB 7.0 MB/s eta 0:00:00 Collecting pyaml>=16.9 Downloading pyaml-21.10.1-py2.py3-none-any.whl (24 kB) Collecting xarray-einstats>=0.3 Downloading xarray_einstats-0.5.0-py3-none-any.whl (28 kB) Requirement already satisfied: setuptools>=60.0.0 in /usr/lib/python3.8/site-packages (from arviz>=0.10.0->bask>=0.10.6->bbopt==1.4.2) (65.6.3) Collecting xarray>=0.21.0 Downloading xarray-2022.12.0-py3-none-any.whl (969 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 970.0/970.0 kB 7.1 MB/s eta 0:00:00 Collecting netcdf4 Downloading netCDF4-1.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.1/5.1 MB 7.1 MB/s eta 0:00:00 Requirement already satisfied: typing-extensions>=4.1.0 in /usr/lib/python3.8/site-packages (from arviz>=0.10.0->bask>=0.10.6->bbopt==1.4.2) (4.4.0) Collecting pandas>=1.4.0 Downloading pandas-1.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.2/12.2 MB 6.9 MB/s eta 0:00:00 Requirement already satisfied: PyYAML in /usr/lib64/python3.8/site-packages (from pyaml>=16.9->scikit-optimize>=0.8.1->bbopt==1.4.2) (6.0) Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.14-py2.py3-none-any.whl (140 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.6/140.6 kB 6.9 MB/s eta 0:00:00 Collecting idna<4,>=2.5 Using cached idna-3.4-py3-none-any.whl (61 kB) Collecting certifi>=2017.4.17 Using cached certifi-2022.12.7-py3-none-any.whl (155 kB) Collecting charset-normalizer<4,>=2 Downloading charset_normalizer-3.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (195 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 195.4/195.4 kB 6.7 MB/s eta 0:00:00 Collecting async-timeout<5.0,>=4.0.0a3 Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB) Collecting frozenlist>=1.1.1 Using cached frozenlist-1.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (161 kB) Collecting aiosignal>=1.1.2 Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB) Requirement already satisfied: attrs>=17.3.0 in /usr/lib/python3.8/site-packages (from aiohttp->openai>=0.6.4->bbopt==1.4.2) (22.2.0) Collecting multidict<7.0,>=4.5 Downloading multidict-6.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.3/121.3 kB 6.7 MB/s eta 0:00:00 Collecting charset-normalizer<4,>=2 Using cached charset_normalizer-2.1.1-py3-none-any.whl (39 kB) Collecting yarl<2.0,>=1.0 Using cached yarl-1.8.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (262 kB) Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /usr/lib/python3.8/site-packages (from pytest->pysot>=0.3.3->bbopt==1.4.2) (1.0.0) Requirement already satisfied: iniconfig in /usr/lib/python3.8/site-packages (from pytest->pysot>=0.3.3->bbopt==1.4.2) (2.0.0) Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/lib/python3.8/site-packages (from pytest->pysot>=0.3.3->bbopt==1.4.2) (1.0.0) Requirement already satisfied: tomli>=1.0.0 in /usr/lib/python3.8/site-packages (from pytest->pysot>=0.3.3->bbopt==1.4.2) (2.0.1) Collecting pytz>=2020.1 Downloading pytz-2022.7.1-py2.py3-none-any.whl (499 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 499.4/499.4 kB 7.1 MB/s eta 0:00:00 Collecting cftime Downloading cftime-1.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 7.2 MB/s eta 0:00:00 Building wheels for collected packages: openai, pyspark, future, pyDOE2 Building wheel for openai (pyproject.toml): started Building wheel for openai (pyproject.toml): finished with status 'done' Created wheel for openai: filename=openai-0.26.1-py3-none-any.whl size=67097 sha256=b91fa64afdcdfd0149a524c72bb7ede8264639ac03b16e8bfb583197613c6e13 Stored in directory: /home/tkloczko/.cache/pip/wheels/f5/c8/97/9891ab54bc2e1c772cbc66a4fce5cfc7ed044d34ff4b5673a0 Building wheel for pyspark (setup.py): started Building wheel for pyspark (setup.py): finished with status 'done' Created wheel for pyspark: filename=pyspark-3.3.1-py2.py3-none-any.whl size=281921661 sha256=7d7dbfa52dbde7e037878d191ed4e2b8bcbd88614b002946cab17ec812c5bee8 Stored in directory: /home/tkloczko/.cache/pip/wheels/a3/6d/2c/5b3e1b020cfaf4e908bb678b59be2d840fd1c691afa21d2dca Building wheel for future (setup.py): started Building wheel for future (setup.py): finished with status 'done' Created wheel for future: filename=future-0.18.3-py3-none-any.whl size=492868 sha256=38ffe631e6b315b8b1a8ff404b66f43289175fbc5fa6f8098e81cb0c9a5c69d2 Stored in directory: /home/tkloczko/.cache/pip/wheels/a6/db/41/71a0e5d071a14e716cc11bb021a9caa8f76ec337eca071487e Building wheel for pyDOE2 (setup.py): started Building wheel for pyDOE2 (setup.py): finished with status 'done' Created wheel for pyDOE2: filename=pyDOE2-1.3.0-py3-none-any.whl size=25490 sha256=44286b7cd56bde982e212ffc2c38430c993c85b93df3da1531c0d88d544de274 Stored in directory: /home/tkloczko/.cache/pip/wheels/f8/bf/ae/1d199b31d764fe638f72d5d69d16206b1598503ab16384662c Successfully built openai pyspark future pyDOE2 Installing collected packages: pytz, py4j, POAP, urllib3, tqdm, threadpoolctl, scipy, pyspark, pyaml, portalocker, networkx, multidict, joblib, idna, future, frozenlist, emcee, dnspython, dill, cloudpickle, charset-normalizer, cftime, certifi, async-timeout, yarl, scikit-learn, requests, pymongo, pyDOE2, pandas, netcdf4, hyperopt, aiosignal, xarray, scikit-optimize, pysot, aiohttp, xarray-einstats, openai, arviz, bask, bbopt ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > git clone https://github.com/evhub/bbopt.git Cloning into 'bbopt'... > /usr/bin/python3 -m coconut --jobs sys ./bbopt/setup.coco --force > /usr/bin/python3 -m coconut --jobs sys ./bbopt/bbopt-source ./bbopt/bbopt --force in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'RandomBackend' (add '# NOQA' to suppress) (line 12) from bbopt.backends.random import RandomBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'MixtureBackend' (add '# NOQA' to suppress) (line 13) from bbopt.backends.mixture import MixtureBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'BanditBackend' (add '# NOQA' to suppress) (line 14) from bbopt.backends.bandit import BanditBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'SkoptBackend' (add '# NOQA' to suppress) (line 16) from bbopt.backends.skopt import SkoptBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'HyperoptBackend' (add '# NOQA' to suppress) (line 21) from bbopt.backends.hyperopt import HyperoptBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'PySOTBackend' (add '# NOQA' to suppress) (line 27) from bbopt.backends.pysot import PySOTBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'BaskBackend' (add '# NOQA' to suppress) (line 33) from bbopt.backends.bask import BaskBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'OpenAIBackend' (add '# NOQA' to suppress) (line 39) from bbopt.backends.openai import OpenAIBackend in bbopt/bbopt-source/backends/pysot.coco: CoconutSyntaxWarning: assignment shadows builtin 'eval' (use explicit '\eval' syntax when purposefully assigning to builtin names) (line 100) def eval(self, xs): ^ > pip install -Ue ./bbopt ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/tkloczko/.local/lib/python3.8/site-packages' Check the permissions. _________________________________________________________________________________ TestExternal.test_prelude _________________________________________________________________________________ self = def test_prelude(self): with using_path(prelude): comp_prelude() if MYPY: > run_prelude() coconut/tests/main_test.py:818: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ coconut/tests/main_test.py:614: in run_prelude call(["make", "base-install"], cwd=prelude) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['make', 'base-install'], assert_output = ('',), check_mypy = False, check_errors = True, stderr_first = False, expect_retcode = 0, convert_to_import = False kwargs = {'cwd': './coconut-prelude'}, cmd = ['make', 'base-install'] def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: > assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) E AssertionError: Return code not as expected (2 != 0) in: ['make', 'base-install'] E assert 2 == 0 coconut/tests/main_test.py:219: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestExternal.test_prelude... =============================================================================== Compiling coconut-prelude/setup.coco ... Compiled to coconut-prelude/setup.py . Compiling coconut-prelude/prelude-source/__init__.coco ... Compiling coconut-prelude/prelude-source/main.coco ... Compiling coconut-prelude/prelude-source/main_test.coco ... Compiling coconut-prelude/prelude-source/typevars.coco ... Compiling coconut-prelude/prelude-source/util.coco ... Compiling coconut-prelude/prelude-source/util_test.coco ... Compiled to coconut-prelude/prelude/__init__.py . Compiled to coconut-prelude/prelude/typevars.py . Compiled to coconut-prelude/prelude/util_test.py . Compiled to coconut-prelude/prelude/util.py . Compiled to coconut-prelude/prelude/main_test.py . Compiled to coconut-prelude/prelude/main.py . pip install --upgrade pytest Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: pytest in /usr/lib/python3.8/site-packages (7.2.1) Requirement already satisfied: attrs>=19.2.0 in /usr/lib/python3.8/site-packages (from pytest) (22.2.0) Requirement already satisfied: iniconfig in /usr/lib/python3.8/site-packages (from pytest) (2.0.0) Requirement already satisfied: packaging in /usr/lib/python3.8/site-packages (from pytest) (21.3) Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/lib/python3.8/site-packages (from pytest) (1.0.0) Requirement already satisfied: tomli>=1.0.0 in /usr/lib/python3.8/site-packages (from pytest) (2.0.1) Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /usr/lib/python3.8/site-packages (from pytest) (1.0.0) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/lib/python3.8/site-packages (from packaging->pytest) (3.0.9) ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > git clone https://github.com/evhub/coconut-prelude Cloning into 'coconut-prelude'... > /usr/bin/python3 -m coconut --jobs sys ./coconut-prelude/setup.coco --force --target 3.5 --mypy > /usr/bin/python3 -m coconut --jobs sys ./coconut-prelude/prelude-source ./coconut-prelude/prelude --force --target 3.5 --mypy > make base-install ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/tkloczko/.local/lib/python3.8/site-packages' Check the permissions. make: *** [Makefile:13: base-install] Error 1 ________________________________________________________________________________ TestExternal.test_pyprover _________________________________________________________________________________ self = def test_pyprover(self): with using_path(pyprover): comp_pyprover() > run_pyprover() coconut/tests/main_test.py:811: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ coconut/tests/main_test.py:598: in run_pyprover call(["pip", "install", "-e", pyprover]) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['pip', 'install', '-e', './pyprover'], assert_output = ('',), check_mypy = False, check_errors = True, stderr_first = False, expect_retcode = 0, convert_to_import = False kwargs = {}, cmd = ['pip', 'install', '-e', './pyprover'] def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: > assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) E AssertionError: Return code not as expected (1 != 0) in: ['pip', 'install', '-e', './pyprover'] E assert 1 == 0 coconut/tests/main_test.py:219: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestExternal.test_pyprover... =============================================================================== Compiling pyprover/setup.coco ... Compiled to pyprover/setup.py . Compiling pyprover/pyprover-source/__init__.coco ... Compiling pyprover/pyprover-source/atoms.coco ... Compiling pyprover/pyprover-source/constants.coco ... Compiling pyprover/pyprover-source/logic.coco ... Compiling pyprover/pyprover-source/parser.coco ... Compiling pyprover/pyprover-source/tests.coco ... Compiling pyprover/pyprover-source/tools.coco ... Compiling pyprover/pyprover-source/util.coco ... Compiled to pyprover/pyprover/__init__.py . Compiled to pyprover/pyprover/constants.py . Compiled to pyprover/pyprover/tools.py . Compiled to pyprover/pyprover/util.py . Compiled to pyprover/pyprover/atoms.py . Compiled to pyprover/pyprover/parser.py . Compiled to pyprover/pyprover/tests.py . Compiled to pyprover/pyprover/logic.py . Defaulting to user installation because normal site-packages is not writeable Obtaining file:///home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/pyprover Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: pyparsing in /usr/lib/python3.8/site-packages (from pyprover==0.6.2) (3.0.9) Installing collected packages: pyprover ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > git clone https://github.com/evhub/pyprover.git Cloning into 'pyprover'... > /usr/bin/python3 -m coconut --jobs sys ./pyprover/setup.coco --force > /usr/bin/python3 -m coconut --jobs sys ./pyprover/pyprover-source ./pyprover/pyprover --force in pyprover/pyprover-source/util.coco: CoconutSyntaxWarning: found deprecated equality-checking '=...' pattern; use '==...' instead (line 92) match {=var: prev_sub, **_} in subs: ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'call' (use explicit '\call' syntax when purposefully assigning to builtin names) (line 56) def call(action, item): ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'const' (use explicit '\const' syntax when purposefully assigning to builtin names) (line 77) match def exists_handle(const, expr) = Exists(const, expr) ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'const' (use explicit '\const' syntax when purposefully assigning to builtin names) (line 80) match def exists_handle(const, prop, expr) = ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'const' (use explicit '\const' syntax when purposefully assigning to builtin names) (line 83) match def forall_handle(const, expr) = ForAll(const, expr) ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'const' (use explicit '\const' syntax when purposefully assigning to builtin names) (line 86) match def forall_handle(const, prop, expr) = ^ in pyprover/pyprover-source/logic.coco: CoconutSyntaxWarning: found deprecated equality-checking '=...' pattern; use '==...' instead (line 192) match {=self: sub, **_} in subs: ^ in pyprover/pyprover-source/logic.coco: CoconutSyntaxWarning: found deprecated equality-checking '=...' pattern; use '==...' instead (line 258) match {=self.proposition(): sub, **_} in subs: ^ > pip install -e ./pyprover ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/tkloczko/.local/lib/python3.8/site-packages' Check the permissions. ================================================================================== short test summary info ================================================================================== FAILED coconut/tests/constants_test.py::TestConstants::test_imports - AssertionError: Failed to import dbm.gnu FAILED coconut/tests/main_test.py::TestShell::test_exit_jupyter - pexpect.exceptions.EOF: End Of File (EOF). Exception style platform. FAILED coconut/tests/main_test.py::TestShell::test_import_hook - SystemExit: 1 FAILED coconut/tests/main_test.py::TestShell::test_kernel_installation - AssertionError: Traceback in 'Traceback (most recent call last):' FAILED coconut/tests/main_test.py::TestExternal::test_bbopt - AssertionError: Return code not as expected (1 != 0) in: ['pip', 'install', '-Ue', './bbopt'] FAILED coconut/tests/main_test.py::TestExternal::test_prelude - AssertionError: Return code not as expected (2 != 0) in: ['make', 'base-install'] FAILED coconut/tests/main_test.py::TestExternal::test_pyprover - AssertionError: Return code not as expected (1 != 0) in: ['pip', 'install', '-e', './pyprover'] ========================================================================= 7 failed, 31 passed in 2347.17s (0:39:07) ========================================================================= ```

Here is list of installed modules in build env

```console Package Version ----------------- -------------- appdirs 1.4.4 asn1crypto 1.5.1 asttokens 2.2.0 attrs 22.2.0 backcall 0.2.0 bcrypt 3.2.2 build 0.9.0 cffi 1.15.1 comm 0.1.2 contourpy 1.0.6 cPyparsing 2.4.7.1.2.0 cryptography 38.0.4 cssselect 1.1.0 cycler 0.11.0 debugpy 1.6.5 decorator 5.1.1 distro 1.8.0 entrypoints 0.4 exceptiongroup 1.0.0 executing 1.2.0 extras 1.0.0 fixtures 4.0.0 fonttools 4.38.0 gpg 1.18.0-unknown iniconfig 2.0.0 ipykernel 6.20.2 ipython 8.6.0 jedi 0.18.2 jupyter_client 7.4.9 jupyter_core 5.1.3 kiwisolver 1.4.4 libcomps 0.1.19 lxml 4.9.1 matplotlib 3.6.3 matplotlib-inline 0.1.6 mypy 0.990 mypy-extensions 0.4.3 nest-asyncio 1.5.6 numpy 1.24.1 olefile 0.46 packaging 21.3 parso 0.8.3 pbr 5.9.0 pep517 0.13.0 pexpect 4.8.0 pickleshare 0.7.5 Pillow 9.4.0 pip 22.3.1 platformdirs 2.6.0 pluggy 1.0.0 ply 3.11 prompt-toolkit 3.0.29 psutil 5.9.2 ptyprocess 0.7.0 pure-eval 0.2.2 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycparser 2.21 Pygments 2.14.0 PyGObject 3.42.2 pyparsing 3.0.9 pytest 7.2.1 pytest-remotedata 0.3.3 python-dateutil 2.8.2 PyYAML 6.0 pyzmq 24.0.1 rpm 4.17.0 scour 0.38.2 setuptools 65.6.3 six 1.16.0 stack-data 0.6.2 testtools 2.5.0 tomli 2.0.1 tornado 6.2 tpm2-pkcs11-tools 1.33.7 tpm2-pytss 1.1.0 traitlets 5.8.1 typing_extensions 4.4.0 wcwidth 0.2.6 wheel 0.38.4 ```
evhub commented 1 year ago

Coconut's test suite is not meant to be invoked outside of the context of Coconut's continuous integration tests. The test suite is very complex, takes an extremely long time to run, and has dependencies outside of the normal Coconut dependencies, such that maintaining it in such a way to guarantee that it succeeds when built on arbitrary platforms is not something that I can do.

If you want to run some tests to verify that your installation is working, I'd recommend instead mimicking what make test-univ does and running something like:

python ./coconut/tests
python ./coconut/tests/dest/runner.py
python ./coconut/tests/dest/extras.py
kloczek commented 1 year ago

How long it taked and much it is complicated it really doesn't matter. So what is wrong with those units and what kind of external dependencies test suite has? 🤔 I'm trying to test all my packages with python modules usig pytest because it provides for many many other possibilies to perform other types of tests without touching build procedure described in rpm spec file by only altering list of modules instaled in build env. In other words using anything else than pytest is not good option 😞

kloczek commented 1 year ago

In udated build env I see now more units failing Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' coconut/tests ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.16, pytest-7.2.2, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/coconut-2.2.0 plugins: remotedata-0.4.0 collected 38 items coconut/tests/constants_test.py ..F. [ 10%] coconut/tests/main_test.py ...FF..F...FF.F...............FFF. [100%] ========================================================================================= FAILURES ========================================================================================== ________________________________________________________________________________ TestConstants.test_imports _________________________________________________________________________________ self = def test_imports(self): for new_imp, (old_imp, ver_cutoff) in constants.py3_to_py2_stdlib.items(): if "/" in old_imp: new_imp, old_imp = new_imp.split(".", 1)[0], old_imp.split("./", 1)[0] if ( # don't test unix-specific dbm.gnu on Windows or PyPy new_imp == "dbm.gnu" and (WINDOWS or PYPY) # don't test ttk on Python 2.6 or PY26 and old_imp == "ttk" # don't test tkinter on PyPy or PYPY and new_imp.startswith("tkinter") # don't test trollius on PyPy or PYPY and old_imp == "trollius" # don't test typing_extensions on Python 2 or PY2 and old_imp.startswith("typing_extensions") ): pass elif sys.version_info >= ver_cutoff: > assert is_importable(new_imp), "Failed to import " + new_imp E AssertionError: Failed to import dbm.gnu E assert False E + where False = is_importable('dbm.gnu') coconut/tests/constants_test.py:106: AssertionError ________________________________________________________________________________ TestShell.test_exit_jupyter ________________________________________________________________________________ self = def test_exit_jupyter(self): p = spawn_cmd("coconut --jupyter console") p.expect("In", timeout=120) p.sendline("exit()") > p.expect("Shutting down kernel|shutting down") coconut/tests/main_test.py:715: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/pexpect/spawnbase.py:354: in expect return self.expect_list(compiled_pattern_list, /usr/lib/python3.8/site-packages/pexpect/spawnbase.py:383: in expect_list return exp.expect_loop(timeout) /usr/lib/python3.8/site-packages/pexpect/expect.py:179: in expect_loop return self.eof(e) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , err = EOF('End Of File (EOF). Exception style platform.') def eof(self, err=None): spawn = self.spawn spawn.before = spawn._before.getvalue() spawn._buffer = spawn.buffer_type() spawn._before = spawn.buffer_type() spawn.after = EOF index = self.searcher.eof_index if index >= 0: spawn.match = EOF spawn.match_index = index return index else: spawn.match = None spawn.match_index = None msg = str(spawn) msg += '\nsearcher: %s' % self.searcher if err is not None: msg = str(err) + '\n' + msg exc = EOF(msg) exc.__cause__ = None # in Python 3.x we can use "raise exc from None" > raise exc E pexpect.exceptions.EOF: End Of File (EOF). Exception style platform. E E command: /home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/bin/coconut E args: ['/home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/bin/coconut', '--jupyter', 'console'] E buffer (last 100 chars): b'' E before (last 100 chars): b'r command `jupyter-console` not found.\r\n\x1b[31mCoconut exiting with error: Jupyter error\x1b[0m\r\nexit()\r\n' E after: E match: None E match_index: None E exitstatus: None E flag_eof: True E pid: 3274426 E child_fd: 15 E closed: False E timeout: 30 E delimiter: E logfile: None E logfile_read: None E logfile_send: None E maxread: 2000 E ignorecase: False E searchwindowsize: None E delaybeforesend: 0.05 E delayafterclose: 0.1 E delayafterterminate: 0.1 E searcher: searcher_re: E 0: re.compile(b'Shutting down kernel|shutting down') /usr/lib/python3.8/site-packages/pexpect/expect.py:122: EOF ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestShell.test_exit_jupyter... =============================================================================== > coconut --jupyter console ________________________________________________________________________________ TestShell.test_import_hook _________________________________________________________________________________ name = 'runnable', path = None, target = None > ??? E AttributeError: 'CoconutImporter' object has no attribute 'find_spec' :908: AttributeError During handling of the above exception, another exception occurred: self = def test_import_hook(self): with using_sys_path(src): with using_path(runnable_py): with using_coconut(): auto_compilation(True) > import runnable coconut/tests/main_test.py:656: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ :991: in _find_and_load ??? :971: in _find_and_load_unlocked ??? :910: in _find_spec ??? :884: in _find_spec_legacy ??? coconut/convenience.py:198: in find_module self.run_compiler(filepath) coconut/convenience.py:181: in run_compiler cmd([path] + list(coconut_import_hook_args)) coconut/convenience.py:66: in cmd return get_state(state).cmd(cmd_args, interact=interact, **kwargs) coconut/command/command.py:160: in cmd self.exit_on_error() _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def exit_on_error(self): """Exit if exit_code is abnormal.""" if self.exit_code: if self.errmsg is not None: # show on stdout with error color code so that stdout # listeners see the error logger.show("Coconut exiting with error: " + self.errmsg, color=error_color_code) self.errmsg = None if self.using_jobs: kill_children() > sys.exit(self.exit_code) E SystemExit: 1 coconut/command/command.py:183: SystemExit ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestShell.test_import_hook... =============================================================================== ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ Traceback (most recent call last): File "", line 908, in _find_spec AttributeError: 'CoconutImporter' object has no attribute 'find_spec' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/coconut/command/command.py", line 407, in handling_exceptions yield File "/home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/coconut/command/command.py", line 159, in cmd self.use_args(parsed_args, interact, original_args=args) File "/home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/coconut/command/command.py", line 316, in use_args self.execute(self.parse_block(sys.stdin.read())) File "/usr/lib/python3.8/site-packages/_pytest/capture.py", line 192, in read raise OSError( OSError: pytest: reading from stdin while output is captured! Consider using `-s`. (you should report this at https://github.com/evhub/coconut/issues/new) ____________________________________________________________________________ TestShell.test_kernel_installation _____________________________________________________________________________ self = def test_kernel_installation(self): > call(["coconut", "--jupyter"], assert_output=kernel_installation_msg) coconut/tests/main_test.py:703: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['coconut', '--jupyter'], assert_output = ("Coconut: Successfully installed Jupyter kernels: 'coconut', 'coconut_py', 'coconut_py2', 'coconut_py3'",), check_mypy = False check_errors = True, stderr_first = False, expect_retcode = 0, convert_to_import = False, kwargs = {}, cmd = ['coconut', '--jupyter'], @py_assert0 = 'Traceback (most recent call last):' @py_assert2 = False @py_format6 = "Traceback in 'Traceback (most recent call last):'\n>assert 'Traceback (... call last):' not in 'Traceback (... call last):'\n~'Traceback (most recent call last):' is contained here:\n~ Traceback (most recent call last):" def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) if stderr_first: out = stderr + stdout else: out = stdout + stderr out = "".join(out) raw_lines = out.splitlines() lines = [] i = 0 while True: if i >= len(raw_lines): break line = raw_lines[i] # ignore https://bugs.python.org/issue39098 errors if sys.version_info < (3, 9) and line == "Error in atexit._run_exitfuncs:": while True: i += 1 if i >= len(raw_lines): break new_line = raw_lines[i] if not new_line.startswith(" ") and not any(test in new_line for test in ignore_atexit_errors_with): i -= 1 break continue # combine mypy error lines if any(infix in line for infix in mypy_err_infixes): # always add the next line, since it might be a continuation of the error message line += "\n" + raw_lines[i + 1] i += 1 # then keep adding more lines if they start with whitespace, since they might be the referenced code for j in range(i + 2, len(raw_lines)): next_line = raw_lines[j] if next_line.lstrip() == next_line: break line += "\n" + next_line i += 1 lines.append(line) i += 1 for line in lines: for errstr in always_err_strs: assert errstr not in line, "{errstr!r} in {line!r}".format(errstr=errstr, line=line) if check_errors: > assert "Traceback (most recent call last):" not in line, "Traceback in " + repr(line) E AssertionError: Traceback in 'Traceback (most recent call last):' E assert 'Traceback (... call last):' not in 'Traceback (... call last):' E 'Traceback (most recent call last):' is contained here: E Traceback (most recent call last): coconut/tests/main_test.py:271: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestShell.test_kernel_installation... =============================================================================== Coconut: Installing Jupyter kernels 'coconut_py', 'coconut_py2', 'coconut_py3'... Coconut: Successfully installed Jupyter kernels: 'coconut_py', 'coconut_py2', 'coconut_py3' ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > coconut --jupyter Traceback (most recent call last): File "/home/tkloczko/rpmbuild/BUILDROOT/python-coconut-2.2.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/coconut/util.py", line 292, in install_custom_kernel os.makedirs(kernel_dest) File "/usr/lib64/python3.8/os.py", line 223, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/usr/share/jupyter/kernels/coconut' CoconutWarning: Coconut Jupyter kernel installation failed due to above error (try again with 'sudo'). _________________________________________________________________________________ TestCompilation.test_and __________________________________________________________________________________ self = def test_and(self): > run(["--and"]) # src and dest built by comp coconut/tests/main_test.py:763: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ coconut/tests/main_test.py:550: in run run_extras(convert_to_import=convert_to_import) # **kwargs are for comp, not run coconut/tests/main_test.py:507: in run_extras call_python([os.path.join(dest, "extras.py")], assert_output=True, check_errors=False, stderr_first=True, **kwargs) coconut/tests/main_test.py:298: in call_python call([sys.executable] + args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['/usr/bin/python3', 'coconut/tests/dest/extras.py'], assert_output = ('',), check_mypy = False, check_errors = False, stderr_first = True, expect_retcode = 0 convert_to_import = False, kwargs = {}, cmd = ['/usr/bin/python3', 'coconut/tests/dest/extras.py'] def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: > assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) E AssertionError: Return code not as expected (1 != 0) in: ['/usr/bin/python3', 'coconut/tests/dest/extras.py'] E assert 1 == 0 coconut/tests/main_test.py:219: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestCompilation.test_and... =============================================================================== Compiling coconut/tests/src/cocotest/target_3/py3_test.coco ... Compiling coconut/tests/src/cocotest/target_3/py3_test.coco ... Compiled to coconut/tests/dest/additional_dest/cocotest/target_3/py3_test.py . Compiled to coconut/tests/dest/cocotest/py3_test.py . Compiling coconut/tests/src/cocotest/target_35/py35_test.coco ... Compiling coconut/tests/src/cocotest/target_35/py35_test.coco ... Compiled to coconut/tests/dest/additional_dest/cocotest/target_35/py35_test.py . Compiled to coconut/tests/dest/cocotest/py35_test.py . Compiling coconut/tests/src/cocotest/target_36/py36_test.coco ... Compiling coconut/tests/src/cocotest/target_36/py36_test.coco ... Compiled to coconut/tests/dest/cocotest/py36_test.py . Compiled to coconut/tests/dest/additional_dest/cocotest/target_36/py36_test.py . Compiling coconut/tests/src/cocotest/target_38/py38_test.coco ... Compiling coconut/tests/src/cocotest/target_38/py38_test.coco ... Compiled to coconut/tests/dest/cocotest/py38_test.py . Compiled to coconut/tests/dest/additional_dest/cocotest/target_38/py38_test.py . Compiling coconut/tests/src/cocotest/agnostic/__init__.coco ... Compiling coconut/tests/src/cocotest/agnostic/main.coco ... Compiling coconut/tests/src/cocotest/agnostic/primary.coco ... Compiling coconut/tests/src/cocotest/agnostic/specific.coco ... Compiling coconut/tests/src/cocotest/agnostic/suite.coco ... Compiling coconut/tests/src/cocotest/agnostic/tutorial.coco ... Compiling coconut/tests/src/cocotest/agnostic/util.coco ... Compiling coconut/tests/src/cocotest/agnostic/__init__.coco ... Compiling coconut/tests/src/cocotest/agnostic/main.coco ... Compiling coconut/tests/src/cocotest/agnostic/primary.coco ... Compiling coconut/tests/src/cocotest/agnostic/specific.coco ... Compiling coconut/tests/src/cocotest/agnostic/suite.coco ... Compiling coconut/tests/src/cocotest/agnostic/tutorial.coco ... Compiling coconut/tests/src/cocotest/agnostic/util.coco ... Compiled to coconut/tests/dest/cocotest/__init__.py . Compiled to coconut/tests/dest/additional_dest/cocotest/agnostic/__init__.py . Compiled to coconut/tests/dest/cocotest/main.py . Compiled to coconut/tests/dest/additional_dest/cocotest/agnostic/main.py . Compiled to coconut/tests/dest/cocotest/specific.py . Compiled to coconut/tests/dest/additional_dest/cocotest/agnostic/specific.py . Compiled to coconut/tests/dest/additional_dest/cocotest/agnostic/tutorial.py . Compiled to coconut/tests/dest/cocotest/tutorial.py . Compiled to coconut/tests/dest/cocotest/suite.py . Compiled to coconut/tests/dest/additional_dest/cocotest/agnostic/suite.py . Compiled to coconut/tests/dest/additional_dest/cocotest/agnostic/util.py . Compiled to coconut/tests/dest/cocotest/util.py . Compiled to coconut/tests/dest/cocotest/primary.py . Compiled to coconut/tests/dest/additional_dest/cocotest/agnostic/primary.py . Compiling coconut/tests/src/cocotest/target_sys/target_sys_test.coco ... Compiled to coconut/tests/dest/cocotest/target_sys_test.py . Compiling coconut/tests/src/cocotest/non_strict/non_strict_test.coco ... Compiled to coconut/tests/dest/cocotest/non_strict_test.py . Compiling coconut/tests/src/runner.coco ... Compiled to coconut/tests/dest/runner.py . ......... Compiling coconut/tests/src/extras.coco ... Compiled to coconut/tests/dest/extras.py . Expect Coconut errors below from running extras: (but make sure you get a after them) ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/cocotest/target_3 coconut/tests/dest/cocotest --and coconut/tests/src/cocotest/target_3 coconut/tests/dest/additional_dest/cocotest/target_3 --target 3 > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/cocotest/target_35 coconut/tests/dest/cocotest --and coconut/tests/src/cocotest/target_35 coconut/tests/dest/additional_dest/cocotest/target_35 --target 35 > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/cocotest/target_36 coconut/tests/dest/cocotest --and coconut/tests/src/cocotest/target_36 coconut/tests/dest/additional_dest/cocotest/target_36 --target 36 > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/cocotest/target_38 coconut/tests/dest/cocotest --and coconut/tests/src/cocotest/target_38 coconut/tests/dest/additional_dest/cocotest/target_38 --target 38 > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/cocotest/agnostic coconut/tests/dest/cocotest --and coconut/tests/src/cocotest/agnostic coconut/tests/dest/additional_dest/cocotest/agnostic in coconut/tests/src/cocotest/agnostic/main.coco: CoconutSyntaxWarning: [from *] import * is a Coconut Easter egg and should not be used in production code (line 15) import * # type: ignore in coconut/tests/src/cocotest/agnostic/main.coco: CoconutSyntaxWarning: [from *] import * is a Coconut Easter egg and should not be used in production code (line 19) from * import * # type: ignore in coconut/tests/src/cocotest/agnostic/main.coco: CoconutSyntaxWarning: [from *] import * is a Coconut Easter egg and should not be used in production code (line 15) import * # type: ignore in coconut/tests/src/cocotest/agnostic/main.coco: CoconutSyntaxWarning: [from *] import * is a Coconut Easter egg and should not be used in production code (line 19) from * import * # type: ignore > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/cocotest/target_sys coconut/tests/dest/cocotest --target sys > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/cocotest/non_strict coconut/tests/dest/cocotest in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: unnecessary from __future__ import (Coconut does these automatically) (line 1) from __future__ import division in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: found semicolon at end of line (line 11) assert (lambda x: x + 1)(2) == 3; ^ in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: found Python-2-style unicode string (all Coconut strings are unicode strings) (line 12) assert u"abc" == "a" ^ in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: unnecessary inheriting from object (Coconut does this automatically) (line 32) class A(object): # type: ignore in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: found deprecated isinstance-checking 'x is int' pattern; rewrite to use class patterns (try 'int(x)') or explicit isinstance-checking ('x `isinstance` int' should always work) (line 55) x is int = 10 in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: found deprecated equality-checking '=...' pattern; use '==...' instead (line 57) =x = 10 in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: found deprecated isinstance-checking 'x is int is int' pattern; rewrite to use class patterns (try 'int(x) and int(x)') or explicit isinstance-checking ('x `isinstance` int and x `isinstance` int' should always work) (line 58) x is int is int = 5 in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: found deprecated isinstance-checking 'x is int is str' pattern; rewrite to use class patterns (try 'int(x) and str(x)') or explicit isinstance-checking ('x `isinstance` int and x `isinstance` str' should always work) (line 61) x is int is str = x in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: found deprecated isinstance-checking 'x is int' pattern; rewrite to use class patterns (try 'int(x)') or explicit isinstance-checking ('x `isinstance` int' should always work) (line 66) match def kwd_only_x_is_int_def_0(*, x is int = 0) = x ^ in coconut/tests/src/cocotest/non_strict/non_strict_test.coco: CoconutSyntaxWarning: deprecated case keyword at top level in case ...: match ...: block (use Python 3.10 match ...: case ...: syntax instead) (line 74) case 1: > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/runner.coco coconut/tests/dest > /usr/bin/python3 coconut/tests/dest/runner.py > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/extras.coco coconut/tests/dest > /usr/bin/python3 coconut/tests/dest/extras.py Traceback (most recent call last): File "coconut/tests/dest/extras.py", line 2706, in main() File "coconut/tests/dest/extras.py", line 2699, in main assert test_extras() is True File "coconut/tests/dest/extras.py", line 2686, in test_extras assert test_numpy() is True File "coconut/tests/dest/extras.py", line 2622, in test_numpy import numpy as np ModuleNotFoundError: No module named 'numpy' ______________________________________________________________________________ TestCompilation.test_jobs_zero _______________________________________________________________________________ self = def test_jobs_zero(self): > run(["--jobs", "0"]) coconut/tests/main_test.py:788: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ coconut/tests/main_test.py:550: in run run_extras(convert_to_import=convert_to_import) # **kwargs are for comp, not run coconut/tests/main_test.py:507: in run_extras call_python([os.path.join(dest, "extras.py")], assert_output=True, check_errors=False, stderr_first=True, **kwargs) coconut/tests/main_test.py:298: in call_python call([sys.executable] + args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['/usr/bin/python3', 'coconut/tests/dest/extras.py'], assert_output = ('',), check_mypy = False, check_errors = False, stderr_first = True, expect_retcode = 0 convert_to_import = False, kwargs = {}, cmd = ['/usr/bin/python3', 'coconut/tests/dest/extras.py'] def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: > assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) E AssertionError: Return code not as expected (1 != 0) in: ['/usr/bin/python3', 'coconut/tests/dest/extras.py'] E assert 1 == 0 coconut/tests/main_test.py:219: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestCompilation.test_jobs_zero... =============================================================================== Compiling coconut/tests/src/cocotest/target_3/py3_test.coco ... Compiled to coconut/tests/dest/cocotest/py3_test.py . Compiling coconut/tests/src/cocotest/target_35/py35_test.coco ... Compiled to coconut/tests/dest/cocotest/py35_test.py . Compiling coconut/tests/src/cocotest/target_36/py36_test.coco ... Compiled to coconut/tests/dest/cocotest/py36_test.py . Compiling coconut/tests/src/cocotest/target_38/py38_test.coco ... Compiled to coconut/tests/dest/cocotest/py38_test.py . Compiling coconut/tests/src/cocotest/agnostic/__init__.coco ... Compiled to coconut/tests/dest/cocotest/__init__.py . Compiling coconut/tests/src/cocotest/agnostic/main.coco ... Compiled to coconut/tests/dest/cocotest/main.py . Compiling coconut/tests/src/cocotest/agnostic/primary.coco ... Compiled to coconut/tests/dest/cocotest/primary.py . Compiling coconut/tests/src/cocotest/agnostic/specific.coco ... Compiled to coconut/tests/dest/cocotest/specific.py . Compiling coconut/tests/src/cocotest/agnostic/suite.coco ... Compiled to coconut/tests/dest/cocotest/suite.py . Compiling coconut/tests/src/cocotest/agnostic/tutorial.coco ... Compiled to coconut/tests/dest/cocotest/tutorial.py . Compiling coconut/tests/src/cocotest/agnostic/util.coco ... Compiled to coconut/tests/dest/cocotest/util.py . Compiling coconut/tests/src/cocotest/target_sys/target_sys_test.coco ... Compiled to coconut/tests/dest/cocotest/target_sys_test.py . Compiling coconut/tests/src/cocotest/non_strict/non_strict_test.coco ... Compiled to coconut/tests/dest/cocotest/non_strict_test.py . Compiling coconut/tests/src/runner.coco ... Compiled to coconut/tests/dest/runner.py . ......... Compiling coconut/tests/src/extras.coco ... Compiled to coconut/tests/dest/extras.py . Expect Coconut errors below from running extras: (but make sure you get a after them) ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > /usr/bin/python3 -m coconut coconut/tests/src/cocotest/target_3 coconut/tests/dest/cocotest --target 3 --jobs 0 > /usr/bin/python3 -m coconut coconut/tests/src/cocotest/target_35 coconut/tests/dest/cocotest --target 35 --jobs 0 > /usr/bin/python3 -m coconut coconut/tests/src/cocotest/target_36 coconut/tests/dest/cocotest --target 36 --jobs 0 > /usr/bin/python3 -m coconut coconut/tests/src/cocotest/target_38 coconut/tests/dest/cocotest --target 38 --jobs 0 > /usr/bin/python3 -m coconut coconut/tests/src/cocotest/agnostic coconut/tests/dest/cocotest --jobs 0 CoconutSyntaxWarning: [from *] import * is a Coconut Easter egg and should not be used in production code (line 15) import * # type: ignore CoconutSyntaxWarning: [from *] import * is a Coconut Easter egg and should not be used in production code (line 19) from * import * # type: ignore > /usr/bin/python3 -m coconut coconut/tests/src/cocotest/target_sys coconut/tests/dest/cocotest --target sys --jobs 0 > /usr/bin/python3 -m coconut coconut/tests/src/cocotest/non_strict coconut/tests/dest/cocotest --jobs 0 CoconutSyntaxWarning: unnecessary from __future__ import (Coconut does these automatically) (line 1) from __future__ import division CoconutSyntaxWarning: found semicolon at end of line (line 11) assert (lambda x: x + 1)(2) == 3; ^ CoconutSyntaxWarning: found Python-2-style unicode string (all Coconut strings are unicode strings) (line 12) assert u"abc" == "a" ^ CoconutSyntaxWarning: unnecessary inheriting from object (Coconut does this automatically) (line 32) class A(object): # type: ignore CoconutSyntaxWarning: found deprecated isinstance-checking 'x is int' pattern; rewrite to use class patterns (try 'int(x)') or explicit isinstance-checking ('x `isinstance` int' should always work) (line 55) x is int = 10 CoconutSyntaxWarning: found deprecated equality-checking '=...' pattern; use '==...' instead (line 57) =x = 10 CoconutSyntaxWarning: found deprecated isinstance-checking 'x is int is int' pattern; rewrite to use class patterns (try 'int(x) and int(x)') or explicit isinstance-checking ('x `isinstance` int and x `isinstance` int' should always work) (line 58) x is int is int = 5 CoconutSyntaxWarning: found deprecated isinstance-checking 'x is int is str' pattern; rewrite to use class patterns (try 'int(x) and str(x)') or explicit isinstance-checking ('x `isinstance` int and x `isinstance` str' should always work) (line 61) x is int is str = x CoconutSyntaxWarning: found deprecated isinstance-checking 'x is int' pattern; rewrite to use class patterns (try 'int(x)') or explicit isinstance-checking ('x `isinstance` int' should always work) (line 66) match def kwd_only_x_is_int_def_0(*, x is int = 0) = x ^ CoconutSyntaxWarning: deprecated case keyword at top level in case ...: match ...: block (use Python 3.10 match ...: case ...: syntax instead) (line 74) case 1: > /usr/bin/python3 -m coconut coconut/tests/src/runner.coco coconut/tests/dest --jobs 0 > /usr/bin/python3 coconut/tests/dest/runner.py > /usr/bin/python3 -m coconut coconut/tests/src/extras.coco coconut/tests/dest --jobs 0 > /usr/bin/python3 coconut/tests/dest/extras.py Traceback (most recent call last): File "coconut/tests/dest/extras.py", line 2706, in main() File "coconut/tests/dest/extras.py", line 2699, in main assert test_extras() is True File "coconut/tests/dest/extras.py", line 2686, in test_extras assert test_numpy() is True File "coconut/tests/dest/extras.py", line 2622, in test_numpy import numpy as np ModuleNotFoundError: No module named 'numpy' _______________________________________________________________________________ TestCompilation.test_mypy_sys _______________________________________________________________________________ self = def test_mypy_sys(self): > run(["--mypy"] + mypy_args, agnostic_target="sys", expect_retcode=None, check_errors=False) # fails due to tutorial mypy errors coconut/tests/main_test.py:752: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ coconut/tests/main_test.py:523: in run comp_3(args, **kwargs) coconut/tests/main_test.py:471: in comp_3 comp(path="cocotest", folder="target_3", args=["--target", "3"] + args, **kwargs) coconut/tests/main_test.py:328: in comp call_coconut([source, compdest] + args, **kwargs) coconut/tests/main_test.py:310: in call_coconut call_python(["-m", "coconut"] + args, **kwargs) coconut/tests/main_test.py:298: in call_python call([sys.executable] + args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['/usr/bin/python3', '-m', 'coconut', '--jobs', 'sys', 'coconut/tests/src/cocotest/target_3', ...], assert_output = ('',), check_mypy = True, check_errors = False stderr_first = False, expect_retcode = None, convert_to_import = False, kwargs = {}, cmd = ['/usr/bin/python3', '-m', 'coconut', '--jobs', 'sys', 'coconut/tests/src/cocotest/target_3', ...] @py_assert0 = 'error:', @py_assert2 = False @py_format6 = 'MyPy error in \'coconut/tests/dest/cocotest/py3_test.py:43: error: Name "sys" is used before\\ndefinition [used-befo...ror: Name "sys" is used before\n~? ++++++\n~ definition [used-before-def]\n~ ^~~' def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) if stderr_first: out = stderr + stdout else: out = stdout + stderr out = "".join(out) raw_lines = out.splitlines() lines = [] i = 0 while True: if i >= len(raw_lines): break line = raw_lines[i] # ignore https://bugs.python.org/issue39098 errors if sys.version_info < (3, 9) and line == "Error in atexit._run_exitfuncs:": while True: i += 1 if i >= len(raw_lines): break new_line = raw_lines[i] if not new_line.startswith(" ") and not any(test in new_line for test in ignore_atexit_errors_with): i -= 1 break continue # combine mypy error lines if any(infix in line for infix in mypy_err_infixes): # always add the next line, since it might be a continuation of the error message line += "\n" + raw_lines[i + 1] i += 1 # then keep adding more lines if they start with whitespace, since they might be the referenced code for j in range(i + 2, len(raw_lines)): next_line = raw_lines[j] if next_line.lstrip() == next_line: break line += "\n" + next_line i += 1 lines.append(line) i += 1 for line in lines: for errstr in always_err_strs: assert errstr not in line, "{errstr!r} in {line!r}".format(errstr=errstr, line=line) if check_errors: assert "Traceback (most recent call last):" not in line, "Traceback in " + repr(line) assert "Exception" not in line, "Exception in " + repr(line) assert "Error" not in line, "Error in " + repr(line) if check_mypy and all(test not in line for test in ignore_mypy_errs_with): > assert "error:" not in line, "MyPy error in " + repr(line) E AssertionError: MyPy error in 'coconut/tests/dest/cocotest/py3_test.py:43: error: Name "sys" is used before\ndefinition [used-before-def]\n ^~~' E assert 'error:' not in 'coconut/tes... ^~~' E 'error:' is contained here: E st.py:43: error: Name "sys" is used before E ? ++++++ E definition [used-before-def] E ^~~ coconut/tests/main_test.py:275: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestCompilation.test_mypy_sys... =============================================================================== Compiling coconut/tests/src/cocotest/target_3/py3_test.coco ... Compiled to coconut/tests/dest/cocotest/py3_test.py . Coconut exiting with error: MyPy error ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > /usr/bin/python3 -m coconut --jobs sys coconut/tests/src/cocotest/target_3 coconut/tests/dest/cocotest --target 3 --mypy --follow-imports silent --ignore-missing-imports --allow-redefinition coconut/tests/dest/cocotest/py3_test.py:43: error: Name "sys" is used before definition [used-before-def] _coconut_sys_0 = sys #1 (line in Coconut source) ^~~ Found 1 error in 1 file (checked 1 source file) __________________________________________________________________________________ TestExternal.test_bbopt __________________________________________________________________________________ self = def test_bbopt(self): with using_path(bbopt): comp_bbopt() if not PYPY and (PY2 or PY36) and not PY39: > install_bbopt() coconut/tests/main_test.py:830: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ coconut/tests/main_test.py:627: in install_bbopt call(["pip", "install", "-Ue", bbopt]) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['pip', 'install', '-Ue', './bbopt'], assert_output = ('',), check_mypy = False, check_errors = True, stderr_first = False, expect_retcode = 0, convert_to_import = False kwargs = {}, cmd = ['pip', 'install', '-Ue', './bbopt'] def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: > assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) E AssertionError: Return code not as expected (1 != 0) in: ['pip', 'install', '-Ue', './bbopt'] E assert 1 == 0 coconut/tests/main_test.py:219: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestExternal.test_bbopt... =============================================================================== Compiling bbopt/setup.coco ... Compiled to bbopt/setup.py . Compiling bbopt/bbopt-source/__init__.coco ... Compiling bbopt/bbopt-source/__main__.coco ... Compiling bbopt/bbopt-source/benchmarking.coco ... Compiling bbopt/bbopt-source/cli.coco ... Compiling bbopt/bbopt-source/constants.coco ... Compiling bbopt/bbopt-source/optimizer.coco ... Compiling bbopt/bbopt-source/params.coco ... Compiling bbopt/bbopt-source/registry.coco ... Compiling bbopt/bbopt-source/util.coco ... Compiling bbopt/bbopt-source/backends/__init__.coco ... Compiling bbopt/bbopt-source/backends/bandit.coco ... Compiling bbopt/bbopt-source/backends/bask.coco ... Compiling bbopt/bbopt-source/backends/hyperopt.coco ... Compiling bbopt/bbopt-source/backends/mixture.coco ... Compiling bbopt/bbopt-source/backends/openai.coco ... Compiling bbopt/bbopt-source/backends/pysot.coco ... Compiling bbopt/bbopt-source/backends/random.coco ... Compiling bbopt/bbopt-source/backends/serving.coco ... Compiling bbopt/bbopt-source/backends/skopt.coco ... Compiling bbopt/bbopt-source/backends/util.coco ... Compiling bbopt/bbopt-source/tests/__init__.coco ... Compiling bbopt/bbopt-source/tests/constants_test.coco ... Compiling bbopt/bbopt-source/tests/examples_test.coco ... Compiled to bbopt/bbopt/__init__.py . Compiled to bbopt/bbopt/tests/__init__.py . Compiled to bbopt/bbopt/__main__.py . Compiled to bbopt/bbopt/backends/__init__.py . Compiled to bbopt/bbopt/constants.py . Compiled to bbopt/bbopt/backends/bask.py . Compiled to bbopt/bbopt/backends/random.py . Compiled to bbopt/bbopt/tests/constants_test.py . Compiled to bbopt/bbopt/backends/serving.py . Compiled to bbopt/bbopt/cli.py . Compiled to bbopt/bbopt/backends/bandit.py . Compiled to bbopt/bbopt/backends/mixture.py . Compiled to bbopt/bbopt/registry.py . Compiled to bbopt/bbopt/backends/hyperopt.py . Compiled to bbopt/bbopt/benchmarking.py . Compiled to bbopt/bbopt/backends/skopt.py . Compiled to bbopt/bbopt/backends/pysot.py . Compiled to bbopt/bbopt/params.py . Compiled to bbopt/bbopt/util.py . Compiled to bbopt/bbopt/backends/openai.py . Compiled to bbopt/bbopt/tests/examples_test.py . Compiled to bbopt/bbopt/backends/util.py . Compiled to bbopt/bbopt/optimizer.py . Defaulting to user installation because normal site-packages is not writeable Obtaining file:///home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/bbopt Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: numpy>=1.15.1 in /usr/lib64/python3.8/site-packages (from bbopt==1.4.2) (1.24.2) Collecting matplotlib>=2.2.5 Downloading matplotlib-3.7.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (9.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.2/9.2 MB 1.7 MB/s eta 0:00:00 Collecting pysot>=0.3.3 Downloading pySOT-0.3.3-py2.py3-none-any.whl (72 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.7/72.7 kB 5.7 MB/s eta 0:00:00 Collecting portalocker>=2.2.1 Downloading portalocker-2.7.0-py2.py3-none-any.whl (15 kB) Collecting hyperopt>=0.2.5 Downloading hyperopt-0.2.7-py2.py3-none-any.whl (1.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 7.1 MB/s eta 0:00:00 Collecting scikit-optimize>=0.8.1 Downloading scikit_optimize-0.9.0-py2.py3-none-any.whl (100 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.3/100.3 kB 6.2 MB/s eta 0:00:00 Collecting openai>=0.6.4 Downloading openai-0.27.0-py3-none-any.whl (70 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.1/70.1 kB 5.2 MB/s eta 0:00:00 Collecting scikit-learn>=0.23.2 Downloading scikit_learn-1.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.8/9.8 MB 7.2 MB/s eta 0:00:00 Collecting networkx>=2.2 Downloading networkx-3.0-py3-none-any.whl (2.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 6.8 MB/s eta 0:00:00 Collecting pymongo>=3.9 Downloading pymongo-4.3.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (501 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 501.4/501.4 kB 7.7 MB/s eta 0:00:00 Collecting pyspark>=2.4 Downloading pyspark-3.3.2.tar.gz (281.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 281.4/281.4 MB 3.8 MB/s eta 0:00:00 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting bask>=0.10.6 Downloading bask-0.10.8-py3-none-any.whl (32 kB) Collecting scikit-optimize>=0.8.1 Downloading scikit_optimize-0.8.1-py2.py3-none-any.whl (101 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 101.2/101.2 kB 2.1 MB/s eta 0:00:00 Requirement already satisfied: scipy>=1.2 in /usr/lib64/python3.8/site-packages (from bask>=0.10.6->bbopt==1.4.2) (1.8.1) Collecting emcee>=3.0.2 Downloading emcee-3.1.4-py2.py3-none-any.whl (46 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.2/46.2 kB 825.6 kB/s eta 0:00:00 Collecting tqdm>=4.48.2 Downloading tqdm-4.65.0-py3-none-any.whl (77 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.1/77.1 kB 1.5 MB/s eta 0:00:00 Collecting arviz>=0.10.0 Downloading arviz-0.15.0-py3-none-any.whl (1.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 6.8 MB/s eta 0:00:00 Collecting scikit-learn>=0.23.2 Downloading scikit_learn-0.23.2-cp38-cp38-manylinux1_x86_64.whl (6.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 7.5 MB/s eta 0:00:00 Collecting future Downloading future-0.18.3.tar.gz (840 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 840.9/840.9 kB 6.2 MB/s eta 0:00:00 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: six in /usr/lib/python3.8/site-packages (from hyperopt>=0.2.5->bbopt==1.4.2) (1.16.0) Collecting cloudpickle Downloading cloudpickle-2.2.1-py3-none-any.whl (25 kB) Collecting py4j Downloading py4j-0.10.9.7-py2.py3-none-any.whl (200 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 200.5/200.5 kB 3.0 MB/s eta 0:00:00 Collecting importlib-resources>=3.2.0 Using cached importlib_resources-5.12.0-py3-none-any.whl (36 kB) Requirement already satisfied: packaging>=20.0 in /usr/lib/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (23.0) Collecting pyparsing>=2.3.1 Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.3/98.3 kB 2.0 MB/s eta 0:00:00 Requirement already satisfied: python-dateutil>=2.7 in /usr/lib/python3.8/site-packages (from matplotlib>=2.2.5->bbopt==1.4.2) (2.8.2) Collecting fonttools>=4.22.0 Downloading fonttools-4.38.0-py3-none-any.whl (965 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 965.4/965.4 kB 6.1 MB/s eta 0:00:00 Collecting cycler>=0.10 Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB) Collecting contourpy>=1.0.1 Downloading contourpy-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (300 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 300.0/300.0 kB 3.6 MB/s eta 0:00:00 Collecting pillow>=6.2.0 Using cached Pillow-9.4.0-cp38-cp38-manylinux_2_28_x86_64.whl (3.4 MB) Collecting kiwisolver>=1.0.1 Downloading kiwisolver-1.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 6.5 MB/s eta 0:00:00 Requirement already satisfied: requests>=2.20 in /usr/lib/python3.8/site-packages (from openai>=0.6.4->bbopt==1.4.2) (2.28.2) Collecting aiohttp Downloading aiohttp-3.8.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 6.4 MB/s eta 0:00:00 Collecting dnspython<3.0.0,>=1.16.0 Downloading dnspython-2.3.0-py3-none-any.whl (283 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 283.7/283.7 kB 1.0 MB/s eta 0:00:00 Collecting pyDOE2 Downloading pyDOE2-1.3.0.tar.gz (19 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting POAP>=0.1.25 Downloading POAP-0.1.26-py2.py3-none-any.whl (36 kB) Collecting dill Using cached dill-0.3.6-py3-none-any.whl (110 kB) Requirement already satisfied: pytest in /usr/lib/python3.8/site-packages (from pysot>=0.3.3->bbopt==1.4.2) (7.2.2) Collecting py4j Downloading py4j-0.10.9.5-py2.py3-none-any.whl (199 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.7/199.7 kB 7.2 MB/s eta 0:00:00 Collecting threadpoolctl>=2.0.0 Downloading threadpoolctl-3.1.0-py3-none-any.whl (14 kB) Collecting joblib>=0.11 Downloading joblib-1.2.0-py3-none-any.whl (297 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 298.0/298.0 kB 7.6 MB/s eta 0:00:00 Collecting pyaml>=16.9 Downloading pyaml-21.10.1-py2.py3-none-any.whl (24 kB) Requirement already satisfied: setuptools>=60.0.0 in /usr/lib/python3.8/site-packages (from arviz>=0.10.0->bask>=0.10.6->bbopt==1.4.2) (65.6.3) Collecting xarray>=0.21.0 Downloading xarray-2023.1.0-py3-none-any.whl (973 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 973.1/973.1 kB 7.7 MB/s eta 0:00:00 Collecting xarray-einstats>=0.3 Downloading xarray_einstats-0.5.1-py3-none-any.whl (28 kB) Requirement already satisfied: typing-extensions>=4.1.0 in /usr/lib/python3.8/site-packages (from arviz>=0.10.0->bask>=0.10.6->bbopt==1.4.2) (4.4.0) Collecting pandas>=1.4.0 Downloading pandas-1.5.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.2/12.2 MB 7.7 MB/s eta 0:00:00 Collecting h5netcdf>=1.0.2 Downloading h5netcdf-1.1.0-py2.py3-none-any.whl (26 kB) Requirement already satisfied: zipp>=3.1.0 in /usr/lib/python3.8/site-packages (from importlib-resources>=3.2.0->matplotlib>=2.2.5->bbopt==1.4.2) (3.15.0) Collecting PyYAML Using cached PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (701 kB) Requirement already satisfied: charset-normalizer>=2 in /usr/lib/python3.8/site-packages (from requests>=2.20->openai>=0.6.4->bbopt==1.4.2) (3.0.1) Requirement already satisfied: idna>=2.5 in /usr/lib/python3.8/site-packages (from requests>=2.20->openai>=0.6.4->bbopt==1.4.2) (3.4) Requirement already satisfied: urllib3>=1.21.1 in /usr/lib/python3.8/site-packages (from requests>=2.20->openai>=0.6.4->bbopt==1.4.2) (1.26.12) Collecting multidict<7.0,>=4.5 Downloading multidict-6.0.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.3/121.3 kB 7.4 MB/s eta 0:00:00 Collecting yarl<2.0,>=1.0 Downloading yarl-1.8.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (262 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 262.1/262.1 kB 7.9 MB/s eta 0:00:00 Collecting aiosignal>=1.1.2 Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB) Collecting async-timeout<5.0,>=4.0.0a3 Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB) Collecting frozenlist>=1.1.1 Downloading frozenlist-1.3.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (161 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 161.3/161.3 kB 7.5 MB/s eta 0:00:00 Requirement already satisfied: attrs>=17.3.0 in /usr/lib/python3.8/site-packages (from aiohttp->openai>=0.6.4->bbopt==1.4.2) (22.2.0) Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /usr/lib/python3.8/site-packages (from pytest->pysot>=0.3.3->bbopt==1.4.2) (1.0.0) Requirement already satisfied: iniconfig in /usr/lib/python3.8/site-packages (from pytest->pysot>=0.3.3->bbopt==1.4.2) (2.0.0) Requirement already satisfied: pluggy<2.0,>=0.12 in /usr/lib/python3.8/site-packages (from pytest->pysot>=0.3.3->bbopt==1.4.2) (1.0.0) Requirement already satisfied: tomli>=1.0.0 in /usr/lib/python3.8/site-packages (from pytest->pysot>=0.3.3->bbopt==1.4.2) (2.0.1) Collecting h5py Downloading h5py-3.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.7/4.7 MB 7.9 MB/s eta 0:00:00 Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3.8/site-packages (from pandas>=1.4.0->arviz>=0.10.0->bask>=0.10.6->bbopt==1.4.2) (2022.4) Building wheels for collected packages: pyspark, future, pyDOE2 Building wheel for pyspark (setup.py): started Building wheel for pyspark (setup.py): finished with status 'done' Created wheel for pyspark: filename=pyspark-3.3.2-py2.py3-none-any.whl size=281902556 sha256=9d309529df7f49cf6112d23221d05b718a0fdca26023125cd88e3319c05c2828 Stored in directory: /home/tkloczko/.cache/pip/wheels/05/fa/3e/2e840e7c1bb33325381b6b3b0e55a1c9c3e0485d2ca469229d Building wheel for future (setup.py): started Building wheel for future (setup.py): finished with status 'done' Created wheel for future: filename=future-0.18.3-py3-none-any.whl size=492868 sha256=b210876ac0f1a6e6e7a822110374a9a387c4590431c6aa9372ab24b5b48e4f7f Stored in directory: /home/tkloczko/.cache/pip/wheels/a6/db/41/71a0e5d071a14e716cc11bb021a9caa8f76ec337eca071487e Building wheel for pyDOE2 (setup.py): started Building wheel for pyDOE2 (setup.py): finished with status 'done' Created wheel for pyDOE2: filename=pyDOE2-1.3.0-py3-none-any.whl size=25490 sha256=c3623414c308bb9e527a3b2ad7b26372271709fce2c79db211ba1ad25196f370 Stored in directory: /home/tkloczko/.cache/pip/wheels/f8/bf/ae/1d199b31d764fe638f72d5d69d16206b1598503ab16384662c Successfully built pyspark future pyDOE2 Installing collected packages: py4j, POAP, tqdm, threadpoolctl, PyYAML, pyspark, pyparsing, portalocker, pillow, networkx, multidict, kiwisolver, joblib, importlib-resources, h5py, future, frozenlist, fonttools, emcee, dnspython, dill, cycler, contourpy, cloudpickle, async-timeout, yarl, scikit-learn, pymongo, pyDOE2, pyaml, pandas, matplotlib, hyperopt, h5netcdf, aiosignal, xarray, scikit-optimize, pysot, aiohttp, xarray-einstats, openai, arviz, bask, bbopt ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > git clone https://github.com/evhub/bbopt.git Cloning into 'bbopt'... > /usr/bin/python3 -m coconut --jobs sys ./bbopt/setup.coco --force > /usr/bin/python3 -m coconut --jobs sys ./bbopt/bbopt-source ./bbopt/bbopt --force in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'RandomBackend' (add '# NOQA' to suppress) (line 12) from bbopt.backends.random import RandomBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'MixtureBackend' (add '# NOQA' to suppress) (line 13) from bbopt.backends.mixture import MixtureBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'BanditBackend' (add '# NOQA' to suppress) (line 14) from bbopt.backends.bandit import BanditBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'SkoptBackend' (add '# NOQA' to suppress) (line 16) from bbopt.backends.skopt import SkoptBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'HyperoptBackend' (add '# NOQA' to suppress) (line 21) from bbopt.backends.hyperopt import HyperoptBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'PySOTBackend' (add '# NOQA' to suppress) (line 27) from bbopt.backends.pysot import PySOTBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'BaskBackend' (add '# NOQA' to suppress) (line 33) from bbopt.backends.bask import BaskBackend in bbopt/bbopt-source/backends/__init__.coco: CoconutSyntaxWarning: found unused import 'OpenAIBackend' (add '# NOQA' to suppress) (line 39) from bbopt.backends.openai import OpenAIBackend in bbopt/bbopt-source/backends/pysot.coco: CoconutSyntaxWarning: assignment shadows builtin 'eval' (use explicit '\eval' syntax when purposefully assigning to builtin names) (line 100) def eval(self, xs): ^ > pip install -Ue ./bbopt ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/tkloczko/.local/lib/python3.8/site-packages' Check the permissions. _________________________________________________________________________________ TestExternal.test_prelude _________________________________________________________________________________ self = def test_prelude(self): with using_path(prelude): > comp_prelude() coconut/tests/main_test.py:816: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ coconut/tests/main_test.py:609: in comp_prelude call_coconut([os.path.join(prelude, "prelude-source"), os.path.join(prelude, "prelude"), "--force"] + args, **kwargs) coconut/tests/main_test.py:310: in call_coconut call_python(["-m", "coconut"] + args, **kwargs) coconut/tests/main_test.py:298: in call_python call([sys.executable] + args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['/usr/bin/python3', '-m', 'coconut', '--jobs', 'sys', './coconut-prelude/prelude-source', ...], assert_output = ('',), check_mypy = True, check_errors = False stderr_first = False, expect_retcode = 0, convert_to_import = False, kwargs = {}, cmd = ['/usr/bin/python3', '-m', 'coconut', '--jobs', 'sys', './coconut-prelude/prelude-source', ...] def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: > assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) E AssertionError: Return code not as expected (1 != 0) in: ['/usr/bin/python3', '-m', 'coconut', '--jobs', 'sys', './coconut-prelude/prelude-source', './coconut-prelude/prelude', '--force', '--target', '3.5', '--mypy'] E assert 1 == 0 coconut/tests/main_test.py:219: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestExternal.test_prelude... =============================================================================== Compiling coconut-prelude/setup.coco ... Compiled to coconut-prelude/setup.py . Compiling coconut-prelude/prelude-source/__init__.coco ... Compiling coconut-prelude/prelude-source/main.coco ... Compiling coconut-prelude/prelude-source/main_test.coco ... Compiling coconut-prelude/prelude-source/typevars.coco ... Compiling coconut-prelude/prelude-source/util.coco ... Compiling coconut-prelude/prelude-source/util_test.coco ... Compiled to coconut-prelude/prelude/__init__.py . Compiled to coconut-prelude/prelude/typevars.py . Compiled to coconut-prelude/prelude/util_test.py . Compiled to coconut-prelude/prelude/util.py . Compiled to coconut-prelude/prelude/main_test.py . Compiled to coconut-prelude/prelude/main.py . Coconut exiting with error: MyPy error ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > git clone https://github.com/evhub/coconut-prelude Cloning into 'coconut-prelude'... > /usr/bin/python3 -m coconut --jobs sys ./coconut-prelude/setup.coco --force --target 3.5 --mypy > /usr/bin/python3 -m coconut --jobs sys ./coconut-prelude/prelude-source ./coconut-prelude/prelude --force --target 3.5 --mypy coconut-prelude/prelude/main.py:78: error: Name "fmap" is used before definition [used-before-def] _fmap = fmap # type: _coconut.typing.Callable[..., T.Any] #32 (line ... ^~~~ coconut-prelude/prelude/main.py:118: error: Name "cycle" is used before definition [used-before-def] _cycle = cycle # type: _coconut.typing.Callable[..., T.Any] #42 (lin... ^~~~~ coconut-prelude/prelude/util_test.py:61: note: __match_args__ must be a tuple containing string literals for checking of match statements to work coconut-prelude/prelude/main_test.py:374: note: __match_args__ must be a tuple containing string literals for checking of match statements to work Found 2 errors in 1 file (checked 6 source files) ________________________________________________________________________________ TestExternal.test_pyprover _________________________________________________________________________________ self = def test_pyprover(self): with using_path(pyprover): comp_pyprover() > run_pyprover() coconut/tests/main_test.py:811: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ coconut/tests/main_test.py:598: in run_pyprover call(["pip", "install", "-e", pyprover]) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ raw_cmd = ['pip', 'install', '-e', './pyprover'], assert_output = ('',), check_mypy = False, check_errors = True, stderr_first = False, expect_retcode = 0, convert_to_import = False kwargs = {}, cmd = ['pip', 'install', '-e', './pyprover'] def call(raw_cmd, assert_output=False, check_mypy=False, check_errors=True, stderr_first=False, expect_retcode=0, convert_to_import=False, **kwargs): """Execute a shell command and assert that no errors were encountered.""" if isinstance(raw_cmd, str): cmd = raw_cmd.split() else: cmd = raw_cmd print() logger.log_cmd(cmd) if assert_output is False: assert_output = ("",) elif assert_output is True: assert_output = ("",) elif isinstance(assert_output, str): if "\n" not in assert_output: assert_output = (assert_output,) else: assert_output = tuple(x if x is not True else "" for x in assert_output) if convert_to_import is None: convert_to_import = ( cmd[0] == sys.executable and cmd[1] != "-c" and cmd[1:3] != ["-m", "coconut"] ) if convert_to_import: assert cmd[0] == sys.executable if cmd[1] == "-m": module_name = cmd[2] extra_argv = cmd[3:] stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: module_path = cmd[1] extra_argv = cmd[2:] module_dir = os.path.dirname(module_path) module_name = os.path.splitext(os.path.basename(module_path))[0] if os.path.isdir(module_path): module_name += ".__main__" with using_sys_path(module_dir): stdout, stderr, retcode = call_with_import(module_name, extra_argv) else: stdout, stderr, retcode = call_output(raw_cmd, **kwargs) if expect_retcode is not None: > assert retcode == expect_retcode, "Return code not as expected ({retcode} != {expect_retcode}) in: {cmd!r}".format( retcode=retcode, expect_retcode=expect_retcode, cmd=raw_cmd, ) E AssertionError: Return code not as expected (1 != 0) in: ['pip', 'install', '-e', './pyprover'] E assert 1 == 0 coconut/tests/main_test.py:219: AssertionError ----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------ =============================================================================== running TestExternal.test_pyprover... =============================================================================== Compiling pyprover/setup.coco ... Compiled to pyprover/setup.py . Compiling pyprover/pyprover-source/__init__.coco ... Compiling pyprover/pyprover-source/atoms.coco ... Compiling pyprover/pyprover-source/constants.coco ... Compiling pyprover/pyprover-source/logic.coco ... Compiling pyprover/pyprover-source/parser.coco ... Compiling pyprover/pyprover-source/tests.coco ... Compiling pyprover/pyprover-source/tools.coco ... Compiling pyprover/pyprover-source/util.coco ... Compiled to pyprover/pyprover/__init__.py . Compiled to pyprover/pyprover/constants.py . Compiled to pyprover/pyprover/tools.py . Compiled to pyprover/pyprover/util.py . Compiled to pyprover/pyprover/atoms.py . Compiled to pyprover/pyprover/parser.py . Compiled to pyprover/pyprover/tests.py . Compiled to pyprover/pyprover/logic.py . Defaulting to user installation because normal site-packages is not writeable Obtaining file:///home/tkloczko/rpmbuild/BUILD/coconut-2.2.0/pyprover Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting pyparsing Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB) Installing collected packages: pyparsing, pyprover ----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------ > git clone https://github.com/evhub/pyprover.git Cloning into 'pyprover'... > /usr/bin/python3 -m coconut --jobs sys ./pyprover/setup.coco --force > /usr/bin/python3 -m coconut --jobs sys ./pyprover/pyprover-source ./pyprover/pyprover --force in pyprover/pyprover-source/util.coco: CoconutSyntaxWarning: found deprecated equality-checking '=...' pattern; use '==...' instead (line 92) match {=var: prev_sub, **_} in subs: ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'call' (use explicit '\call' syntax when purposefully assigning to builtin names) (line 56) def call(action, item): ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'const' (use explicit '\const' syntax when purposefully assigning to builtin names) (line 77) match def exists_handle(const, expr) = Exists(const, expr) ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'const' (use explicit '\const' syntax when purposefully assigning to builtin names) (line 80) match def exists_handle(const, prop, expr) = ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'const' (use explicit '\const' syntax when purposefully assigning to builtin names) (line 83) match def forall_handle(const, expr) = ForAll(const, expr) ^ in pyprover/pyprover-source/parser.coco: CoconutSyntaxWarning: assignment shadows builtin 'const' (use explicit '\const' syntax when purposefully assigning to builtin names) (line 86) match def forall_handle(const, prop, expr) = ^ in pyprover/pyprover-source/logic.coco: CoconutSyntaxWarning: found deprecated equality-checking '=...' pattern; use '==...' instead (line 192) match {=self: sub, **_} in subs: ^ in pyprover/pyprover-source/logic.coco: CoconutSyntaxWarning: found deprecated equality-checking '=...' pattern; use '==...' instead (line 258) match {=self.proposition(): sub, **_} in subs: ^ > pip install -e ./pyprover ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/tkloczko/.local/lib/python3.8/site-packages' Check the permissions. ================================================================================== short test summary info ================================================================================== FAILED coconut/tests/constants_test.py::TestConstants::test_imports - AssertionError: Failed to import dbm.gnu FAILED coconut/tests/main_test.py::TestShell::test_exit_jupyter - pexpect.exceptions.EOF: End Of File (EOF). Exception style platform. FAILED coconut/tests/main_test.py::TestShell::test_import_hook - SystemExit: 1 FAILED coconut/tests/main_test.py::TestShell::test_kernel_installation - AssertionError: Traceback in 'Traceback (most recent call last):' FAILED coconut/tests/main_test.py::TestCompilation::test_and - AssertionError: Return code not as expected (1 != 0) in: ['/usr/bin/python3', 'coconut/tests/dest/extras.py'] FAILED coconut/tests/main_test.py::TestCompilation::test_jobs_zero - AssertionError: Return code not as expected (1 != 0) in: ['/usr/bin/python3', 'coconut/tests/dest/extras.py'] FAILED coconut/tests/main_test.py::TestCompilation::test_mypy_sys - AssertionError: MyPy error in 'coconut/tests/dest/cocotest/py3_test.py:43: error: Name "sys" is used before\ndefinition [used-before-def]\n ^~~' FAILED coconut/tests/main_test.py::TestExternal::test_bbopt - AssertionError: Return code not as expected (1 != 0) in: ['pip', 'install', '-Ue', './bbopt'] FAILED coconut/tests/main_test.py::TestExternal::test_prelude - AssertionError: Return code not as expected (1 != 0) in: ['/usr/bin/python3', '-m', 'coconut', '--jobs', 'sys', './coconut-prelude/prelude-source', './coconut-prelude/prelude', '--forc... FAILED coconut/tests/main_test.py::TestExternal::test_pyprover - AssertionError: Return code not as expected (1 != 0) in: ['pip', 'install', '-e', './pyprover'] ======================================================================== 10 failed, 28 passed in 2191.19s (0:36:31) ========================================================================= ```