-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Lint: call tools inside venv using make's PYTHON #2408
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,46 @@ | ||
# Builds PEP files to HTML using sphinx | ||
|
||
PYTHON=python3 | ||
VENV_DIR=venv | ||
VENVDIR=venv | ||
JOBS=8 | ||
RENDER_COMMAND=$(PYTHON) build.py -j $(JOBS) | ||
RENDER_COMMAND=$(VENVDIR)/bin/python3 build.py -j $(JOBS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If one installs A There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AA-Turner correct, this is Unix-only. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do have |
||
|
||
render: | ||
render: venv | ||
$(RENDER_COMMAND) | ||
|
||
pages: rss | ||
pages: venv rss | ||
$(RENDER_COMMAND) --build-dirs | ||
|
||
fail-warning: | ||
fail-warning: venv | ||
$(RENDER_COMMAND) --fail-on-warning | ||
|
||
check-links: | ||
check-links: venv | ||
$(RENDER_COMMAND) --check-links | ||
|
||
rss: | ||
$(PYTHON) generate_rss.py | ||
rss: venv | ||
$(VENVDIR)/bin/python3 generate_rss.py | ||
|
||
clean: | ||
clean: clean-venv | ||
-rm -rf build | ||
|
||
venv: | ||
$(PYTHON) -m venv $(VENV_DIR) | ||
./$(VENV_DIR)/bin/python -m pip install -r requirements.txt | ||
|
||
lint: | ||
pre-commit --version > /dev/null || $(PYTHON) -m pip install pre-commit | ||
pre-commit run --all-files | ||
clean-venv: | ||
rm -rf $(VENVDIR) | ||
|
||
spellcheck: | ||
pre-commit --version > /dev/null || $(PYTHON) -m pip install pre-commit | ||
pre-commit run --all-files --hook-stage manual codespell | ||
venv: | ||
@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 -U pip setuptools; \ | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt; \ | ||
echo "The venv has been created in the $(VENVDIR) directory"; \ | ||
fi | ||
|
||
lint: venv | ||
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit | ||
$(VENVDIR)/bin/python3 -m pre_commit run --all-files | ||
|
||
spellcheck: venv | ||
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit | ||
$(VENVDIR)/bin/python3 -m pre_commit run --all-files --hook-stage manual codespell |
Uh oh!
There was an error while loading. Please reload this page.