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

Can't work locally with Python docs, instructions fail to run #7913

Open
teh-cmc opened this issue Oct 28, 2024 · 3 comments
Open

Can't work locally with Python docs, instructions fail to run #7913

teh-cmc opened this issue Oct 28, 2024 · 3 comments
Labels
😤 annoying Something in the UI / SDK is annoying to use 🪳 bug Something isn't working 🧑‍💻 dev experience developer experience (excluding CI) 📖 documentation Improvements or additions to documentation 🐍 Python API Python logging API

Comments

@teh-cmc
Copy link
Member

teh-cmc commented Oct 28, 2024

I wanted to update the python docs, but none of the commands listed in writing_docs.md work for me.

E.g.:

$ pixi run py-docs-serve
Traceback (most recent call last):
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1411, in _resolve_target
    resolved = self.modules_collection.get_member(self.target_path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/mixins.py", line 84, in get_member
    return self.members[parts[0]].get_member(parts[1:])  # type: ignore[attr-defined]
           ~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'builtins'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/mkdocs/__main__.py", line 272, in serve_command
    serve.serve(**kwargs)
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 85, in serve
    builder(config)
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 67, in builder
    build(config, serve_url=None if is_clean else serve_url, dirty=is_dirty)
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/mkdocs/commands/build.py", line 292, in build
    files = config.plugins.on_files(files, config=config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/mkdocs/plugins.py", line 593, in on_files
    return self.run_event('files', files, config=config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/mkdocs/plugins.py", line 566, in run_event
    result = method(item, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/mkdocs_gen_files/plugin.py", line 39, in on_files
    runpy.run_path(file_name)
  File "<frozen runpy>", line 291, in run_path
  File "<frozen runpy>", line 98, in _run_module_code
  File "<frozen runpy>", line 88, in _run_code
  File "/home/cmc/dev/rerun-io/rerun/rerun_py/docs/gen_common_index.py", line 514, in <module>
    index_file.write(f"[`rerun.{show_class}`][rerun.{class_name}] | {cls.docstring.lines[0]}\n")
                                                                     ^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1042, in docstring
    return self.final_target.docstring
           ^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1377, in final_target
    target = target.target  # type: ignore[assignment]
             ^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1346, in target
    self.resolve_target()
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1405, in resolve_target
    self._resolve_target()
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1423, in _resolve_target
    self._target.aliases[self.path] = self  # type: ignore[union-attr]  # we just set the target
    ^^^^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1082, in aliases
    return self.final_target.aliases
           ^^^^^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1377, in final_target
    target = target.target  # type: ignore[assignment]
             ^^^^^^^^^^^^^
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1346, in target
    self.resolve_target()
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1405, in resolve_target
    self._resolve_target()
  File "/home/cmc/dev/rerun-io/rerun/.pixi/envs/py-docs/lib/python3.11/site-packages/_griffe/models.py", line 1413, in _resolve_target
    raise AliasResolutionError(self) from error
_griffe.exceptions.AliasResolutionError: Could not resolve alias rerun_bindings.rerun_bindings.ComponentColumnDescriptor pointing at builtins.ComponentColumnDescriptor (in rerun_py/rerun_bindings/rerun_bindings.abi3.so:None)

Does me being on pixi 0.25 has anything to do with it..?

@teh-cmc teh-cmc added 🪳 bug Something isn't working 📖 documentation Improvements or additions to documentation 🐍 Python API Python logging API 😤 annoying Something in the UI / SDK is annoying to use labels Oct 28, 2024
@Wumpf
Copy link
Member

Wumpf commented Oct 28, 2024

I'm on pixi 0.34.0 on my mac and it works there with just pixi run py-docs-serve. But this may be also due to previously installed things. Try doing a pixi run py-build beforehand just to be sure

@teh-cmc
Copy link
Member Author

teh-cmc commented Oct 28, 2024

Try doing a pixi run py-build beforehand just to be sure

Already tried this to no effect...

I'll try dropping the cache and updating to 0.34.

@teh-cmc
Copy link
Member Author

teh-cmc commented Oct 28, 2024

Removing pixi cache and/or updating pixi didn't help.

The only thing that fixes it for me is to remove the problematic artifact manually: rm -f rerun_py/rerun_bindings/rerun_bindings.abi3.so, but then the problem immediately reappeared as soon as I run pixi run py-build again.

So my workaround for now is: rm -f rerun_py/rerun_bindings/rerun_bindings.abi3.so ; pixi run py-docs-serve

@Wumpf Wumpf added the 🧑‍💻 dev experience developer experience (excluding CI) label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😤 annoying Something in the UI / SDK is annoying to use 🪳 bug Something isn't working 🧑‍💻 dev experience developer experience (excluding CI) 📖 documentation Improvements or additions to documentation 🐍 Python API Python logging API
Projects
None yet
Development

No branches or pull requests

2 participants