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
|
|
|
|
2021-05-16 11:26:38 +00:00
|
|
|
# Functions
|
|
|
|
define clean
|
|
|
|
rm -rf *.egg-info .pytest_cache .ipynb_checkpoints build dist
|
|
|
|
find . -name __pycache__ -type d | xargs rm -rf
|
|
|
|
find . -name *.c -type f | xargs rm -f
|
|
|
|
find . -name *.so -type f | xargs rm -f
|
|
|
|
endef
|
|
|
|
|
2018-04-26 15:40:12 +00:00
|
|
|
# Commands
|
2018-04-27 10:59:14 +00:00
|
|
|
all: lint test
|
2021-05-16 11:30:44 +00:00
|
|
|
test: unit
|
2021-05-16 11:26:38 +00:00
|
|
|
publish: clean lint test build-ext upload
|
|
|
|
$(call 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:
|
2021-05-16 11:26:38 +00:00
|
|
|
$(call clean)
|
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
|
2023-09-08 12:13:43 +00:00
|
|
|
twine upload dist/*.tar.gz
|