@@ -20,6 +20,8 @@ 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 )
@@ -33,44 +35,36 @@ lint-gh-actions:
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
4042.PHONY : lint-makefile
4143lint-makefile :
42- $(UV_RUN_CMD ) mbake format --config ./.bake.toml Makefile docs/Makefile
43-
44- .PHONY : ci-lint
45- ci-lint : ci-lint-python ci-lint-gh-actions ci-lint-makefile
46-
47- .PHONY : ci-lint-gh-actions
48- ci-lint-gh-actions :
49- $(ZIZMOR_CMD ) ./.github
50-
51- .PHONY : ci-lint-python
52- ci-lint-python :
53- $(UV_RUN_CMD ) ruff check --fix-only --exit-non-zero-on-fix
54- $(UV_RUN_CMD ) ruff format --check
55- $(UV_RUN_CMD ) basedpyright
56-
57- .PHONY : ci-lint-makefile
58- ci-lint-makefile :
59- $(UV_RUN_CMD ) mbake format --config ./.bake.toml --check Makefile docs/Makefile
60- $(UV_RUN_CMD ) mbake validate --config ./.bake.toml Makefile docs/Makefile
61-
62- .PHONY : ci-lint-makefile
63- ci-lint-makefile :
64- $(UV_RUN_CMD ) mbake format --config ./.bake.toml --check Makefile docs/Makefile
65- $(UV_RUN_CMD ) mbake validate --config ./.bake.toml Makefile docs/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)
6646
6747.PHONY : clean
6848clean :
69- 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
7055
7156.PHONY : docs
7257docs :
73- 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) ."
7468
7569# # TESTING
7670
@@ -90,7 +84,7 @@ test-unit:
9084
9185.PHONY : test-integration
9286test-integration :
93- $(PYTEST_CMD ) --ff ./tests/integration ./tests/system
87+ $(PYTEST_CMD ) ./tests/integration ./tests/system
9488
9589.PHONY : test-ai
9690test-ai :
@@ -136,8 +130,8 @@ docker-refresh: docker-remove docker-start
136130
137131.PHONY : docker-splunk-restart
138132docker-splunk-restart :
139- 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
140134
141135.PHONY : docker-tail-python-log
142136docker-tail-python-log :
143- 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