forked from datadesk/python-documentcloud
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
53 lines (43 loc) · 1.43 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
# remove the pre-recorded HTTP requests for normal tests
test-clean:
rm -rf tests/cassettes/test_*/*
rm -rf tests/cassettes/fixtures/*
# remove the pre-recorded HTTP requests for short tests
# short tests have the server set to expire access tokens quickly in order to
# test behavior around expired tokens
test-clean-short:
rm -rf tests/cassettes/short_fixtures/*
# run normal tests and record all HTTP requests
test-create: test-clean
pytest --record-mode=all -m "not short"
# run short tests and record all HTTP requests
test-create-short: test-clean-short
pytest --record-mode=all -m "short"
# run all tests using the pre-recorded HTTP requests - will fail on missing request
test:
pytest --record-mode=none --block-network
# run tests using pre-recorded HTTP requets if they exist, and recording them if missing
test-dev:
pytest --record-mode=new_episodes
# run tests under python2 and python3
tox:
tox
# run tests using pre-recorded HTTP requests and create a coverage report
coverage:
coverage erase
coverage run --source documentcloud -m py.test --record-mode=none --block-network
coverage html
coverage report -m
# ensure all code is linted, formatted and import are sorted
check:
pylint documentcloud
black documentcloud
isort -rc documentcloud
pylint tests
black tests
isort -rc tests
# release a new version of the package to PyPI
ship:
rm -rf build/
python setup.py sdist bdist_wheel
twine upload dist/* --skip-existing