This repository has been archived by the owner on Jan 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
65 lines (57 loc) · 1.5 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
#
# https://github.com/riotkit-org/riotkit-do/issues/5
#
SHELL=/bin/bash
TEST_OPTS=
TESTS_ARGS=
## Installs dependencies for all packages
deps:
pip install -r ./requirements-dev.txt
BASE_PATH=$$(pwd); \
for package_directory in $$(ls ./src); do \
echo ">> $${package_directory}"; \
pip install -r $$BASE_PATH/src/$$package_directory/requirements-external.txt; \
done
## Run tests
tests:
set +e; \
\
BASE_PATH=$$(pwd); \
for package_directory in $$(ls ./src); do \
if [[ ! -d $$BASE_PATH/src/$$package_directory/tests ]]; then \
continue; \
fi; \
echo ">> $${package_directory}"; \
mkdir -p $$BASE_PATH/src/$$package_directory/build; \
cd "$$BASE_PATH/src/$$package_directory"; pytest --junitxml=build/tests.xml ${TESTS_ARGS};\
done
## Release
release: package publish
## Refresh git
refresh_git:
git fetch --tags
git status
git tag -l -n
## Build local package
package: refresh_git
BASE_PATH=$$(pwd); \
for package_directory in $$(ls ./src); do \
cd "$$BASE_PATH/src/$$package_directory"; ./setup.py build; ./setup.py sdist; \
done
## Publish to PyPI
publish:
BASE_PATH=$$(pwd); \
for package_directory in $$(ls ./src); do \
cd "$$BASE_PATH/src/$$package_directory"; \
twine upload --disable-progress-bar --verbose \
--username=__token__ \
--password=${PYPI_TOKEN} \
--skip-existing \
dist/*; \
done
## Build SPHINX docs
documentation:
cd docs && sphinx-build -M html "source" "build"
## Properly tag project
tag:
git tag -am "Version ${NUM}" ${NUM}