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

Do not change working directory to _quarto.yml directory #292

Closed
machow opened this issue Oct 11, 2023 · 1 comment
Closed

Do not change working directory to _quarto.yml directory #292

machow opened this issue Oct 11, 2023 · 1 comment

Comments

@machow
Copy link
Owner

machow commented Oct 11, 2023

Currently when running quartodoc build ... we change the working directory to be the one holding _quarto.yml. This is to support specifying a custom quartodoc renderer inside your quarto project. (see PRQL/pyprql#272)

One downside of this approach is that a user might be able to import their package from root (due to it being in the working directory), but not import it when we change the working directory to be a docs/ subfolder.

Let's append the docs/ subfoldersys.path instead. This has 2 advantages:

  • anything in a docs/ subfolder will have least precedence when importing.
  • behaviors that lean on the working directory being wherever quartodoc build ... was run from are preserved.
@machow machow added this to quartodoc Oct 11, 2023
@machow machow moved this to Todo in quartodoc Oct 11, 2023
@machow
Copy link
Owner Author

machow commented Oct 20, 2023

Should be resolved in https://github.com/machow/quartodoc/releases/tag/v0.6.4.

I ended up keeping the behavior of changing directories, but quartodoc now appends the currently directory to the end of sys.path (so if you were depending on it to import anything, it should hopefully still work)

@machow machow closed this as completed Oct 20, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in quartodoc Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant