generated from fastai/pypi_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (83 loc) · 2.79 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
.ONESHELL:
SHELL:=/bin/bash
PYTHON_VERSION:=3.8
# You can use either venv (venv) or conda env
# by specifying the correct argument (env=<conda, venv>)
ifeq ($(env),venv)
# Use Conda
BASE=venv
BIN=$(BASE)/bin
CREATE_COMMAND="python$(PYTHON_VERSION) -m venv $(BASE)"
DELETE_COMMAND="rm -rf $(BASE)"
ACTIVATE_COMMAND="source venv/bin/activate"
DEACTIVATE_COMMAND="deactivate"
else
# Use Conda
BASE=~/anaconda3/envs/yaml_config_wrapper
BIN=$(BASE)/bin
CREATE_COMMAND="conda create --prefix $(BASE) python=$(PYTHON_VERSION) -y"
DELETE_COMMAND="conda env remove -p $(BASE)"
ACTIVATE_COMMAND="conda activate -p $(BASE)"
DEACTIVATE_COMMAND="conda deactivate"
endif
all:
$(MAKE) help
help:
@echo
@echo "-------------------------------------------------------------------------------------------"
@echo " DISPLAYING HELP "
@echo "-------------------------------------------------------------------------------------------"
@echo "Run: make <make recipe> [env=<conda|venv>]"
@echo
@echo "make help"
@echo " Display this message"
@echo "make release [env=<conda|venv>]"
@echo " Run pypi conda_release fastrelease_bump_version"
@echo "make release_requirements [env=<conda|venv>]"
@echo " Install fastrelease twine and conda-build"
@echo "make pypi [env=<conda|venv>]"
@echo " Run dist and upload using twine"
@echo "make dist [env=<conda|venv>]"
@echo " Clean and create bdist and wheel"
@echo "make clean [env=<conda|venv>]"
@echo " Delete all './build ./dist ./*.pyc ./*.tgz ./*.egg-info' files"
@echo "make tests [env=<conda|venv>]"
@echo " Run all tests"
@echo "make create_env [env=<conda|venv>]"
@echo " Create a new conda env or venv for the specified python version"
@echo "make delete_env [env=<conda|venv>]"
@echo " Delete the current conda env or venv"
@echo "-------------------------------------------------------------------------------------------"
release:
$(MAKE) release_requirements
$(MAKE) pypi
#$(MAKE) conda_release
#fastrelease_bump_version
release_test:
$(MAKE) release_requirements
$(MAKE) pypi_test
release_requirements:
$(BIN)/pip install fastrelease twine conda-build
pypi:
$(MAKE) dist
twine upload --repository pypi dist/*
pypi_test:
$(MAKE) dist_test
twine upload --repository pypitest dist/* --verbose
conda_release:
fastrelease_conda_package --upload_user drkostas
dist:
$(MAKE) clean
python setup.py sdist bdist_wheel
dist_test:
$(MAKE) clean
python setup.py sdist bdist_wheel --test
clean:
python setup.py clean
tests:
python setup.py test
create_env:
@eval $(CREATE_COMMAND)
delete_env:
@eval $(DELETE_COMMAND)
.PHONY: all help release release_requirements conda_release pypi clean dist tests create_env delete_env dist_test pypi_test release_test