From 99f8f37de391eb5dbfedbe78c11391182b6f898e Mon Sep 17 00:00:00 2001 From: namuan <575441+namuan@users.noreply.github.com> Date: Sun, 31 May 2020 13:59:09 +0100 Subject: [PATCH] Tidying up Makefile and README --- Makefile | 16 ++++++---------- README.md | 15 ++++++--------- setup.py | 2 +- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 57fe03b..73e5140 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,6 @@ export PROJECTNAME=$(shell basename "$(PWD)") .SILENT: ; # no need for @ -setup: ## Setup virtual environment and install dependencies - echo "Run the following commands to install required dependencies" - echo "python3 -m venv venv" - echo "source venv/bin/activate" - echo "pip install -r requirements/dev.txt" - echo "Once everything is installed, 'make run' to run the application" - release: ## Step to prepare a new release echo "Instructions to prepare release" echo "Repo: http-rider: Increment version in httprider/__init__.py" @@ -30,9 +23,12 @@ deps: ## Reinstalls dependencies clean: ## Clean package rm -rf build dist -package: clean ## Rebuilds venv and packages app +setup: ## Re-initiates virtualenv rm -rf venv python3 -m venv venv + ./venv/bin/python3 -m pip install -r requirements/dev.txt + +package: clean ## Rebuilds venv and packages app ./venv/bin/python3 -m pip install -r requirements/build.txt export PYTHONPATH=`pwd`:$PYTHONPATH && ./venv/bin/python3 setup.py bdist_app @@ -43,10 +39,10 @@ res: ## Generates and compresses resource file ./venv/bin/pyrcc5 -compress 9 -o httprider/generated/resources_rc.py resources/resources.qrc run: ## Runs the application - export PYTHONPATH=`pwd`:$PYTHONPATH && python httprider/application.py + export PYTHONPATH=`pwd`:$PYTHONPATH && ./venv/bin/python3 httprider/application.py test: ## Run all unit tests - export PYTHONPATH=`pwd`:$PYTHONPATH && pytest httprider/tests + export PYTHONPATH=`pwd`:$PYTHONPATH && ./venv/bin/pytest httprider/tests runapp: ## Runs the packaged application ./dist/HttpRider.app/Contents/MacOS/app diff --git a/README.md b/README.md index b0cda0a..884dc9b 100644 --- a/README.md +++ b/README.md @@ -74,16 +74,11 @@ See https://www.httprider.com/docs/getting-started/installation/ for instruction 🚀 Import Postman collections ### Development - -Run `make` to display list of commands to install required dependencies in a virtual environment. - + +Run the following command to set-up virtual environment + ``` -$ make -Run the following commands to install required dependencies -python3 -m venv venv -source venv/bin/activate -pip install -r requirements/dev.txt -Once everything is installed, 'make run' to run the application +$ make setup ``` Then `make run` should startup the application. @@ -91,3 +86,5 @@ Then `make run` should startup the application. ``` $ make run ``` + +You can just run `make` to display list of available commands. \ No newline at end of file diff --git a/setup.py b/setup.py index 35adb6c..2f30704 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def finalize_options(self): pass def run(self): - check_call(['pyinstaller', '-y', 'httprider.spec']) + check_call(['./venv/bin/pyinstaller', '-y', 'httprider.spec']) cmdclass['bdist_app'] = bdist_app