Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests failing with "FileNotFoundError: [Errno 2]" and "Unknown directive type: 'currentmodule' [myst.directive_unknown]" #508

Closed
johanneskastl opened this issue Nov 24, 2023 · 6 comments
Labels
Packaging Upstream package support

Comments

@johanneskastl
Copy link

Just packaged v0.24.1 for openSUSE. The "unknown pytest option" error from #496 is gone, but I get two other errors that cause the build to fail.

One regarding a file not found. And one regarding Unknown directive type: 'currentmodule' [myst.directive_unknown].

The latter might be due to a dependency's version being too old, but the constraints in pyproject.toml are fulfilled AFAIK.

Any ideas?

Kind Regards,
Johannes

[   34s] ============================= test session starts ==============================                                                                                          [268/7461]
[   36s] collecting ... collected 320 items / 2 errors / 24 deselected / 296 selected                                                                                                        [   36s]                                                                                                                                                                                     
[   36s] ==================================== ERRORS ====================================                                                                                                    
[   36s] ________________________ ERROR collecting docs/conf.py _________________________                                                                                                    
[   36s] /usr/lib/python3.9/site-packages/_pytest/runner.py:341: in from_call                                                                                                                
[   36s]     result: Optional[TResult] = func()                                                                                                                                              
[   36s]         cls        = <class '_pytest.runner.CallInfo'>                                                                                                                              
[   36s]         duration   = 0.0013224719987192657                                                                                                                                          
[   36s]         excinfo    = <ExceptionInfo FileNotFoundError(2, 'No such file or directory') tblen=14>           
[   36s]         func       = <function pytest_make_collect_report.<locals>.<lambda> at 0x7f077c853ee0>                                                                                      
[   36s]         precise_start = 26624.482299699                                                                                                                                             
[   36s]         precise_stop = 26624.483622171                                                                                                                                              
[   36s]         reraise    = None                                                                                                                                                           
[   36s]         result     = None                                                                                                                                                           
[   36s]         start      = 1700804964.5868146                                                                                                                                             
[   36s]         stop       = 1700804964.5881379                                                                                                                                             
[   36s]         when       = 'collect'                                                                                                                                                      
[   36s] /usr/lib/python3.9/site-packages/_pytest/runner.py:372: in <lambda>                                                                                                                 
[   36s]     call = CallInfo.from_call(lambda: list(collector.collect()), "collect")                                                                                                         
[   36s]         collector  = <DoctestModule conf.py>                                                                                                                                        
[   36s] /usr/lib/python3.9/site-packages/_pytest/doctest.py:567: in collect                                                                                                                 
[   36s]     module = import_path(                                                                                                                                                           
[   36s]         MockAwareDocTestFinder = <class '_pytest.doctest.DoctestModule.collect.<locals>.MockAwareDocTestFinder'>                                                                    
[   36s]         doctest    = <module 'doctest' from '/usr/lib64/python3.9/doctest.py'>       
[   36s]         self       = <DoctestModule conf.py>                                                                                                                                        
[   36s] /usr/lib/python3.9/site-packages/_pytest/pathlib.py:567: in import_path              
[   36s]     importlib.import_module(module_name)                                                                                                                                            
[   36s]         mode       = <ImportMode.prepend: 'prepend'>                                                                                                                                
[   36s]         module_name = 'docs.conf'                                                                                                                                                   
[   36s]         names      = ['docs', 'conf']                                                
[   36s]         p          = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/conf.py')                                                                                           
[   36s]         path       = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/conf.py')
[   36s]         pkg_path   = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs')                                                                                                   
[   36s]         pkg_root   = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1')         
[   36s]         root       = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1')
[   36s] /usr/lib64/python3.9/importlib/__init__.py:127: in import_module
[   36s]     return _bootstrap._gcd_import(name[level:], package, level)
[   36s]         level      = 0
[   36s]         name       = 'docs.conf'
[   36s]         package    = None
[   36s] <frozen importlib._bootstrap>:1030: in _gcd_import
[   36s]     ???
[   36s]         level      = 0
[   36s]         name       = 'docs.conf'
[   36s]         package    = None
[   36s] <frozen importlib._bootstrap>:1007: in _find_and_load
[   36s]     ???
[   36s]         import_    = <function _gcd_import at 0x7f077e358310>
[   36s]         module     = <object object at 0x7f077e331060>
[   36s]         name       = 'docs.conf'
[   36s] <frozen importlib._bootstrap>:986: in _find_and_load_unlocked
[   36s]     ???
[   36s]         import_    = <function _gcd_import at 0x7f077e358310>
[   36s]         name       = 'docs.conf'
[   36s]         parent     = 'docs'
[   36s]         parent_module = <module 'docs' from '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/__init__.py'>
[   36s]         path       = ['/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs']
[   36s]         spec       = ModuleSpec(name='docs.conf', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f077c062910>, origin='/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/
docs/conf.py')
[   36s] <frozen importlib._bootstrap>:680: in _load_unlocked
[   36s]     ???
[   36s]         module     = <module 'docs.conf' from '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/conf.py'>
[   36s]         spec       = ModuleSpec(name='docs.conf', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f077c062910>, origin='/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/
docs/conf.py')
[   36s] <frozen importlib._bootstrap_external>:850: in exec_module
[   36s]     ???
[   36s]         code       = <code object <module> at 0x7f077c064b30, file "/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/conf.py", line 2>
[   36s]         module     = <module 'docs.conf' from '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/conf.py'>
[   36s]         self       = <_frozen_importlib_external.SourceFileLoader object at 0x7f077c062910>
[   36s] <frozen importlib._bootstrap>:228: in _call_with_frames_removed
[   36s]     ???
[   36s]         args       = (<code object <module> at 0x7f077c064b30, file "/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/conf.py", line 2>, {'_...'__cached__': '/home/abuild/rpmbuild/B
UILD/libtmux-0.24.1/docs/__pycache__/conf.cpython-39.pyc', '__doc__': None, ...})
[   36s]         f          = <built-in function exec>
[   36s]         kwds       = {}
[   36s] docs/conf.py:24: in <module>
[   36s]     with (project_src / "libtmux" / "__about__.py").open() as fp:
[   36s]         __annotations__ = {'about': typing.Dict[str, str]}
[   36s]         __builtins__ = <builtins>
[   36s]         __cached__ = '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/__pycache__/conf.cpython-39.pyc'
[   36s]         __doc__    = None
[   36s]         __file__   = '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/conf.py'
[   36s]         __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7f077c062910>
[   36s]         __name__   = 'docs.conf'
[   36s]         __package__ = 'docs'
[   36s]         __spec__   = ModuleSpec(name='docs.conf', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f077c062910>, origin='/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/
docs/conf.py')
[   36s]         about      = {}
[   36s]         contextlib = <module 'contextlib' from '/usr/lib64/python3.9/contextlib.py'>
[   36s]         cwd        = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs')
[   36s]         inspect    = <module 'inspect' from '/usr/lib64/python3.9/inspect.py'>
[   36s]         libtmux    = <module 'libtmux' from '/home/abuild/rpmbuild/BUILDROOT/python-libtmux-0.24.1-0.x86_64/usr/lib/python3.9/site-packages/libtmux/__init__.py'>
[   36s]         pathlib    = <module 'pathlib' from '/usr/lib64/python3.9/pathlib.py'>
[   36s]         project_root = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1')
[   36s]         project_src = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/src')
[   36s]         relpath    = <function relpath at 0x7f077e207280>
[   36s]         sys        = <module 'sys' (built-in)>
[   36s]         t          = <module 'typing' from '/usr/lib64/python3.9/typing.py'>
[   36s] /usr/lib64/python3.9/pathlib.py:1252: in open
[   36s]     return io.open(self, mode, buffering, encoding, errors, newline,
[   36s]         buffering  = -1
[   36s]         encoding   = None
[   36s]         errors     = None
[   36s]         mode       = 'r'
[   36s]         newline    = None
[   36s]         self       = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/src/libtmux/__about__.py')
[   36s] /usr/lib64/python3.9/pathlib.py:1120: in _opener
[   36s]     return self._accessor.open(self, flags, mode)
[   36s] E   FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/src/libtmux/__about__.py'
[   36s]         flags      = 524288
[   36s]         mode       = 438
[   36s]         name       = '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/src/libtmux/__about__.py'
[   36s]         self       = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/src/libtmux/__about__.py')
[   36s] ______________________ ERROR collecting docs/migration.md ______________________
[   36s] /usr/lib/python3.9/site-packages/myst_parser/mocking.py:377: in run
[   36s]     file_content = path.read_text(encoding=encoding, errors=error_handler)
[   36s]         CodeBlock  = <class 'docutils.parsers.rst.directives.body.CodeBlock'>
[   36s]         NumberLines = <class 'docutils.utils.code_analyzer.NumberLines'>
[   36s]         encoding   = None
[   36s]         error_handler = 'strict'
[   36s]         include_arg = '../MIGRATION'
[   36s]         path       = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION')
[   36s]         self       = <myst_parser.mocking.MockIncludeDirective object at 0x7f077b9d7130>
[   36s]         source_dir = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs')
[   36s] /usr/lib64/python3.9/pathlib.py:1266: in read_text
[   36s]     with self.open(mode='r', encoding=encoding, errors=errors) as f:
[   36s]         encoding   = None
[   36s]         errors     = 'strict'
[   36s]         self       = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION')
[   36s] /usr/lib64/python3.9/pathlib.py:1252: in open
[   36s]     return io.open(self, mode, buffering, encoding, errors, newline,
[   36s]         buffering  = -1
[   36s]         encoding   = None
[   36s]         errors     = 'strict'
[   36s]         mode       = 'r'
[   36s]         newline    = None
[   36s]         self       = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION')
[   36s] /usr/lib64/python3.9/pathlib.py:1120: in _opener
[   36s]     return self._accessor.open(self, flags, mode)
[   36s] E   FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION'
[   36s]         flags      = 524288
[   36s]         mode       = 438
[   36s]         name       = '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION'
[   36s]         self       = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION')
[   36s] 
[   36s] During handling of the above exception, another exception occurred:
[   36s] /usr/lib/python3.9/site-packages/myst_parser/mdit_to_docutils/base.py:1793: in run_directive
[   36s]     result = directive_instance.run()
[   36s]         additional_options = None
[   36s]         content    = '\n'
[   36s]         directive_class = <class 'docutils.parsers.rst.directives.misc.Include'>
[   36s]         directive_instance = <myst_parser.mocking.MockIncludeDirective object at 0x7f077b9d7130>
[   36s]         first_line = '../MIGRATION'
[   36s]         messages   = []
[   36s]         name       = 'include'
[   36s]         output     = (<class 'docutils.parsers.rst.directives.misc.Include'>, [])
[   36s]         parsed     = DirectiveParsingResult(arguments=['../MIGRATION'], options={}, body=[], body_offset=1, warnings=[])
[   36s]         position   = 7
[   36s]         self       = <myst_parser.mdit_to_docutils.base.DocutilsRenderer object at 0x7f077b9bb220>
[   36s] /usr/lib/python3.9/site-packages/myst_parser/mocking.py:379: in run
[   36s]     raise DirectiveError(
[   36s] E   docutils.parsers.rst.DirectiveError
[   36s]         CodeBlock  = <class 'docutils.parsers.rst.directives.body.CodeBlock'>
[   36s]         NumberLines = <class 'docutils.utils.code_analyzer.NumberLines'>
[   36s]         encoding   = None
[   36s]         error_handler = 'strict'
[   36s]         include_arg = '../MIGRATION'
[   36s]         path       = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION')
[   36s]         self       = <myst_parser.mocking.MockIncludeDirective object at 0x7f077b9d7130>
[   36s]         source_dir = PosixPath('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs')
[   36s] 
[   36s] During handling of the above exception, another exception occurred:
[   36s] /usr/lib/python3.9/site-packages/_pytest/runner.py:341: in from_call
[   36s]     result: Optional[TResult] = func() 
[   36s]         cls        = <class '_pytest.runner.CallInfo'>
[   36s]         duration   = 0.0032985840007313527
[   36s]         excinfo    = <ExceptionInfo SystemMessage('/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/migration.md:7: (SEVERE/4) Directive "include": file not found: \'/home/abuild/rp
mbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION\'') tblen=12>
[   36s]         func       = <function pytest_make_collect_report.<locals>.<lambda> at 0x7f077bf25f70>
[   36s]         precise_start = 26624.798742421
[   36s]         precise_stop = 26624.802041005 
[   36s]         reraise    = None
[   36s]         result     = None
[   36s]         start      = 1700804964.9032574
[   36s]         stop       = 1700804964.9065568
[   36s]         when       = 'collect'
[   36s] /usr/lib/python3.9/site-packages/_pytest/runner.py:372: in <lambda>
[   36s]     call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
[   36s]         collector  = <DocTestDocutilsFile migration.md>
[   36s] /usr/lib/python3.9/site-packages/pytest_doctest_docutils.py:235: in collect
[   36s]     for test in finder.find(
[   36s]         DoctestItem = <class '_pytest.doctest.DoctestItem'>
[   36s]         encoding   = 'utf-8'
[   36s]         finder     = <doctest_docutils.DocutilsDocTestFinder object at 0x7f077bb20640>
[   36s]         optionflags = 12
[   36s]         runner     = <pytest_doctest_docutils._init_runner_class.<locals>.PytestDoctestRunner object at 0x7f077ba248e0>
[   36s]         self       = <DocTestDocutilsFile migration.md>
[   36s]         text       = '(migration)=\n\n```{currentmodule} libtmux\n\n```\n\n```{include} ../MIGRATION\n\n```\n'
[   36s] /usr/lib/python3.9/site-packages/doctest_docutils.py:257: in find
[   36s]     self._find(tests, string, name, source_lines, globs, {}, name)
[   36s]         extraglobs = None
[   36s]         globs      = {'__name__': '__main__'}
[   36s]         name       = '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/migration.md'
[   36s]         self       = <doctest_docutils.DocutilsDocTestFinder object at 0x7f077bb20640>
[   36s]         source_lines = ['(migration)=\n', '\n', '```{currentmodule} libtmux\n', '\n', '```\n', '\n', ...]
[   36s]         string     = '(migration)=\n\n```{currentmodule} libtmux\n\n```\n\n```{include} ../MIGRATION\n\n```\n'
[   36s]         tests      = []
[   36s] /usr/lib/python3.9/site-packages/doctest_docutils.py:317: in _find
[   36s]     md_parser.render(string)
[   36s]         DocutilsParser = <class 'myst_parser.parsers.docutils_.Parser'>
[   36s]         DocutilsRenderer = <class 'myst_parser.mdit_to_docutils.base.DocutilsRenderer'>
[   36s]         MdParserConfig = <class 'myst_parser.config.main.MdParserConfig'>
[   36s]         config     = MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions=set(), disable_syntax=[], all_links_external=F...x_process|mathjax_process|math|output_
area', enable_checkboxes=False, suppress_warnings=[], highlight_code_blocks=True)
[   36s]         create_md_parser = <function create_md_parser at 0x7f077c0ea9d0>
[   36s]         doc        = <document: <target "migration"...><system_message...><system_messag ...>
[   36s]         ext        = '.md'
[   36s]         globs      = {'__name__': '__main__'}
[   36s]         make_document = <function make_document at 0x7f077c5acf70>
[   36s]         md_parser  = markdown_it.main.MarkdownIt()
[   36s]         myst_parser = <module 'myst_parser' from '/usr/lib/python3.9/site-packages/myst_parser/__init__.py'>
[   36s]         name       = '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/migration.md'
[   36s]         seen       = {139670119864368: 1}
[   36s]         self       = <doctest_docutils.DocutilsDocTestFinder object at 0x7f077bb20640>
[   36s]         source_lines = ['(migration)=\n', '\n', '```{currentmodule} libtmux\n', '\n', '```\n', '\n', ...]
[   36s]         source_path = '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/migration.md'
[   36s]         string     = '(migration)=\n\n```{currentmodule} libtmux\n\n```\n\n```{include} ../MIGRATION\n\n```\n'
[   36s]         tests      = []
[   36s] /usr/lib/python3.9/site-packages/markdown_it/main.py:291: in render
[   36s]     return self.renderer.render(self.parse(src, env), self.options, env)
[   36s]         env        = {'foot_refs': {}, 'wordcount': {'minutes': 0, 'words': 0}}
[   36s]         self       = markdown_it.main.MarkdownIt()
[   36s]         src        = '(migration)=\n\n```{currentmodule} libtmux\n\n```\n\n```{include} ../MIGRATION\n\n```\n'
[   36s] /usr/lib/python3.9/site-packages/myst_parser/mdit_to_docutils/base.py:235: in render
[   36s]     self._render_tokens(list(tokens))
[   36s]         md_env     = {'foot_refs': {}, 'wordcount': {'minutes': 0, 'words': 0}}
[   36s]         options    = {'maxNesting': 20, 'html': True, 'linkify': False, 'typographer': False, 'quotes': '“”‘’', 'xhtmlOut': True, 'breaks':...=[], highlight_code_blocks=True), 'doc
ument': <document: <target "migration"...><system_message...><system_messag ...>}
[   36s]         self       = <myst_parser.mdit_to_docutils.base.DocutilsRenderer object at 0x7f077b9bb220>
[   36s]         tokens     = [Token(type='myst_target', tag='', nesting=0, attrs={'class': 'myst-target'}, map=[1, 2], level=0, children=None, cont... level=0, children=None, content='\n',
 markup='```', info='{include} ../MIGRATION', meta={}, block=True, hidden=False)]
[   36s] /usr/lib/python3.9/site-packages/myst_parser/mdit_to_docutils/base.py:214: in _render_tokens
[   36s]     self.rules[f"render_{child.type}"](child)
[   36s]         child      = SyntaxTreeNode(fence)
[   36s]         new_children = []
[   36s]         node       = SyntaxTreeNode(fence)
[   36s]         node_tree  = SyntaxTreeNode(root)
[   36s]         self       = <myst_parser.mdit_to_docutils.base.DocutilsRenderer object at 0x7f077b9bb220>
[   36s]         token      = Token(type='fence', tag='code', nesting=0, attrs={}, map=[7, 10], level=0, children=None, content='\n', markup='```', info='{include} ../MIGRATION', meta={}, b
lock=True, hidden=False)
[   36s]         tokens     = [Token(type='myst_target', tag='', nesting=0, attrs={'class': 'myst-target'}, map=[1, 2], level=0, children=None, cont... level=0, children=None, content='\n',
 markup='```', info='{include} ../MIGRATION', meta={}, block=True, hidden=False)]
[   36s] /usr/lib/python3.9/site-packages/myst_parser/mdit_to_docutils/base.py:743: in render_fence
[   36s]     return self.render_directive(token, name[1:-1], arguments)
[   36s]         arguments  = '../MIGRATION'
[   36s]         name       = '{include}'
[   36s]         parts      = ['{include}', '../MIGRATION']
[   36s]         self       = <myst_parser.mdit_to_docutils.base.DocutilsRenderer object at 0x7f077b9bb220>
[   36s]         token      = SyntaxTreeNode(fence)
[   36s] /usr/lib/python3.9/site-packages/myst_parser/mdit_to_docutils/base.py:1686: in render_directive
[   36s]     nodes_list = self.run_directive(
[   36s]         additional_options = None
[   36s]         arguments  = '../MIGRATION'
[   36s]         name       = 'include'
[   36s]         position   = 7
[   36s]         self       = <myst_parser.mdit_to_docutils.base.DocutilsRenderer object at 0x7f077b9bb220>
[   36s]         token      = SyntaxTreeNode(fence)
[   36s] /usr/lib/python3.9/site-packages/myst_parser/mdit_to_docutils/base.py:1795: in run_directive
[   36s]     msg_node = self.reporter.system_message(
[   36s]         additional_options = None
[   36s]         content    = '\n'
[   36s]         directive_class = <class 'docutils.parsers.rst.directives.misc.Include'>
[   36s]         directive_instance = <myst_parser.mocking.MockIncludeDirective object at 0x7f077b9d7130>
[   36s]         first_line = '../MIGRATION'
[   36s]         messages   = []
[   36s]         name       = 'include'
[   36s]         output     = (<class 'docutils.parsers.rst.directives.misc.Include'>, [])
[   36s]         parsed     = DirectiveParsingResult(arguments=['../MIGRATION'], options={}, body=[], body_offset=1, warnings=[])
[   36s]         position   = 7
[   36s]         self       = <myst_parser.mdit_to_docutils.base.DocutilsRenderer object at 0x7f077b9bb220>
[   36s] /usr/lib/python3.9/site-packages/docutils/utils/__init__.py:197: in system_message
[   36s]     raise SystemMessage(msg, level)
[   36s] E   docutils.utils.SystemMessage: /home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/migration.md:7: (SEVERE/4) Directive "include": file not found: '/home/abuild/rpmbuild/BUILD/libtm
ux-0.24.1/docs/../MIGRATION'
[   36s]         attributes = {'line': 7, 'source': '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/migration.md'}
[   36s]         children   = ()
[   36s]         kwargs     = {'line': 7}
[   36s]         level      = 4
[   36s]         line       = None
[   36s]         message    = 'Directive "include": file not found: \'/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION\''
[   36s]         msg        = <system_message: <paragraph...>>
[   36s]         self       = <docutils.utils.Reporter object at 0x7f077bb20a00>
[   36s]         source     = None
[   36s] ------------------------------- Captured stderr --------------------------------
[   36s] /home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/migration.md:3: (WARNING/2) Unknown directive type: 'currentmodule' [myst.directive_unknown]
[   36s] /home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/migration.md:7: (SEVERE/4) Directive "include": file not found: '/home/abuild/rpmbuild/BUILD/libtmux-0.24.1/docs/../MIGRATION'
[   36s] =========================== short test summary info ============================
[   36s] ERROR docs/conf.py - FileNotFoundError: [Errno 2] No such file or directory: ...
[   36s] ERROR docs/migration.md - docutils.utils.SystemMessage: /home/abuild/rpmbuild...
[   36s] !!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
[   36s] ======================= 24 deselected, 2 errors in 2.09s =======================
@tony
Copy link
Member

tony commented Nov 24, 2023

@johanneskastl Thank you for this!

How is the package being checked out? How are it and its dependencies being installed?

e.g. If it's from git source, does poetry install --with=test,coverage,lint work?

@tony tony added the Packaging Upstream package support label Nov 25, 2023
@johanneskastl
Copy link
Author

The package is built in a offline environment, aka all dependencies are being prepared beforehand. This means all of the other packages are being installed via openSUSE's RPM package manager.
libtmux itself is being prepared from a PyPI tarball, which worked up until now. I can test and use the GitHub tarball, to see if this solves the issue.

@tony
Copy link
Member

tony commented Feb 8, 2024

@johanneskastl

MIGRATION:

I will make a fix for this and report when the release is pushed.

poetry build
cd dist/
tar xvf libtmux-0.27.0.tar.gz
ls libtmux-0.27.0/
CHANGES  LICENSE  PKG-INFO  README.md  conftest.py  docs  pyproject.toml  src  tests

__about__.py:

I'm confident this exists:

ls libtmux-0.27.0/src/libtmux
__about__.py  __init__.py  _compat.py  _internal  _vendor  common.py  exc.py  formats.py  neo.py  pane.py  py.typed  pytest_plugin.py  server.py  session.py  test.py  window.py

currentmodule directive

Unknown directive type: 'currentmodule' [myst.directive_unknown].

This should be fine to ignore.

tony added a commit that referenced this issue Feb 8, 2024
tony added a commit that referenced this issue Feb 8, 2024
@tony tony closed this as completed in 6212cbe Feb 8, 2024
@tony tony reopened this Feb 8, 2024
@tony
Copy link
Member

tony commented Feb 8, 2024

@johanneskastl If you try v0.27.1, is anything different?

@johanneskastl
Copy link
Author

I tried with 0.27.1 and one of the original errors (Unknown directive type: 'currentmodule') is gone.

I needed to work around the other one, as I need to rename the src directory before the builds and rename it back, otherwise I run into some weird errors.
So I had to put __about__.py back into src/libtmux/ and now the tests succeed. I could even re-enable the checks I had to disable a while ago:

IGNORED_TESTS="test_capture_pane"
IGNORED_TESTS="${IGNORED_TESTS} or test_capture_pane_start"
IGNORED_TESTS="${IGNORED_TESTS} or test_function_times_out"
IGNORED_TESTS="${IGNORED_TESTS} or test_function_times_out_no_rise"
IGNORED_TESTS="${IGNORED_TESTS} or test_function_times_out_no_raise_assert"
IGNORED_TESTS="${IGNORED_TESTS} or test_select_window"
IGNORED_TESTS="${IGNORED_TESTS} or test_new_window_with_environment[environment0]"
IGNORED_TESTS="${IGNORED_TESTS} or test_new_window_with_environment[environment1]"
IGNORED_TESTS="${IGNORED_TESTS} or test_split_window_with_environment[environment0]"
IGNORED_TESTS="${IGNORED_TESTS} or test_split_window_with_environment[environment1]"
%pytest -k "not (${IGNORED_TESTS})"

Hence: Closing this issue! Thanks for your help!

@tony
Copy link
Member

tony commented Feb 8, 2024

@johanneskastl Thank you for the detailed follow up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Packaging Upstream package support
Projects
None yet
Development

No branches or pull requests

2 participants