2018-04-26 15:40:12 +00:00
|
|
|
# Variables
|
2020-10-03 20:49:19 +00:00
|
|
|
SOURCE = fog cfog docs
|
2018-04-26 15:40:12 +00:00
|
|
|
|
|
|
|
# Commands
|
2018-04-27 10:59:14 +00:00
|
|
|
all: lint test
|
2018-07-18 14:20:04 +00:00
|
|
|
test: build-ext unit
|
2019-07-16 09:50:45 +00:00
|
|
|
publish: clean lint test build-ext upload clean
|
2018-04-27 12:54:40 +00:00
|
|
|
|
2018-07-18 14:20:04 +00:00
|
|
|
build-ext:
|
2018-08-23 14:36:41 +00:00
|
|
|
@echo Building native extensions...
|
2018-08-23 14:03:41 +00:00
|
|
|
find . -name *.pyx | xargs cython && find . -name *.c
|
2018-08-23 16:32:04 +00:00
|
|
|
@echo
|
2018-08-23 14:44:46 +00:00
|
|
|
python setup.py build_ext --inplace
|
2018-08-23 14:36:41 +00:00
|
|
|
@echo
|
2018-07-18 14:20:04 +00:00
|
|
|
|
2018-04-27 12:54:40 +00:00
|
|
|
clean:
|
2018-08-23 13:41:34 +00:00
|
|
|
rm -rf *.egg-info .pytest_cache .ipynb_checkpoints build dist
|
|
|
|
find . -name __pycache__ -type d | xargs rm -rf
|
2021-04-14 13:36:17 +00:00
|
|
|
find . -name *.c -type f | xargs rm -f
|
|
|
|
find . -name *.so -type f | xargs rm -f
|
2018-04-26 15:40:12 +00:00
|
|
|
|
2020-10-02 08:38:23 +00:00
|
|
|
deps:
|
|
|
|
pip3 install -U pip
|
|
|
|
pip3 install -U setuptools
|
|
|
|
pip3 install -r requirements.txt
|
|
|
|
|
2018-04-26 15:40:12 +00:00
|
|
|
lint:
|
|
|
|
@echo Linting source code using pep8...
|
2018-07-12 13:01:35 +00:00
|
|
|
pycodestyle --ignore E501,E722,E731,E741,W503,W504 $(SOURCE) test
|
2021-05-04 20:02:10 +00:00
|
|
|
@echo
|
2020-10-05 21:10:03 +00:00
|
|
|
@echo Searching for unused imports...
|
2021-05-04 17:03:55 +00:00
|
|
|
importchecker fog | grep -v __init__ || true
|
|
|
|
importchecker cfog | grep -v __init__ || true
|
|
|
|
importchecker docs | grep -v __init__ || true
|
|
|
|
importchecker test | grep -v __init__ || true
|
2018-04-27 10:59:14 +00:00
|
|
|
@echo
|
|
|
|
|
2020-10-03 20:49:19 +00:00
|
|
|
readme:
|
|
|
|
python -m docs.build > README.md
|
|
|
|
|
2018-04-27 10:59:14 +00:00
|
|
|
unit:
|
|
|
|
@echo Running unit tests...
|
2018-07-12 15:33:46 +00:00
|
|
|
PYTHONHASHSEED=0 && pytest -s
|
2018-04-26 15:40:12 +00:00
|
|
|
@echo
|
2018-04-27 12:54:40 +00:00
|
|
|
|
|
|
|
upload:
|
|
|
|
python setup.py sdist bdist_wheel
|
|
|
|
twine upload dist/*
|