Skip to content

Commit

Permalink
Tidying up Makefile and README
Browse files Browse the repository at this point in the history
  • Loading branch information
namuan committed May 31, 2020
1 parent 0e7b11c commit 99f8f37
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand All @@ -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
Expand Down
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,17 @@ 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.

```
$ make run
```

You can just run `make` to display list of available commands.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99f8f37

Please sign in to comment.