Skip to content

Commit 6532d5b

Browse files
committed
sys.path.insert() the src/ path per conf.py
i.e. so you don't have to explicitly install things to build docs
1 parent cf56f46 commit 6532d5b

File tree

7 files changed

+20
-23
lines changed

7 files changed

+20
-23
lines changed

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ SPHINXOPTS ?= -W --keep-going
33
SOURCEDIR = spec
44
BUILDDIR = _site
55

6-
.PHONY: default install clean draft spec
6+
.PHONY: default clean draft spec
77

88
default: clean spec
99

10-
install:
11-
pip install -e .[doc]
12-
1310
clean:
1411
rm -rf $(BUILDDIR)
1512
find . -type d -name generated -exec rm -rf {} +

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ this array API standard.
2121
### Quickstart
2222

2323
To install the local stubs and additional dependencies of the Sphinx docs, you
24-
can use `make install`. Then just running `make` at the root of the repository
25-
should build the whole spec website.
24+
can use `pip install -r doc-requirements.txt`. Then just running `make` at the
25+
root of the repository should build the whole spec website.
2626

2727
```sh
28-
$ make install
28+
$ pip install -r doc-requirements.txt
2929
$ make
3030
$ ls _site/
3131
2021.12/ draft/ index.html latest/ versions.json
@@ -35,11 +35,9 @@ $ ls _site/
3535

3636
The spec website is comprised of multiple Sphinx docs (one for each spec version),
3737
all of which exist in `spec/` and rely on the modules found in `src/` (most
38-
notably `array_api_stubs`). `make install` aliases
39-
40-
```sh
41-
$ pip install -e .[doc] # ensure you install the dependencies extra "doc"
42-
```
38+
notably `array_api_stubs`). For purposes of building the docs, these `src/`
39+
modules do not need to be installed as they are added to the `sys.path` at
40+
runtime.
4341

4442
To build specific versions of the spec, run `sphinx-build` on the respective
4543
folder in `spec/`, e.g.

doc-requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
sphinx==4.3.0
2+
sphinx-material==0.0.30
3+
myst-parser
4+
sphinx_markdown_tables
5+
sphinx_copybutton
6+
docutils<0.18
7+
sphinx-math-dollar

pyproject.toml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ Source = "https://github.com/data-apis/array-api/"
1414
Documentation = "https://data-apis.org/array-api/"
1515
Homepage = "https://data-apis.org/"
1616

17-
[project.optional-dependencies]
18-
doc = [
19-
"sphinx==4.3.0",
20-
"sphinx-material==0.0.30",
21-
"myst-parser",
22-
"sphinx_markdown_tables",
23-
"sphinx_copybutton",
24-
"docutils<0.18",
25-
"sphinx-math-dollar",
26-
]
27-
2817
[build-system]
2918
requires = ["setuptools"]
3019
build-backend = "setuptools.build_meta"

spec/2021.12/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import sys
2+
from pathlib import Path
3+
sys.path.insert(0, str(Path(__file__).parents[2] / "src"))
24

35
from array_api_stubs import _2021_12 as stubs_mod
46
from _array_api_conf import *

spec/2022.12/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import sys
2+
from pathlib import Path
3+
sys.path.insert(0, str(Path(__file__).parents[2] / "src"))
24

35
from array_api_stubs import _2022_12 as stubs_mod
46
from _array_api_conf import *

spec/draft/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import sys
2+
from pathlib import Path
3+
sys.path.insert(0, str(Path(__file__).parents[2] / "src"))
24

35
from array_api_stubs import _draft as stubs_mod
46
from _array_api_conf import *

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy