Add preparation step for Jekyll deployment and include static files#4631
Conversation
| rm -rf .apidoc_merge | ||
| rm apidoc/*.rst | ||
| mv html/pymatgen*.html . | ||
| mv html/modules.html . |
There was a problem hiding this comment.
Great! thanks for fixing this. I have no experience with sphinx/jekyll, but I think the copy step could just go here for simplicity?
There was a problem hiding this comment.
I did it this way to create a clear boundary. the cp -r command must be run after the sphinx-build command. while I could put it at the end of the block, I wanted to create no confusion if the order gets messed up.
There was a problem hiding this comment.
I think both HTML and static are built by sphinx, looks quite confusing to me to copy HTML first and then in another step copy static?
There was a problem hiding this comment.
That is a fair point. would you prefer a collapse into that block or all rm/mv/cp commands be moved to a more operational block?
There was a problem hiding this comment.
maybe let's combine them? making this workflow shorter would make later reading/debug a bit easier (personally)...
There was a problem hiding this comment.
pymatgen doesn't have docs optional dependency
WARNING: pymatgen 2026.3.23 does not provide the extra 'docs'
it's currently declared via uv dependency group docs
these two steps (pip install pymatgen and then sphinx) could just be uv sync --group docs
There was a problem hiding this comment.
can you also help me remove docs from default dependency group (and that TODO)? I believe it's not needed anymore
Lines 283 to 285 in f475a89
There was a problem hiding this comment.
Updated to use uv sync --group docs and removed docs from the default groups
There was a problem hiding this comment.
these two sphinx commands should be called via uv instead, i.e. uv run sphinx-xxx ...
There was a problem hiding this comment.
Updated to use uv commands here
| working-directory: docs | ||
| run: | | ||
| cp -r html/_static _static | ||
| touch .nojekyll |
There was a problem hiding this comment.
Curious what does .nojekyll do (as i don't have experience with jekyll at all)? I see here:
It is now possible to completely bypass Jekyll processing on GitHub Pages by creating a file named .nojekyll in the root of your pages repo and pushing it to GitHub.
But I think in the _config.yml there is already an explicit include: _static tag? does these two serve different purposes?
This should only be necessary if your site uses files or directories that start with underscores since Jekyll considers these to be special resources and does not copy them to the final site.
There was a problem hiding this comment.
It does not. it's an extra extra guard. I usually like to add protections in multiple places as long as it's functionally consistent. just a quirk of mine, happy to remove if you don't feel it's necessary.
There was a problem hiding this comment.
I guess we're not talking about security where we need layers of defense here... personally I think if one config gets the job done then we might not need to duplicate here (less confusion for later readers... people like me would think they're serving different purposes)
…ion and remove docs from default groups in pyproject.toml
|
I noticed the links to sources are not working (for both core and non-core modules), not sure if you would have time for a look? @cogsworth37 For example for non-core # Current URL generated in docs
- https://github.com/materialsproject/src/pymatgen/ext/optimade.py
# Correct URL
+ https://github.com/materialsproject/pymatgen/blob/master/src/pymatgen/ext/optimade.py
For core # Current URL generated in docs
- https://github.com/materialsproject/pymatgen/blob/v2026.4.7/src/pymatgen/core/ion.py
# Correct URL
+ https://github.com/materialsproject/pymatgen-core/blob/main/src/pymatgen/core/ion.py
|
|
The sources are in different locations. The core classes are in the pymatgen-core repo. Actually, we can also just use the submodule since it is already linked. |



Summary
Major changes:
Fixes broken styles/JS introduced by #4626 — the CI migration didn't account for Sphinx asset handling.
Checklist
ruff.mypy.duecredit@due.dcitedecorators to reference relevant papers by DOI (example)Tip: Install
pre-commithooks to auto-check types and linting before every commit: