Skip to content
Permalink
Browse files

rework

- move doc/ into src/ directory
- Makefile: init: previously known as install
- Makefile: init: update fdb to version 6
- Makefile: lint: use pylama (TODO: configure it)
- Makefile: check-with-coverage: remove target
- Makefile: check: also do coverage
- .pylintrc: remove it
- .travis.yml: update it
  • Loading branch information...
Amirouche
Amirouche committed Dec 25, 2018
1 parent 53d5a14 commit 5e1656a03065878a45a95b1b432f96c3d806bacb
@@ -1,2 +1,2 @@
[run]
omit = src/tests.py
omit = src/tests/
@@ -2,8 +2,7 @@ sudo: required
language: python
cache: pip
python: 3.6
install: make install
install: make init
script: make check
after_success:
- make check-coverage
- codecov
@@ -1,54 +1,41 @@
.PHONY: help doc

all: help
@echo "\nTry something...\n"
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort

install: ## Prepare the host sytem for development
wget https://www.foundationdb.org/downloads/5.2.5/ubuntu/installers/foundationdb-clients_5.2.5-1_amd64.deb
sudo dpkg -i foundationdb-clients_5.2.5-1_amd64.deb
wget https://www.foundationdb.org/downloads/5.2.5/ubuntu/installers/foundationdb-server_5.2.5-1_amd64.deb
sudo dpkg -i foundationdb-server_5.2.5-1_amd64.deb
pip3 install pipenv --upgrade
pipenv install --dev --skip-lock
pipenv run pre-commit install
init: ## Prepare the host sytem for development
wget https://www.foundationdb.org/downloads/6.0.15/ubuntu/installers/foundationdb-clients_6.0.15-1_amd64.deb
sudo dpkg -i foundationdb-clients_6.0.15-1_amd64.deb
wget https://www.foundationdb.org/downloads/6.0.15/ubuntu/installers/foundationdb-server_6.0.15-1_amd64.deb
sudo dpkg -i foundationdb-server_6.0.15-1_amd64.deb
pip3 install --upgrade pipenv==2018.10.13
PIPENV_VENV_IN_PROJECT=1 pipenv install --dev --skip-lock
pipenv run pre-commit install --hook-type pre-push
@echo "\033[95m\n\nYou may now run 'pipenv shell'.\n\033[0m"

check: ## Run tests
make database-clean
pipenv run py.test -vv --capture=no src/tests/
make database-clear
PYTHONHASHSEED=0 PYTHONPATH=$(PWD)/src/ pipenv run py.test -vvv --cov-config .coveragerc --cov-report html --cov-report xml --cov=socialiter src/tests/
pipenv check
bandit --skip=B101 -r src/
@echo "\033[95m\n\nYou may now run 'make lint' or 'make coverage'.\n\033[0m"

check-coverage: ## Code coverage
make database-clean
pipenv run py.test -vv --cov-config .coveragerc --cov-report term --cov-report html --cov-report xml --cov=src src/tests/

help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
pipenv run bandit --skip=B101 src/
@echo "\033[95m\n\nYou may now run 'make lint'.\n\033[0m"

devrun: ## Run application in development mode
cd src && DEBUG=DEBUG adev runserver --livereload --static socialiter/static/ socialiter/main.py

lint: ## Lint the code
pipenv run pylint src/ # TODO: replace with lama
pipenv run pylama src/

doc: ## Build the documentation
cd doc && make html
@echo "\033[95m\n\nBuild successful! View the docs homepage at doc/_build/html/index.html.\n\033[0m"

upstream: ## Clone the most important third-party libraries
mkdir upstream
git clone https://github.com/aio-libs/aiohttp upstream/aiohttp
git clone https://github.com/Deepwalker/trafaret upstream/trafaret
cd src/doc && make html
@echo "\033[95m\n\nBuild successful! View the docs homepage at src/doc/_build/html/index.html.\n\033[0m"

clean: ## Clean up
git clean -fX

database-clean: ## Remove all data from the database
database-clear: ## Remove all data from the database
fdbcli --exec "writemode on; clearrange \x00 \xFF;"

todo: ## Things that should be done
@grep -nR --color=always TODO src/

xxx: ## Things that require attention
@grep -nR --color=always --before-context=2 --after-context=2 XXX src/

repl: ## ipython REPL inside source directory
cd src && ipython
@@ -19,6 +19,7 @@ asyncpg = "*"
requests = "*"
bandit = "*"
black = "*"
pylama = "*"

[packages]
aiohttp = "*"

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 5e1656a

Please sign in to comment.
You can’t perform that action at this time.