Skip to content

Commit c65bc25

Browse files
authored
Merge branch 'develop' into sgserde
2 parents db006fc + 1ae6903 commit c65bc25

15 files changed

Lines changed: 192 additions & 4081 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ jobs:
3737
packages-dir: ./${{ matrix.package }}/dist/
3838

3939
docs:
40+
if: github.repository_owner == 'materialsproject' && github.ref == 'refs/heads/main'
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
4044
runs-on: ubuntu-latest
4145
needs:
4246
- deploy
@@ -63,31 +67,24 @@ jobs:
6367
python${{ matrix.python-version }} -m pip install --user `grep numpy emmet-api/requirements/${{ matrix.os }}_py${{ matrix.python-version }}_extras.txt`
6468
python${{ matrix.python-version }} -m piptools sync --user emmet-api/requirements/${{ matrix.os }}_py${{ matrix.python-version }}_extras.txt
6569
66-
- name: Generate changelog
67-
uses: charmixer/auto-changelog-action@v1
68-
with:
69-
token: ${{ secrets.GITHUB_TOKEN }}
70-
exclude_labels: dependencies
71-
72-
- name: Commit files
73-
run: |
74-
git config --local user.email "feedback@materialsproject.org"
75-
git config --local user.name "materialsproject"
76-
git stash
77-
git pull origin main
78-
mv CHANGELOG.md docs/
79-
git add docs/CHANGELOG.md && git commit -m 'Updated CHANGELOG.md'
80-
81-
- name: Push changes
82-
uses: ad-m/github-push-action@master
83-
with:
84-
github_token: ${{ secrets.GITHUB_TOKEN }}
70+
# TODO: To install graphiz and therefore use erdantic to draw pydantic models:
71+
# - name: Install graphviz
72+
# run: |
73+
# # Required to generate entity-relationship diagrams for pydantic with erdantic
74+
# # mac users should `brew install graphviz`, then
75+
# # `CC=gcc CPPFLAGS="-I$(brew --prefix graphviz)/include" LDFLAGS="-L$(brew --prefix graphviz)/lib" pip install pygraphviz`
76+
# # See: https://github.com/pygraphviz/pygraphviz/issues/572
77+
# sudo apt install graphviz
78+
# sudo apt install graphviz-dev
8579

8680
- name: Build
87-
run: mkdocs build
81+
run: sphinx-build docs docs/_build
8882

89-
- name: Deploy
90-
uses: peaceiris/actions-gh-pages@v4.0.0
83+
- name: Upload build artifact
84+
uses: actions/upload-pages-artifact@v3
9185
with:
92-
github_token: ${{ secrets.GITHUB_TOKEN }}
93-
publish_dir: ./site
86+
path: ./docs/_build
87+
88+
- name: Deploy to GitHub Pages
89+
id: deployment
90+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ instance/
6464

6565
# Sphinx documentation
6666
docs/_build/
67+
docs/_reference/
68+
*.doctrees*
6769

6870
# PyBuilder
6971
target/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ![Emmet](docs/images/logo_w_text.svg)
22

3-
[![Pytest Status](https://github.com/materialsproject/emmet/workflows/testing/badge.svg)](https://github.com/materialsproject/emmet/actions?query=workflow%3Atesting)
3+
[![Pytest Status](https://github.com/materialsproject/emmet/actions/workflows/testing.yml/badge.svg?branch=main)](https://github.com/materialsproject/emmet/actions?query=workflow%3Atesting+branch%3Amain)
44
[![Code Coverage](https://codecov.io/gh/materialsproject/emmet/branch/main/graph/badge.svg)](https://codecov.io/gh/materialsproject/emmet)
55

66
The Materials API Toolkit for the Materials Project. Emmet defines the core models, data pipelines, the API server, and the convenience CLI.

docs/CHANGELOG.md

Lines changed: 0 additions & 4022 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{ name | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. auto{{ objtype }}:: {{ objname }}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{ name | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
:show-inheritance:
7+
:members:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{ name | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autofunction:: {{ objname }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{% extends "!autosummary/module.rst" %}
2+
3+
{# This file is almost the same as the default, but adds :toctree: and :nosignatures: to
4+
the autosummary directives. The original can be found at
5+
``sphinx/ext/autosummary/templates/autosummary/module.rst``. #}
6+
7+
{% block attributes %}
8+
{% if attributes %}
9+
.. rubric:: Module Attributes
10+
11+
.. autosummary::
12+
:toctree:
13+
:nosignatures:
14+
{% for item in attributes %}
15+
{{ item }}
16+
{%- endfor %}
17+
{% endif %}
18+
{% endblock %}
19+
20+
{% block functions %}
21+
{% if functions %}
22+
.. rubric:: Functions
23+
24+
.. autosummary::
25+
:toctree:
26+
:nosignatures:
27+
{% for item in functions %}
28+
{{ item }}
29+
{%- endfor %}
30+
{% endif %}
31+
{% endblock %}
32+
33+
{% block classes %}
34+
35+
{% set types = [] %}
36+
{% for item in members %}
37+
{% if not item.startswith('_') and not (item in functions or item in attributes or item in exceptions) %}
38+
{% set _ = types.append(item) %}
39+
{% endif %}
40+
{%- endfor %}
41+
42+
{% if types %}
43+
.. rubric:: Classes
44+
45+
.. autosummary::
46+
:toctree:
47+
:nosignatures:
48+
{% for item in types %}
49+
{{ item }}
50+
{%- endfor %}
51+
52+
{% endif %}
53+
{% endblock %}

docs/conf.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# ruff: noqa: E501
2+
3+
"""Sphinx configuration file."""
4+
5+
import os
6+
import sys
7+
8+
sys.path.insert(0, os.path.abspath("../../"))
9+
project = "emmet"
10+
copyright = "2025, The Materials Project"
11+
12+
extensions = [
13+
"myst_parser",
14+
"sphinx.ext.autodoc",
15+
"sphinx.ext.autosummary",
16+
"sphinx_autodoc_typehints",
17+
]
18+
19+
# Add any paths that contain templates here, relative to this directory.
20+
templates_path = ["_templates"]
21+
22+
exclude_patterns = ["emmet-builders-legacy", "emmet-cli-legacy", "test*.py"]
23+
24+
source_suffix = {".rst": "restructuredtext", ".md": "restructuredtext"}
25+
26+
language = "en"
27+
28+
# autodoc options
29+
# use type hints
30+
autodoc_typehints = "description"
31+
autosummary_imported_members = False
32+
autodoc_preserve_defaults = True
33+
autoclass_content = "class"
34+
autodoc_member_order = "bysource"
35+
36+
# don't overwrite summary but generate them if they don't exist
37+
autosummary_generate = True
38+
autosummary_generate_overwrite = True
39+
40+
# Should erdantic work in the future with our pydantic models, uncomment these:
41+
# autodoc_pydantic_model_show_json = False
42+
# autodoc_pydantic_model_erdantic_figure = True
43+
# graphviz_output_format = "svg"
44+
45+
# HTML styling
46+
html_theme = "sphinx_rtd_theme"
47+
html_show_sphinx = False
48+
html_show_sourcelink = False
49+
html_title = "emmet"

docs/core.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)