Skip to content

Commit 2dd7518

Browse files
committed
Check in a Makefile that includes automatic provisioning of the venv.
There was already a Makefile in local be folks locally - extend this with tricks to create the virtual env and install any requisite dependencies within it. The added targets should also notice future dependency changes. While here also add setuptools as an explicit dependency in order to allow operation on Pyhton 3.12+ where it is no longer an included battery.
1 parent c198b79 commit 2dd7518

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[Makefile]
8+
indent_style = tab
9+
indent_size = 8

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ styles/
148148

149149
# Ignore build dir in Sphinx + more
150150
.venv/
151-
Makefile
152151
build/
153152
docs/build
154153
index.deprecated

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
SPHINXBUILD = ./.venv/bin/sphinx-build
2+
SPHINXOPTS =
3+
SOURCEDIR = docs
4+
BUILDDIR = build
5+
6+
# Put it first so that "make" without argument is like "make help".
7+
.PHONY: help
8+
help: dependencies
9+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
10+
11+
./.venv/pyvenv.cfg:
12+
@echo "provisioning environment"
13+
@/usr/bin/env python3 -m venv ./.venv
14+
15+
.PHONY: dependencies
16+
dependencies: ./.venv/pyvenv.cfg ./requirements.txt
17+
@echo "installing dependencies"
18+
@./.venv/bin/pip3 install -r ./requirements.txt
19+
20+
./requirements.txt:
21+
@
22+
23+
# Catch-all target: route all unknown targets to Sphinx using the new
24+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
25+
.PHONY: Makefile
26+
%: Makefile
27+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
setuptools
12
sphinx==7.2.3
23
sphinx_rtd_theme==1.3.0
34
sphinxemoji==0.2.0

0 commit comments

Comments
 (0)