evhub / coconut

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

3.0.3: pyetst is failing with 2 errors #780

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-3.0.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-coconut-3.0.3-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.17, pytest-7.4.0, pluggy-1.2.0 rootdir: /home/tkloczko/rpmbuild/BUILD/coconut-3.0.3 plugins: remotedata-0.4.0 collected 0 items / 2 errors ==================================== ERRORS ==================================== _______________ ERROR collecting coconut/tests/constants_test.py _______________ /usr/lib/python3.8/site-packages/_pytest/runner.py:341: in from_call result: Optional[TResult] = func() /usr/lib/python3.8/site-packages/_pytest/runner.py:372: in call = CallInfo.from_call(lambda: list(collector.collect()), "collect") /usr/lib/python3.8/site-packages/_pytest/python.py:536: in collect self._inject_setup_module_fixture() /usr/lib/python3.8/site-packages/_pytest/python.py:550: in _inject_setup_module_fixture self.obj, ("setUpModule", "setup_module") /usr/lib/python3.8/site-packages/_pytest/python.py:315: in obj self._obj = obj = self._getobj() /usr/lib/python3.8/site-packages/_pytest/python.py:533: in _getobj return self._importtestmodule() /usr/lib/python3.8/site-packages/_pytest/python.py:622: in _importtestmodule mod = import_path(self.path, mode=importmode, root=self.config.rootpath) /usr/lib/python3.8/site-packages/_pytest/pathlib.py:565: in import_path importlib.import_module(module_name) /usr/lib64/python3.8/importlib/__init__.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) :1014: in _gcd_import ??? :991: in _find_and_load ??? :961: in _find_and_load_unlocked ??? :219: in _call_with_frames_removed ??? :1014: in _gcd_import ??? :991: in _find_and_load ??? :975: in _find_and_load_unlocked ??? :671: in _load_unlocked ??? :843: in exec_module ??? :219: in _call_with_frames_removed ??? coconut/tests/__init__.py:20: in from coconut.tests.main_test import * # NOQA :991: in _find_and_load ??? :975: in _find_and_load_unlocked ??? :671: in _load_unlocked ??? /usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:178: in exec_module exec(co, module.__dict__) coconut/tests/main_test.py:37: in from coconut.terminal import ( coconut/terminal.py:34: in from coconut._pyparsing import ( coconut/_pyparsing.py:62: in import cPyparsing as _pyparsing cPyparsing.pyx:1327: in init cPyparsing ??? E AttributeError: 'builtin_function_or_method' object has no attribute 'inspect_tracebacks' _________________ ERROR collecting coconut/tests/main_test.py __________________ /usr/lib/python3.8/site-packages/_pytest/runner.py:341: in from_call result: Optional[TResult] = func() /usr/lib/python3.8/site-packages/_pytest/runner.py:372: in call = CallInfo.from_call(lambda: list(collector.collect()), "collect") /usr/lib/python3.8/site-packages/_pytest/python.py:536: in collect self._inject_setup_module_fixture() /usr/lib/python3.8/site-packages/_pytest/python.py:550: in _inject_setup_module_fixture self.obj, ("setUpModule", "setup_module") /usr/lib/python3.8/site-packages/_pytest/python.py:315: in obj self._obj = obj = self._getobj() /usr/lib/python3.8/site-packages/_pytest/python.py:533: in _getobj return self._importtestmodule() /usr/lib/python3.8/site-packages/_pytest/python.py:622: in _importtestmodule mod = import_path(self.path, mode=importmode, root=self.config.rootpath) /usr/lib/python3.8/site-packages/_pytest/pathlib.py:565: in import_path importlib.import_module(module_name) /usr/lib64/python3.8/importlib/__init__.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) :1014: in _gcd_import ??? :991: in _find_and_load ??? :961: in _find_and_load_unlocked ??? :219: in _call_with_frames_removed ??? :1014: in _gcd_import ??? :991: in _find_and_load ??? :975: in _find_and_load_unlocked ??? :671: in _load_unlocked ??? :843: in exec_module ??? :219: in _call_with_frames_removed ??? coconut/tests/__init__.py:20: in from coconut.tests.main_test import * # NOQA :991: in _find_and_load ??? :975: in _find_and_load_unlocked ??? :671: in _load_unlocked ??? /usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:178: in exec_module exec(co, module.__dict__) coconut/tests/main_test.py:37: in from coconut.terminal import ( coconut/terminal.py:34: in from coconut._pyparsing import ( coconut/_pyparsing.py:62: in import cPyparsing as _pyparsing cPyparsing.pyx:1327: in init cPyparsing ??? E AttributeError: 'builtin_function_or_method' object has no attribute 'inspect_tracebacks' =========================== short test summary info ============================ ERROR coconut/tests/constants_test.py - AttributeError: 'builtin_function_or_... ERROR coconut/tests/main_test.py - AttributeError: 'builtin_function_or_metho... !!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!! ============================== 2 errors in 0.52s =============================== ```

Here is list of installed modules in build env

