Skip to content

Fix Sphinx extension relative image path for out of source builds #3513

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

Merged

Conversation

clauniel
Copy link
Contributor

@clauniel clauniel commented Sep 30, 2024

The use of relative_to causes a failure when building Sphinx documentation using an out of source build because it cannot create a relative path by walking up through parent directories prior to the walk_up option available in Python 3.12

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

Failure to include generated images when using out of source Sphinx builds.

What is the new behavior?

Out of source Sphinx builds are supported.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@github-actions github-actions bot added the python Pull requests that update Python code label Sep 30, 2024
@clauniel clauniel force-pushed the fix-relative-directory-parent-sphinx-error branch from e08fc84 to 3537b09 Compare September 30, 2024 12:43
@danyeaw danyeaw added fix A fix for a bug and removed python Pull requests that update Python code labels Sep 30, 2024
@danyeaw
Copy link
Member

danyeaw commented Sep 30, 2024

Hi @clauniel, thanks so much for the contribution! It looks like the CI is flagging a lint error, you can resolve it locally with pre-commit run --all-files. To run pre-commit as part of git workflow, use pre-commit install. If you need us to push a lint fix for you, we would be glad to do that as well. Thanks!

The use of `relative_to` causes a failure when building Sphinx documentation
using an out of source build because it cannot create a relative path by walking
up through parent directories prior to the `walk_up` option available in Python 3.12
@clauniel clauniel force-pushed the fix-relative-directory-parent-sphinx-error branch from 3537b09 to 0b29343 Compare September 30, 2024 14:03
@github-actions github-actions bot added the python Pull requests that update Python code label Sep 30, 2024
@clauniel
Copy link
Contributor Author

Thanks for pointing that out, I missed the poetry environment activation.

Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @clauniel!

@danyeaw danyeaw removed the python Pull requests that update Python code label Sep 30, 2024
@danyeaw danyeaw merged commit 4fa6f4b into gaphor:main Sep 30, 2024
21 checks passed
@danyeaw
Copy link
Member

danyeaw commented Sep 30, 2024

@all-contributors please add @clauniel for code

Copy link
Contributor

@danyeaw

I've put up a pull request to add @clauniel! 🎉

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

Successfully merging this pull request may close these issues.

2 participants