-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework theme to utilise
sphinx-theme-builder
Restructure the repository to be compatible with `sphinx-theme-builder` and switch away from setuptools. This enables excluding the generated assets from version control, since `sphinx-theme-builder` will generate them, when generating the wheel. Replace the usage of `yarn` with vanilla `npm`, to be more compatible with `sphinx-theme-builder`, and for reducing the complexity in the setup. Explicitly declare that this theme uses the latest 14.x LTS release of NodeJS. Simplify `noxfile.py` since it is no longer necessary to use conda for fetching the theme's non-Python dependencies. It happens transparently in a `pip` based workflow. Use `stb serve` for serving documentation, in `noxfile.py`. Move `flake8` configuration into a flake8-specific file.
- Loading branch information
Showing
67 changed files
with
154 additions
and
16,283 deletions.
There are no files selected for viewing
File renamed without changes.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,75 +1,21 @@ | ||
import nox | ||
from pathlib import Path | ||
from yaml import safe_load | ||
|
||
nox.options.reuse_existing_virtualenvs = True | ||
|
||
# Parse the environment files we'll need later | ||
environment = safe_load(Path("environment.yml").read_text()) | ||
conda = environment.get("dependencies") | ||
requirements = conda.pop(-1).get("pip") | ||
build_command = ["-b", "html", "docs", "docs/_build/html"] | ||
|
||
|
||
@nox.session(venv_backend="conda") | ||
def build(session): | ||
_install_environment(session) | ||
session.run("yarn", "build") | ||
|
||
|
||
@nox.session(venv_backend="conda") | ||
@nox.session | ||
def docs(session): | ||
_install_environment(session) | ||
session.cd("docs") | ||
session.run("make", "html") | ||
session.install(".[doc]") | ||
session.run("sphinx-build", "-b=html", "docs/", "docs/_build/html") | ||
|
||
|
||
@nox.session(name="docs-live", venv_backend="conda") | ||
@nox.session(name="docs-live") | ||
def docs_live(session): | ||
_install_environment(session) | ||
# fmt: off | ||
session.run( | ||
"sphinx-autobuild", | ||
"--watch", "pydata_sphinx_theme", | ||
"--watch", "src", | ||
"--pre-build", "yarn build", | ||
"--re-ignore", "pydata_sphinx_theme/static/.*", | ||
"--re-ignore", "pydata_sphinx_theme/static/theme.conf", | ||
"--re-ignore", "_build/.*", | ||
"--delay", "2", | ||
"--port", "0", | ||
"--open-browser", | ||
"-n", "-b", "html", "docs/", "docs/_build/html" | ||
) | ||
# fmt: on | ||
session.install("sphinx-theme-builder[cli]") | ||
session.run("stb", "serve", "docs", "--open-browser") | ||
|
||
|
||
@nox.session(name="test", venv_backend="conda") | ||
@nox.session(name="test") | ||
def test(session): | ||
_install_environment(session, yarn=False) | ||
session.install(".[test]") | ||
session.install("-e", ".[test]") | ||
session.run("pytest", *session.posargs) | ||
|
||
|
||
def _install_environment(session, yarn=True): | ||
"""Install the JS and Python environment needed to develop the theme.""" | ||
# Assume that if sphinx is already installed, we don't need to re-install | ||
try: | ||
bin = Path(session.bin) | ||
except ValueError: | ||
# we are in a pass-through environment, just return and not install anything | ||
return | ||
|
||
if list(bin.rglob("sphinx-build")) and "reinstall" not in session.posargs: | ||
return | ||
|
||
# Install JS and Python dependencies | ||
session.conda_install("--channel", "conda-forge", *conda) | ||
for pkg in requirements: | ||
# We split each line in case there's a space for `-r` | ||
session.install(*pkg.split()) | ||
session.install("-e", ".") | ||
|
||
# Build JS packages | ||
if yarn: | ||
session.run("yarn", "--frozen-lockfile") |
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 was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
pydata_sphinx_theme/static/css/index.38f2ebe09480739b4ba0fa585d02b29a.css
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
pydata_sphinx_theme/static/js/index.30d17a8aef5d942e5d26.js
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
pydata_sphinx_theme/static/vendor/fontawesome/5.13.0/LICENSE.txt
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
pydata_sphinx_theme/static/vendor/fontawesome/5.13.0/css/all.min.css
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-130 KB
pydata_sphinx_theme/static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.eot
Binary file not shown.
Oops, something went wrong.