Skip to content
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

Add Makefile for env, dev, and django example #145

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ jobs:
python -m pip install --upgrade pip
pip install psutil six mock itsdangerous nose testfixtures blinker wheel
./scripts/install_frameworks.sh
python setup.py develop

pip install --editable .
- name: Run Tests
run: |
export ${{ matrix.env }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ __pycache__/
# Distribution / packaging
.Python
env/
/.venv/
.envrc
build/
develop-eggs/
dist/
Expand Down Expand Up @@ -51,6 +53,7 @@ coverage.xml

# Django stuff:
*.log
/examples/django_app/db.sqlite3

# Sphinx documentation
docs/_build/
Expand Down
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
SHELL:= /usr/bin/env bash
.EXPORT_ALL_VARIABLES:
PIP_REQUIRE_VIRTUALENV ?= true

PY:= python3.9

.PHONY: test develop django clean

test: develop
source .venv/bin/activate && \
python setup.py test

develop: .venv/bin/wheel
source .venv/bin/activate && \
pip install --editable .

django: develop
ifndef HONEYBADGER_API_KEY
$(error HONEYBADGER_API_KEY is undefined)
endif
source .venv/bin/activate && \
cd examples/django_app && \
pip install --requirement requirements.txt && \
python manage.py migrate && \
echo "Go to http://127.0.0.1/api/div to generate an alert." && \
python manage.py runserver

.venv/bin/wheel: .venv/
source .venv/bin/activate && \
pip install --upgrade pip setuptools wheel

.venv/:
$(PY) -m venv .venv

clean:
rm --force --recursive honeybadger.egg-info/
rm --force --recursive .venv/ .eggs/
find -type d -name __pycache__ -print0 |xargs -r0 rm --force --recursive
rm --force examples/django_app/db.sqlite3
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,13 @@ honeybadger.notify(error_class='ValueError', error_message='Something bad happen
After cloning the repo, run:

```sh
python setup.py develop
make develop
```

To run the unit tests:

```sh
python setup.py test
make test
```

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ pip --version
pip install psutil six
[ ! -z "$DJANGO_VERSION" ] && pip install Django==$DJANGO_VERSION
[ ! -z "$FLASK_VERSION" ] && pip install Flask==$FLASK_VERSION
python setup.py develop
pip install --editable .
python setup.py test