8000 Update `venv` and `clean` make targets by ezio-melotti · Pull Request #856 · python/devguide · GitHub
[go: up one dir, main page]

Skip to content

Update venv and clean make targets #856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update the venv command in the Makefile.
  • Loading branch information
ezio-melotti committed May 6, 2022
commit 194fbd72f0b6430fb841d0f91a9a08f11c8c2f91
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@

# You can set these variables from the command line.
PYTHON = python3
VENVDIR = ./venv
BUILDDIR = _build
SPHINXOPTS =
SPHINXBUILD = ./venv/bin/sphinx-build
SPHINXBUILD = $(VENVDIR)/bin/sphinx-build
PAPER =
BUILDDIR = _build

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp \
.PHONY: help venv clean html dirhtml singlehtml pickle json htmlhelp qthelp \
devhelp epub latex latexpdf text man changes linkcheck doctest htmlview check

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " venv to create a venv with necessary tools"
@echo " html to make standalone HTML files"
@echo " htmlview to open the index page built by the html target in your browser"
@echo " dirhtml to make HTML files named index.html in directories"
Expand All @@ -41,9 +43,15 @@ clean:
-rm -rf $(BUILDDIR)/*

venv:
$(PYTHON) -m venv venv
./venv/bin/python3 -m pip install --upgrade pip
./venv/bin/python3 -m pip install -r requirements.txt
@if [ -d $(VENVDIR) ] ; then \
echo "venv already exists."; \
echo "To recreate it, remove it first with \`make clean-venv'."; \
else \
$(PYTHON) -m venv $(VENVDIR); \
$(VENVDIR)/bin/python3 -m pip install --upgrade pip; \
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt; \
echo "The venv has been created in the $(VENVDIR) directory"; \
fi

html: venv
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down
0