-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
104 lines (83 loc) · 3.22 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Makefile like config file for py-make
# To use: `pip install py3make`
# then calle `pymake <command>`
# IMPORTANT: to be compatible with `python setup.py make alias`, you must make
# sure that you only put one command per line, and ALWAYS put a line return
# after an alias and before a command, eg (without the 3 ticks):
#
#```
#all:
# test
# install
#test:
# nosetest
#install:
# python setup.py install
#```
# CRITICAL NOTE: if you get a "FileNotFoundError" exception when trying to call @+python or @+make, then it is because you used spaces instead of a hard TAB character to indent! TODO: bugfix this. It happens only for @+ commands and for those after the first command (if the @+ command with spaces as indentation is the first and only statement in a command, it works!)
help:
@+make -p
alltests:
@+make testcoverage
@+make testsetup
all:
@make alltests
@make build
prebuildclean:
@+python -c "import shutil; shutil.rmtree('build', True)"
@+python -c "import shutil; shutil.rmtree('dist', True)"
@+python -c "import shutil; shutil.rmtree('pyFileFixity.egg-info', True)" # very important to delete egg-info before any new build or pip install, otherwise may cause an error that multiple egg-info folders are present, or it may build using old definitions
coverclean:
@+python -c "import os; os.remove('.coverage') if os.path.exists('.coverage') else None"
@+python -c "import shutil; shutil.rmtree('__pycache__', True)"
@+python -c "import shutil; shutil.rmtree('tests/__pycache__', True)"
test:
#tox --skip-missing-interpreters
pytest
testnose:
# Only for Py2
nosetests pyFileFixity/tests/ -d -v
testpyproject:
validate-pyproject pyproject.toml -v
testsetuppost:
twine check "dist/*"
testrst:
rstcheck README.rst
testcoverage:
@+make coverclean
#nosetests pyFileFixity/tests/ --with-coverage --cover-package=pyFileFixity -d -v # Py2 only
coverage run --branch -m pytest pyFileFixity -v
coverage report -m
testmalloc:
@+python -X dev -X tracemalloc=5 -m pytest
installdev:
@+make prebuildclean
# Should work for both Py2 and Py3, --editable option and isolation builds work with both pyproject.toml and setup.cfg
@+python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --upgrade --editable .[test,testmeta] --verbose --use-pep517
installdevpy2:
@+make prebuildclean
@+python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --upgrade --editable .[test] --verbose --use-pep517
install:
@+make prebuildclean
@+python -m pip install --upgrade . --verbose --use-pep517
build:
# requires `pip install build`
@+make testrst
@+make prebuildclean
@+make testpyproject
@+python -sBm build # do NOT use the -w flag, otherwise only the wheel will be built, but we need sdist for source distros such as Debian and Gentoo!
@+make testsetuppost
buildpy2:
# Py2 only
# requires `pip install build`
@+make testrst
@+make prebuildclean
@+python -sBm build # do NOT use the -w flag, otherwise only the wheel will be built, but we need sdist for source distros such as Debian and Gentoo!
@+make testsetuppost
buildwheelhouse:
cibuildwheel --platform auto
upload:
twine upload dist/*
buildupload:
@+make build
@+make upload