mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-04 14:14:22 +08:00
Apply suggestions from code review
Co-authored-by: Richard Gowers <richardjgowers@users.noreply.github.com>
This commit is contained in:
@@ -5,17 +5,17 @@ Kayuza Takei
|
||||
Apache 2.0
|
||||
|
||||
Modified to:
|
||||
- Write directly to sphinx output directory
|
||||
- Infer targets if not given
|
||||
- Ensure `target: Path` in `configure_path()`
|
||||
- Return version number and thread safety from `setup()`
|
||||
- Use compressed style by default
|
||||
- More complete type checking
|
||||
- Write directly to Sphinx output directory
|
||||
- Infer targets if not given
|
||||
- Ensure ``target: Path`` in ``configure_path()``
|
||||
- Return version number and thread safety from ``setup()``
|
||||
- Use compressed style by default
|
||||
- More complete type checking
|
||||
"""
|
||||
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Dict, Optional, Union
|
||||
from typing import Optional, Union
|
||||
|
||||
|
||||
import sass
|
||||
@@ -27,9 +27,6 @@ from sphinx.util import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
Targets = Dict[Path, Path]
|
||||
|
||||
|
||||
def configure_path(conf_dir: str, src: Optional[Union[PathLike, Path]]) -> Path:
|
||||
if src is None:
|
||||
target = Path(conf_dir)
|
||||
@@ -40,7 +37,7 @@ def configure_path(conf_dir: str, src: Optional[Union[PathLike, Path]]) -> Path:
|
||||
return target
|
||||
|
||||
|
||||
def get_targets(app: Sphinx) -> Targets:
|
||||
def get_targets(app: Sphinx) -> dict[Path, Path]:
|
||||
src_dir = configure_path(app.confdir, app.config.sass_src_dir)
|
||||
dst_dir = configure_path(app.outdir, app.config.sass_out_dir)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ extensions = [
|
||||
]
|
||||
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3.7", None),
|
||||
"python": ("https://docs.python.org/3.9", None),
|
||||
"numpy": ("https://numpy.org/doc/stable", None),
|
||||
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
|
||||
"scikit.learn": ("https://scikit-learn.org/stable", None),
|
||||
|
||||
Reference in New Issue
Block a user