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

fixing relpath bug #149

Merged
merged 1 commit into from
Apr 13, 2020
Merged

fixing relpath bug #149

merged 1 commit into from
Apr 13, 2020

Conversation

choldgraf
Copy link
Member

This is a bug that is difficult to reproduce because it only happens when you build the documentation from a folder that is not strictly in the parent tree of the build folder. By that I mean a folder structure like this:

This works:

# Path to documentation
run/build/from/this/folder/path/to/docs
# Sphinx build command is run from here
run/build/from/this/folder

This raises an error:

# Path to documentation
run/build/from/this/folder/path/to/docs
# Sphinx build command is run from here
run/build/from/this/other/folder

The problem is in Pathlib somewhere when it is calling relative_to. This method only works if the two items share the same root, which isn't true in the second case above. So this PR just uses relpath.

@codecov
Copy link

codecov bot commented Apr 13, 2020

Codecov Report

Merging #149 into master will not change coverage by %.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #149   +/-   ##
=======================================
  Coverage   83.85%   83.85%           
=======================================
  Files           9        9           
  Lines         805      805           
=======================================
  Hits          675      675           
  Misses        130      130           
Flag Coverage Δ
#pytests 83.85% <100.00%> (ø)
Impacted Files Coverage Δ
myst_nb/cache.py 78.44% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b15d893...24ea6c3. Read the comment docs.

@choldgraf choldgraf merged commit bb4f754 into master Apr 13, 2020
@choldgraf choldgraf deleted the relpath_bug branch April 13, 2020 04:25
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

Successfully merging this pull request may close these issues.

None yet

1 participant