```console Package Version ----------------------------- ----------- alabaster 0.7.13 asttokens 2.2.1 Babel 2.12.1 backcall 0.2.0 build 0.10.0 charset-normalizer 3.2.0 comm 0.1.2 cPyparsing 2.4.7.2.2.1 debugpy 1.6.7 decorator 5.1.1 distro 1.8.0 docutils 0.19 exceptiongroup 1.1.1 executing 1.2.0 gpg 1.20.0 idna 3.4 imagesize 1.4.1 importlib-metadata 6.8.0 iniconfig 2.0.0 installer 0.7.0 ipykernel 6.25.0 ipython 8.12.0 jedi 0.18.2 Jinja2 3.1.2 jupyter_client 8.3.0 jupyter_core 5.3.1 libcomps 0.1.19 MarkupSafe 2.1.2 matplotlib-inline 0.1.6 mypy 1.4.1 mypy-extensions 1.0.0 nest-asyncio 1.5.6 numpy 1.24.4 packaging 23.1 pandas 2.0.3 parso 0.8.3 pexpect 4.8.0 pickleshare 0.7.5 platformdirs 3.9.1 pluggy 1.2.0 prompt-toolkit 3.0.38 psutil 5.9.2 ptyprocess 0.7.0 pure-eval 0.2.2 Pygments 2.15.1 pyproject_hooks 1.0.0 pytest 7.4.0 pytest-remotedata 0.4.0 python-dateutil 2.8.2 pytz 2023.2 pyzmq 25.1.0 requests 2.31.0 setuptools 68.0.0 six 1.16.0 snowballstemmer 2.2.0 Sphinx 6.2.1 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.5 stack-data 0.6.2 tomli 2.0.1 tornado 6.3.2 traitlets 5.9.0 typing_extensions 4.7.1 urllib3 1.26.15 wcwidth 0.2.6 wheel 0.40.0 zipp 3.16.2 ```
evhub commented 1 year ago

Please stop posting this here. I am never going to fix this. I have told you this repeatedly (#630, #716, #741) in the past.

This is your last warning. If you post this same issue here again, I will ban you from interacting with this repository and any other repositories that I own.

kloczek commented 1 year ago

OK I'll add note to my spec files to not bother you again however why test suite which is using pytest module needs to executed by not using pytest command? 🤔 Is it any particular reason to confuse someone like me using that that way? 🤔 As errors and fails are changing I've assumed that you actually fixed reported issues ..

evhub commented 1 year ago

As I've explained previously, Coconut's testing suite is only ever intended to be run in the exact development environment of Coconut's testing suite. In that environment, there are no errors and fails (at least in any released version), everything works just fine (https://github.com/evhub/coconut/actions/runs/5699294862), but Coconut's testing suite is not intended to be used by the end user in any situation.

kloczek commented 5 months ago

Please forgive me .. I have just last question about testing topic.

If some units are working only in some very specific env maybe it would be good to add some pytest mark like ci or so to be able nasypy enable those units? 🤔 (default IMO shuld be skip those units) I'm sure that other people may be asking similar questions causing only your frustration .. If you will give me list od those units which should be skipped outside of CI I can try to prepare PR for that. Would you accept such PR? 🤔 if yes please just choose name of such pytest mark. 'ci' would be OK? 🤔

For now in my rpm spec file I have below list of units which are failing.

%check
%pytest coconut/tests %{!?with_failing_tests: \
        --deselect coconut/tests/constants_test.py::TestConstants::test_imports \
        --deselect coconut/tests/main_test.py::TestCompilation::test_and \
        --deselect coconut/tests/main_test.py::TestCompilation::test_incremental \
        --deselect coconut/tests/main_test.py::TestCompilation::test_keep_lines \
        --deselect coconut/tests/main_test.py::TestCompilation::test_mypy_sys \
        --deselect coconut/tests/main_test.py::TestCompilation::test_no_tco \
        --deselect coconut/tests/main_test.py::TestCompilation::test_no_wrap \
        --deselect coconut/tests/main_test.py::TestCompilation::test_normal \
        --deselect coconut/tests/main_test.py::TestCompilation::test_package \
        --deselect coconut/tests/main_test.py::TestCompilation::test_run_arg \
        --deselect coconut/tests/main_test.py::TestCompilation::test_run_dir \
        --deselect coconut/tests/main_test.py::TestCompilation::test_standalone \
        --deselect coconut/tests/main_test.py::TestCompilation::test_strict \
        --deselect coconut/tests/main_test.py::TestCompilation::test_target \
        --deselect coconut/tests/main_test.py::TestExternal::test_prelude \
        --deselect coconut/tests/main_test.py::TestExternal::test_pyprover \
        --deselect coconut/tests/main_test.py::TestShell::test_import_hook \
        --deselect coconut/tests/main_test.py::TestShell::test_jupyter_console \
        --deselect coconut/tests/main_test.py::TestShell::test_kernel_installation \
        --deselect coconut/tests/main_test.py::TestShell::test_xontrib \
}

Is that all? 🤔 I'm asking because have some ebven very limited possibility to test your module in some other envs is quite important. Simple "something is always better than nothing".