From 8d51889080fcfbfe13781b3f0d65f081ab36abc0 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 18 Nov 2021 15:40:05 +0100 Subject: [PATCH 1/2] Fix Makefile to use tox for docs --- .gitignore | 1 - Makefile | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index d3d20557ab..ac56fbb1b9 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,3 @@ dist build proxy/public -docs/_build diff --git a/Makefile b/Makefile index 9eebd4ac5a..d98c85a771 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,6 @@ lib-dep: -r requirements-testing.txt \ -r requirements-release.txt \ -r requirements-tunnel.txt \ - -r docs/requirements.txt lib-lint: python -m tox -e lint @@ -115,14 +114,8 @@ lib-release: lib-package twine upload dist/* lib-doc: - pushd docs && \ - python -m sphinx \ - --keep-going \ - -b dirhtml \ - -d _build/doctrees \ - -D language=en . _build/html && \ - popd && \ - open docs/_build/html/index.html + python -m tox -e lint && \ + xdg-open .tox/build-docs/docs_out/index.html lib-coverage: pytest --cov=proxy --cov=tests --cov-report=html tests/ From bf73a5ec4126c2789ee06869fc61ed43b631ae97 Mon Sep 17 00:00:00 2001 From: Abhinav Singh <126065+abhinavsingh@users.noreply.github.com> Date: Fri, 19 Nov 2021 14:15:12 +0530 Subject: [PATCH 2/2] Resolve `open` based upon operating system --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d98c85a771..d34b72c2e7 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,12 @@ CA_KEY_FILE_PATH := ca-key.pem CA_CERT_FILE_PATH := ca-cert.pem CA_SIGNING_KEY_FILE_PATH := ca-signing-key.pem +OPEN=$(shell which open) +UNAME := $(shell uname) +ifeq ($(UNAME), Linux) +OPEN=$(shell which xdg-open) +endif + .PHONY: all https-certificates sign-https-certificates ca-certificates .PHONY: lib-check lib-clean lib-test lib-package lib-coverage lib-lint lib-pytest .PHONY: lib-release-test lib-release lib-profile lib-doc @@ -115,11 +121,11 @@ lib-release: lib-package lib-doc: python -m tox -e lint && \ - xdg-open .tox/build-docs/docs_out/index.html + $(OPEN) .tox/build-docs/docs_out/index.html lib-coverage: pytest --cov=proxy --cov=tests --cov-report=html tests/ - open htmlcov/index.html + $(OPEN) htmlcov/index.html lib-profile: sudo py-spy record -o profile.svg -t -F -s -- python -m proxy