-
Notifications
You must be signed in to change notification settings - Fork 5
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
Generate documentation with Windows #196
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d1b06b2
Add a docs-generating batch file for Windows users, add a workflow to…
Zeitsperre 6f9ff03
try using conda
Zeitsperre 17529a8
adjustments
Zeitsperre 47354e5
use powershell by default
Zeitsperre 2c872d9
try mocking esmf dependencies
Zeitsperre 483c058
try pinning esmf higher, call to batch file
Zeitsperre 581d646
try a workaround for esmpy
Zeitsperre 4965548
try pinning importlib-metadata
Zeitsperre 4f53eac
update CHANGELOG.rst, remove testing workflow
Zeitsperre 7db2760
Merge branch 'main' into add-bat-file
Zeitsperre b0a83e0
support for WindowsPath, fix bug with old entries
RondeauG acc679b
Merge remote-tracking branch 'origin/add-bat-file' into add-bat-file
RondeauG 8a4bfc8
split batch file, update CHANGELOG.rst
Zeitsperre 801845f
Merge branch 'main' into add-bat-file
Zeitsperre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@echo off | ||
rem Batch script to clean docs artifacts and generate Sphinx HTML documentation | ||
|
||
rem Remove docs/notebooks/_data/ | ||
if exist docs\notebooks\_data\ ( | ||
rd /s /q docs\notebooks\_data\ | ||
) | ||
|
||
rem Remove docs/notebooks/.ipynb_checkpoints/ | ||
if exist docs\notebooks\.ipynb_checkpoints\ ( | ||
rd /s /q docs\notebooks\.ipynb_checkpoints\ | ||
) | ||
|
||
rem Remove specific rst files from docs/apidoc | ||
del /q docs\apidoc\xhydro*.rst | ||
del /q docs\apidoc\modules.rst | ||
|
||
rem Generate API documentation | ||
sphinx-apidoc -o docs\apidoc --private --module-first src\xhydro | ||
|
||
rem Generate Sphinx HTML documentation in English | ||
call docs\make.bat html "-D language=en" | ||
|
||
rem Generate Sphinx HTML documentation in French | ||
call docs\make.bat html "-D language=fr" | ||
|
||
if %ERRORLEVEL% neq 0 ( | ||
echo Error occurred during documentation generation. | ||
exit /b %ERRORLEVEL% | ||
) | ||
|
||
echo Documentation generation completed successfully. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@echo off | ||
rem Batch script to handle translation work | ||
|
||
rem Remove French locale .mo files | ||
del /q docs\locales\fr\LC_MESSAGES\*.mo | ||
|
||
rem Generate gettext files | ||
sphinx-build -b gettext docs docs\_build\gettext | ||
|
||
rem Run sphinx-intl update | ||
sphinx-intl update -p docs\_build\gettext -d docs\locales -l fr | ||
|
||
if %ERRORLEVEL% neq 0 ( | ||
echo Error occurred during translation update. | ||
exit /b %ERRORLEVEL% | ||
) | ||
|
||
echo Translation update completed successfully. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a danger to pin this for everyone?
Also, I don't know exactly why this is required for it to work on GitHub, but my local setup works with
importlib-metadata 8.4.0, esmpy 8.4.2, xesmf 0.8.7
without any issue...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I grabbed this fix from here: CLIMADA-project/climada_petals#132.
I don't think it is dangerous, but from my understanding, the fact that the metadata is corrupted in
esmpy
/esmf
, we need to have an older version here, otherwise this raisesValueErrors
on import.