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

Regression with mkdocstrings>=23.0.0 dependency #8

Closed
wesleykendall opened this issue Dec 6, 2023 · 6 comments
Closed

Regression with mkdocstrings>=23.0.0 dependency #8

wesleykendall opened this issue Dec 6, 2023 · 6 comments

Comments

@wesleykendall
Copy link

Hello, thanks for this wonderful plugin!

I noticed my doc builds started failing whenever mkdocstrings was upgraded to 0.24.0. If I upgrade this package in my environment, the same-dir plugin fails with the following message:

  File ".../mkdocs_same_dir/plugin.py", line 40, in _replace_validation
    config["docs_dir"] = os.path.join(config["docs_dir"], ".")
                                      ~~~~~~^^^^^^^^^^^^
KeyError: 'docs_dir'

Thought I'd report this here for now since I'm not sure how another plugin would interfere with this one. For now I simply pin mkdocstrings to 0.23.0

@oprypin
Copy link
Owner

oprypin commented Dec 6, 2023

Hmm it works for me, I don't observe the same error. You should share your site that exhibits this

@oprypin
Copy link
Owner

oprypin commented Dec 8, 2023

Let me know if you have more to share

@oprypin oprypin closed this as completed Dec 8, 2023
@vstrimaitis
Copy link

Hey! Just encountered the same issue with mkdocstrings==0.24.0 and mkdocs-same-dir==0.1.2. As a workaround, I can set the mkdocs.yml config like so:

plugins:
- mkdocstrings:
    docs_dir: .  # this does nothing, but fixes the KeyError
    # ...
# ...

but that's not nice 😁

Here's a small docs/mkdocs.yml file to reproduce the issue:

site_name: Test
docs_dir: .
site_dir: ../site
repo_name: test-repo
plugins:
- same-dir
- mkdocstrings

Notice that same-dir comes before mkdocstrings. If I put it after, the exception is not raised.

Also here's my pyproject.toml file that I used to reproduce the issue (run poetry install --no-root to set everything up):

[tool.poetry]
name = "repro"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.9"
mkdocstrings = "0.24.0"
mkdocs-same-dir = "0.1.2"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

@wesleykendall
Copy link
Author

Thanks @vstrimaitis , I confirmed that this worked for me, although it does produce a warning WARNING - Config value 'plugins': Plugin 'mkdocstrings' option 'docs_dir': Unrecognised configuration name: docs_dir

@oprypin oprypin reopened this Jan 31, 2024
@oprypin
Copy link
Owner

oprypin commented Jan 31, 2024

I don't know why I wasn't able to reproduce it, but I think I understand why this happens and I'll release a fix now - in ~minutes

@wesleykendall
Copy link
Author

New version works for me, thanks so much!

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

No branches or pull requests

3 participants