lark icon indicating copy to clipboard operation
lark copied to clipboard

1.1.7: `commentjson` 0.9.0 documentation prints call traces and pytest is failing because it cannot find `common.lark`

Open kloczek opened this issue 2 years ago • 8 comments

Describe the bug I'm trying to upgrade commentjson to be able use it with latest lark. Looks like something is wrong with lark code because commentjson 0.9.0 documentation prints call traces and pytest is failing because it cannot find common.lark

To Reproduce

  • clone https://github.com/vaidik/commentjson/
  • apply patch
--- a/requirements.txt~ 2020-10-05 18:18:00.000000000 +0000
+++ b/requirements.txt  2022-05-06 12:52:11.781834962 +0000
@@ -1 +1 @@
-lark-parser<0.8.0,>=0.7.1
+lark>=0.7.1
--- a/setup.py~ 2020-10-05 18:18:00.000000000 +0000
+++ b/setup.py  2022-05-06 12:52:11.215834802 +0000
@@ -9,7 +9,7 @@
 __version__ = '0.9.0'

 install_requires = [
-    'lark-parser>=0.7.1,<0.8.0'
+    'lark>=0.7.1'
 ]
 if sys.version_info <= (2, 6):
     install_requires.append('simplejson')
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -16,7 +16,7 @@
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('../..'))

 # -- General configuration -----------------------------------------------------
  • build documemtation by execute 'sphinx-build -n -T -b man docs/source build/sphinx/man`

Documentation build is not failing but it prints call traces

+ /usr/bin/sphinx-build -n -T -b man docs/source build/sphinx/man
Running Sphinx v7.0.1
making output directory... done
WARNING: html_static_path entry '_static' does not exist
building [mo]: targets for 0 po files that are out of date
writing output...
building [man]: all manpages
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index

