This repository has been archived by the owner on Sep 18, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6da89ae
commit 883e1d4
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
include Makefile.config | ||
-include Makefile.custom.config | ||
|
||
all: install serve | ||
|
||
install: | ||
test -d $(VENV) || virtualenv -p python3.6 $(VENV) | ||
$(PIP) install --upgrade --no-cache pip setuptools -e .[test] | ||
|
||
install-dev: | ||
$(PIP) install --upgrade devcore | ||
|
||
update-db: | ||
$(VENV)/bin/alembic upgrade head | ||
|
||
install-db: | ||
$(FLASK) drop_db | ||
$(VENV)/bin/alembic upgrade head | ||
|
||
clean: | ||
rm -fr dist | ||
|
||
clean-install: clean | ||
rm -fr $(VENV) | ||
rm -fr *.egg-info | ||
|
||
lint: | ||
$(PYTEST) --no-cov --flake8 -m flake8 | ||
$(PYTEST) --no-cov --isort -m isort | ||
|
||
check-python: lint | ||
|
||
check-outdated: | ||
$(PIP) list --outdated --format=columns | ||
|
||
check: check-python check-outdated | ||
|
||
build: | ||
|
||
env: | ||
$(RUN) | ||
|
||
run: | ||
env FLASK_DEBUG=1 $(VENV)/bin/flask run | ||
|
||
serve: run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export PROJECT_NAME = sherlog | ||
|
||
export FLASK_APP = $(PROJECT_NAME) | ||
export FLASK_CONFIG ?= application.cfg | ||
export FLASK_DEBUG ?= 1 | ||
|
||
# Python env | ||
VENV = $(PWD)/.env | ||
PIP = $(VENV)/bin/pip | ||
PYTHON = $(VENV)/bin/python | ||
PYTEST = $(VENV)/bin/py.test | ||
FLASK = $(VENV)/bin/flask |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
|
||
from setuptools import find_packages, setup | ||
|
||
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) | ||
pytest_runner = ['pytest-runner'] if needs_pytest else [] | ||
|
||
tests_requirements = [ | ||
'pytest', | ||
'pytest-cov', | ||
'pytest-factoryboy', | ||
'pytest-flake8', | ||
'pytest-isort', | ||
] | ||
|
||
setup( | ||
name='sherlog', | ||
author='Kozea', | ||
packages=find_packages(exclude=['*.eggs']), | ||
include_package_data=True, | ||
install_requires=[ | ||
'alembic', | ||
'flask', | ||
'sqlalchemy', | ||
'unrest', | ||
], | ||
setup_requires=pytest_runner, | ||
tests_require=tests_requirements, | ||
extras_require={'test': tests_requirements} | ||
) |