@@ -20,43 +20,51 @@ upgrade:
2020
2121# Workaround for make being unable to pass arguments to underlying cmd
2222# $ SDK_DEPS_GROUP="build" make ci-install
23+ SDK_DEPS_GROUP ?= dev
24+
2325.PHONY : ci-install
2426ci-install :
2527 $(UV_SYNC_CMD ) --frozen --group $(SDK_DEPS_GROUP )
2628
2729.PHONY : lint
28- lint : lint-python lint-gh-actions # TODO: Add mbake
30+ lint : lint-python lint-gh-actions lint-makefile
2931
3032.PHONY : lint-gh-actions
3133lint-gh-actions :
3234 $(ZIZMOR_CMD ) ./.github
3335
3436.PHONY : lint-python
3537lint-python :
36- $(UV_RUN_CMD ) ruff check --fix-only
37- $(UV_RUN_CMD ) ruff format
38+ $(UV_RUN_CMD ) ruff check --fix-only $( if $( CI ) ,--exit-non-zero-on-fix)
39+ $(UV_RUN_CMD ) ruff format $( if $( CI ) ,--check)
3840 $(UV_RUN_CMD ) basedpyright
3941
40- .PHONY : ci-lint
41- ci-lint : ci-lint-python ci-lint-gh-actions # TODO: Add mbake
42-
43- .PHONY : ci-lint-gh-actions
44- ci-lint-gh-actions :
45- $(ZIZMOR_CMD ) ./.github
46-
47- .PHONY : ci-lint-python
48- ci-lint-python :
49- $(UV_RUN_CMD ) ruff check --fix-only --exit-non-zero-on-fix
50- $(UV_RUN_CMD ) ruff format --check
51- $(UV_RUN_CMD ) basedpyright
42+ .PHONY : lint-makefile
43+ lint-makefile :
44+ $(UV_RUN_CMD ) mbake format --config ./.bake.toml $(if $(CI ) ,--check) Makefile
45+ $(if $(CI ) ,$(UV_RUN_CMD ) mbake validate --config ./.bake.toml Makefile)
5246
5347.PHONY : clean
5448clean :
55- rm -rf ./build ./dist ./.venv ./.ruff_cache ./.pytest_cache ./splunk_sdk.egg-info ./__pycache__ ./** /__pycache__
49+ rm -rf ./build ./dist ./.venv ./.ruff_cache ./.pytest_cache ./splunk_sdk.egg-info ./__pycache__
50+ find . -name __pycache__ -type d -exec rm -rf {} +
51+
52+ DOCS_BUILDDIR := docs/_build
53+ DOCS_HTMLDIR := $(DOCS_BUILDDIR ) /html
54+ DOCS_ZIPFILE := $(DOCS_BUILDDIR ) /splunk-sdk-python-docs.zip
5655
5756.PHONY : docs
5857docs :
59- make -C ./docs html
58+ rm -rf $(DOCS_BUILDDIR )
59+ sphinx-build -b html -d $(DOCS_BUILDDIR ) /doctrees ./docs $(DOCS_HTMLDIR )
60+ sh docs/munge_links.sh $(DOCS_HTMLDIR )
61+ @echo " [splunk-sdk] ---"
62+ @echo " [splunk-sdk] Build finished. HTML pages available at $( DOCS_HTMLDIR) ."
63+
64+ .PHONY : docs-zip
65+ docs-zip : docs
66+ cd $(DOCS_HTMLDIR ) && zip -r $(abspath $(DOCS_ZIPFILE ) ) .
67+ @echo " [splunk-sdk] Zip available at $( DOCS_ZIPFILE) ."
6068
6169# # TESTING
6270
@@ -76,7 +84,7 @@ test-unit:
7684
7785.PHONY : test-integration
7886test-integration :
79- $(PYTEST_CMD ) --ff ./tests/integration ./tests/system
87+ $(PYTEST_CMD ) ./tests/integration ./tests/system
8088
8189.PHONY : test-ai
8290test-ai :
@@ -122,8 +130,8 @@ docker-refresh: docker-remove docker-start
122130
123131.PHONY : docker-splunk-restart
124132docker-splunk-restart :
125- docker exec -it $(CONTAINER_NAME ) sudo sh -c ' $(SPLUNK_HOME)/bin/splunk restart --run-as-root '
133+ docker exec -u splunk $(CONTAINER_NAME ) $(SPLUNK_HOME ) /bin/splunk restart
126134
127135.PHONY : docker-tail-python-log
128136docker-tail-python-log :
129- docker exec -it $(CONTAINER_NAME ) sudo tail $(SPLUNK_HOME ) /var/log/splunk/python.log
137+ docker exec -u root $(CONTAINER_NAME ) sudo tail -n 20 $(SPLUNK_HOME ) /var/log/splunk/python.log
0 commit comments