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

Attempt to fix issue with doc building on Mac/Windows #436

Merged
merged 5 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:

# Doc dependencies
- sphinx
- pydata-sphinx-theme==0.13.3
- pydata-sphinx-theme
- sphinx-book-theme>=1.0
- sphinx-gallery
- sphinx-design
Expand Down
2 changes: 1 addition & 1 deletion examples/analysis/point_extraction/reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
coords = rast.coords(grid=True)
x_closest = rast.copy(new_array=coords[0]).value_at_coords(x=x_coords, y=y_coords).squeeze()
y_closest = rast.copy(new_array=coords[1]).value_at_coords(x=x_coords, y=y_coords).squeeze()
from shapely import box
from shapely.geometry import box

geometry = [
box(x - 2 * rast.res[0], y - 2 * rast.res[1], x + 2 * rast.res[0], y + 2 * rast.res[1])
Expand Down
27 changes: 11 additions & 16 deletions tests/test_doc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Functions to test the documentation."""
import os
import platform
import shutil

import sphinx.cmd.build
Expand All @@ -13,20 +12,16 @@ class TestDocs:
def test_build(self) -> None:
"""Try building the documentation and see if it works."""
# Remove the build directory if it exists.
if os.path.isdir(os.path.join(self.docs_dir, "build/")):
shutil.rmtree(os.path.join(self.docs_dir, "build/"))

# Test only on Linux
if platform.system() == "Linux":
# Remove the build directory if it exists.
if os.path.isdir(os.path.join(self.docs_dir, "build/")):
shutil.rmtree(os.path.join(self.docs_dir, "build/"))
return_code = sphinx.cmd.build.main(
[
"-j",
"1",
os.path.join(self.docs_dir, "source/"),
os.path.join(self.docs_dir, "build/"),
]
)

return_code = sphinx.cmd.build.main(
[
"-j",
"1",
os.path.join(self.docs_dir, "source/"),
os.path.join(self.docs_dir, "build/"),
]
)

assert return_code == 0
assert return_code == 0
Loading