landmaj / mkdocs-d2-plugin

A plugin for embedding D2 diagrams in MkDocs.
https://landmaj.github.io/mkdocs-d2-plugin/
MIT License
22 stars 4 forks source link

go installed d2 version #9

Closed ss185994 closed 6 months ago

ss185994 commented 6 months ago

previously (v1.1.0) worked but now I get this error:

 ...
  File "/home/scott/.cache/bazel/_bazel_scott/a6c0cae1c499521202c68dd96735be2b/execroot/_main/bazel-out/k8-fastbuild/bin/docs/mkdocs.runfiles/pip_mkdocs_d2_plugin/site-packages/d2/plugin.py", line 42, in on_config
    d2_version = version.parse(result.stdout.decode().strip())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/scott/.cache/bazel/_bazel_scott/a6c0cae1c499521202c68dd96735be2b/execroot/_main/bazel-out/k8-fastbuild/bin/docs/mkdocs.runfiles/pip_packaging/site-packages/packaging/version.py", line 52, in parse
    return Version(version)
           ^^^^^^^^^^^^^^^^
  File "/home/scott/.cache/bazel/_bazel_scott/a6c0cae1c499521202c68dd96735be2b/execroot/_main/bazel-out/k8-fastbuild/bin/docs/mkdocs.runfiles/pip_packaging/site-packages/packaging/version.py", line 198, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: 'v0.6.3-HEAD'

Looks like this section was recently updated: https://github.com/landmaj/mkdocs-d2-plugin/blob/74aa773d1785ae29daf686a68c5b8c1c50f9a478/d2/plugin.py#L42

landmaj commented 6 months ago

The library I used for version parsing is Python-centered, so it choked on Go module number with git commit info. I uploaded version 1.2.3 with a fix.

ss185994 commented 6 months ago

The library I used for version parsing is Python-centered, so it choked on Go module number with git commit info. I uploaded version 1.2.3 with a fix.

thanks for the quick fix