WARNING: autodoc: failed to import function 'loads' from module 'commentjson'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 66, in import_module
    return importlib.import_module(modname)
  File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/__init__.py", line 1, in <module>
    from .commentjson import dump
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/commentjson.py", line 34, in <module>
    parser = Lark('''
  File "/usr/lib/python3.8/site-packages/lark/lark.py", line 356, in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1410, in load_grammar
    builder.load_grammar(grammar, source)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1250, in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1333, in do_import
    open(grammar_path, encoding='utf8')
FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'

WARNING: autodoc: failed to import function 'dumps' from module 'commentjson'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 66, in import_module
    return importlib.import_module(modname)
  File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/__init__.py", line 1, in <module>
    from .commentjson import dump
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/commentjson.py", line 34, in <module>
    parser = Lark('''
  File "/usr/lib/python3.8/site-packages/lark/lark.py", line 356, in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1410, in load_grammar
    builder.load_grammar(grammar, source)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1250, in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1333, in do_import
    open(grammar_path, encoding='utf8')
FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'

WARNING: autodoc: failed to import function 'load' from module 'commentjson'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 66, in import_module
    return importlib.import_module(modname)
  File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/__init__.py", line 1, in <module>
    from .commentjson import dump
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/commentjson.py", line 34, in <module>
    parser = Lark('''
  File "/usr/lib/python3.8/site-packages/lark/lark.py", line 356, in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1410, in load_grammar
    builder.load_grammar(grammar, source)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1250, in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1333, in do_import
    open(grammar_path, encoding='utf8')
FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'

WARNING: autodoc: failed to import function 'dump' from module 'commentjson'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 66, in import_module
    return importlib.import_module(modname)
  File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/__init__.py", line 1, in <module>
    from .commentjson import dump
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/commentjson.py", line 34, in <module>
    parser = Lark('''
  File "/usr/lib/python3.8/site-packages/lark/lark.py", line 356, in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1410, in load_grammar
    builder.load_grammar(grammar, source)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1250, in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1333, in do_import
    open(grammar_path, encoding='utf8')
FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'

WARNING: autodoc: failed to import exception 'JSONLibraryException' from module 'commentjson'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 66, in import_module
    return importlib.import_module(modname)
  File "/usr/lib64/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/__init__.py", line 1, in <module>
    from .commentjson import dump
  File "/home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0/commentjson/commentjson.py", line 34, in <module>
    parser = Lark('''
  File "/usr/lib/python3.8/site-packages/lark/lark.py", line 356, in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1410, in load_grammar
    builder.load_grammar(grammar, source)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1250, in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
  File "/usr/lib/python3.8/site-packages/lark/load_grammar.py", line 1333, in do_import
    open(grammar_path, encoding='utf8')
FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'

looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-commentjson.3 { } done
build succeeded, 6 warnings.

pytest is failing as well because it cannot find common.lark

============================= test session starts ==============================
platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.2.0
rootdir: /home/tkloczko/rpmbuild/BUILD/commentjson-0.9.0
collected 0 items / 12 errors

==================================== ERRORS ====================================
____________ ERROR collecting commentjson/tests/test_commentjson.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
_________ ERROR collecting commentjson/tests/test_json/test_decode.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
__________ ERROR collecting commentjson/tests/test_json/test_dump.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
_ ERROR collecting commentjson/tests/test_json/test_encode_basestring_ascii.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
__________ ERROR collecting commentjson/tests/test_json/test_float.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
_________ ERROR collecting commentjson/tests/test_json/test_indent.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
__________ ERROR collecting commentjson/tests/test_json/test_pass1.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
__________ ERROR collecting commentjson/tests/test_json/test_pass2.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
__________ ERROR collecting commentjson/tests/test_json/test_pass3.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
________ ERROR collecting commentjson/tests/test_json/test_recursion.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
_______ ERROR collecting commentjson/tests/test_json/test_separators.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
_________ ERROR collecting commentjson/tests/test_json/test_unicode.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 <lambda>
    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)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:961: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:843: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
commentjson/__init__.py:1: in <module>
    from .commentjson import dump
commentjson/commentjson.py:34: in <module>
    parser = Lark('''
/usr/lib/python3.8/site-packages/lark/lark.py:356: in __init__
    self.grammar, used_files = load_grammar(grammar, self.source_path, self.options.import_paths, self.options.keep_all_tokens)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1410: in load_grammar
    builder.load_grammar(grammar, source)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1250: in load_grammar
    self.do_import(dotted_path, base_path, aliases, mangle)
/usr/lib/python3.8/site-packages/lark/load_grammar.py:1333: in do_import
    open(grammar_path, encoding='utf8')
E   FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'
=========================== short test summary info ============================
ERROR commentjson/tests/test_commentjson.py - FileNotFoundError: [Errno 2] No...
ERROR commentjson/tests/test_json/test_decode.py - FileNotFoundError: [Errno ...
ERROR commentjson/tests/test_json/test_dump.py - FileNotFoundError: [Errno 2]...
ERROR commentjson/tests/test_json/test_encode_basestring_ascii.py - FileNotFo...
ERROR commentjson/tests/test_json/test_float.py - FileNotFoundError: [Errno 2...
ERROR commentjson/tests/test_json/test_indent.py - FileNotFoundError: [Errno ...
ERROR commentjson/tests/test_json/test_pass1.py - FileNotFoundError: [Errno 2...
ERROR commentjson/tests/test_json/test_pass2.py - FileNotFoundError: [Errno 2...
ERROR commentjson/tests/test_json/test_pass3.py - FileNotFoundError: [Errno 2...
ERROR commentjson/tests/test_json/test_recursion.py - FileNotFoundError: [Err...
ERROR commentjson/tests/test_json/test_separators.py - FileNotFoundError: [Er...
ERROR commentjson/tests/test_json/test_unicode.py - FileNotFoundError: [Errno...
!!!!!!!!!!!!!!!!!!! Interrupted: 12 errors during collection !!!!!!!!!!!!!!!!!!!
============================== 12 errors in 2.35s ==============================

On first look it looks like lark code should be trying to import common.lark it should be used lark.common.

Bug or something has changed in lark 0.9? 🤔 May I ask for help?

kloczek avatar Aug 27 '23 15:08 kloczek

@kloczek Hello. Exactly which version of lark gets installed? The latest 0.x version is 0.12 (which is 2 years old), and latest lark version is 1.1.7

May I ask what's preventing you from using the latest version?

erezsh avatar Aug 27 '23 16:08 erezsh

I'm using 1.1.7 which I'v added in issue ticket title. I have no idea how it was before before. I just started packaging commentjson so have no experience with that module with prev lark versions 😞

Nevertheless looking on the lark code around lark/load_grammar.py:1333 looks like the lark code is trying to perform some dynamic import so this is why I wrote that module name looks like is assembled in reverse order ..

kloczek avatar Aug 27 '23 16:08 kloczek

Got it. Can you please test it with Lark 1.1.5 ?

erezsh avatar Aug 27 '23 16:08 erezsh

(it's one version before we moved from setup.py to pyproject.toml, which may have caused this problem)

erezsh avatar Aug 27 '23 16:08 erezsh

I am getting completely different errors. Are you sure the patch in the post is the only difference between master and your local?

One the one hand, missing dependencies (pytest, sphinx, six). After installing these, the sphinx command you have works for me, but pytest doesn't work because it doesn't find test.test_json (and similar) submodules. Maybe I am executing the tests wrong?

MegaIng avatar Aug 27 '23 17:08 MegaIng

OK will check that ASP 😋 (will back shortly) FYI I'm building all modules using pep517 based build (using build modules).

kloczek avatar Aug 27 '23 18:08 kloczek

Just tested with 1.1.5 and there is no those fails so looks like some wrong code has been added after that.

kloczek avatar Aug 27 '23 18:08 kloczek

Can you provide reproduction steps from a completely empty environment, i.e. preferably including creating a new venv?

MegaIng avatar Aug 27 '23 19:08 MegaIng