| 1 |
# This makefile is used to make it easier to get the project set up |
| 2 |
# to be ready for development work in the local sandbox. |
| 3 |
# example: "make setup" |
| 4 |
|
| 5 |
PYTHON=python3 |
| 6 |
LINT=black |
| 7 |
LINT_DIRS=ibm_cloud_sdk_core test test_integration |
| 8 |
|
| 9 |
setup: deps dev-deps install-project |
| 10 |
|
| 11 |
all: upgrade-pip setup test-unit lint |
| 12 |
|
| 13 |
ci: all |
| 14 |
|
| 15 |
publish-release: publish-deps build-dist publish-dist |
| 16 |
|
| 17 |
upgrade-pip: |
| 18 |
${PYTHON} -m pip install --upgrade pip |
| 19 |
|
| 20 |
deps: |
| 21 |
${PYTHON} -m pip install . |
| 22 |
|
| 23 |
dev-deps: |
| 24 |
${PYTHON} -m pip install .[dev] |
| 25 |
|
| 26 |
detect-secrets: |
| 27 |
detect-secrets scan --update .secrets.baseline |
| 28 |
detect-secrets audit .secrets.baseline |
| 29 |
|
| 30 |
publish-deps: |
| 31 |
${PYTHON} -m pip install .[publish] |
| 32 |
|
| 33 |
install-project: |
| 34 |
${PYTHON} -m pip install -e . |
| 35 |
|
| 36 |
test-unit: |
| 37 |
${PYTHON} -m pytest --cov=ibm_cloud_sdk_core test |
| 38 |
|
| 39 |
lint: |
| 40 |
${PYTHON} -m pylint ${LINT_DIRS} |
| 41 |
${LINT} --check ${LINT_DIRS} |
| 42 |
|
| 43 |
lint-fix: |
| 44 |
${LINT} ${LINT_DIRS} |
| 45 |
|
| 46 |
build-dist: |
| 47 |
rm -fr dist |
| 48 |
${PYTHON} -m build |
| 49 |
|
| 50 |
# This target requires the TWINE_PASSWORD env variable to be set to the user's pypi.org API token. |
| 51 |
publish-dist: |
| 52 |
TWINE_USERNAME=__token__ ${PYTHON} -m twine upload --non-interactive --verbose dist/* |