Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .bake.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# mbake configuration file
# Generated with: mbake init

# Global settings
debug = false
verbose = false

# Error message formatting
gnu_error_format = true
wrap_error_messages = false

[formatter]
# Spacing settings - enable proper spacing
space_around_assignment = true
space_before_colon = false
space_after_colon = true

# Line continuation settings
normalize_line_continuations = true
max_line_length = 100

# PHONY settings
auto_insert_phony_declarations = true
group_phony_declarations = false
phony_at_top = false

# General settings - enable proper formatting
remove_trailing_whitespace = true
ensure_final_newline = true
normalize_empty_lines = true
max_consecutive_empty_lines = 2
fix_missing_recipe_tabs = true

# Conditional formatting settings (Default disabled)
indent_nested_conditionals = false
# Indentation settings
tab_width = 2

# Variable alignment settings
align_variable_assignments = false
align_across_comments = false
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
name: splunk-sdk-${{ steps.get-version.outputs.version }}
path: dist/
- name: Generate API reference
run: make -C ./docs zip
run: make docs-zip
- name: Upload docs artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- name: Verify uv.lock is up-to-date
run: uv lock --check
- name: Verify files are linted and formatted
run: make ci-lint
run: make lint
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
python-version: ${{ matrix.python-version }}
deps-group: test
- name: Download Splunk MCP Server App
continue-on-error: true
env:
SPLUNKBASE_USERNAME: ${{ secrets.SPLUNKBASE_USERNAME }}
SPLUNKBASE_PASSWORD: ${{ secrets.SPLUNKBASE_PASSWORD }}
Expand Down
48 changes: 28 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,51 @@ upgrade:

# Workaround for make being unable to pass arguments to underlying cmd
# $ SDK_DEPS_GROUP="build" make ci-install
SDK_DEPS_GROUP ?= dev

.PHONY: ci-install
ci-install:
$(UV_SYNC_CMD) --frozen --group $(SDK_DEPS_GROUP)

.PHONY: lint
lint: lint-python lint-gh-actions # TODO: Add mbake
lint: lint-python lint-gh-actions lint-makefile

.PHONY: lint-gh-actions
lint-gh-actions:
$(ZIZMOR_CMD) ./.github

.PHONY: lint-python
lint-python:
$(UV_RUN_CMD) ruff check --fix-only
$(UV_RUN_CMD) ruff format
$(UV_RUN_CMD) ruff check --fix-only $(if $(CI),--exit-non-zero-on-fix)
$(UV_RUN_CMD) ruff format $(if $(CI),--check)
$(UV_RUN_CMD) basedpyright

.PHONY: ci-lint
ci-lint: ci-lint-python ci-lint-gh-actions # TODO: Add mbake

.PHONY: ci-lint-gh-actions
ci-lint-gh-actions:
$(ZIZMOR_CMD) ./.github

.PHONY: ci-lint-python
ci-lint-python:
$(UV_RUN_CMD) ruff check --fix-only --exit-non-zero-on-fix
$(UV_RUN_CMD) ruff format --check
$(UV_RUN_CMD) basedpyright
.PHONY: lint-makefile
lint-makefile:
$(UV_RUN_CMD) mbake format --config ./.bake.toml $(if $(CI),--check) Makefile
$(if $(CI),$(UV_RUN_CMD) mbake validate --config ./.bake.toml Makefile)

.PHONY: clean
clean:
rm -rf ./build ./dist ./.venv ./.ruff_cache ./.pytest_cache ./splunk_sdk.egg-info ./__pycache__ ./**/__pycache__
rm -rf ./build ./dist ./.venv ./.ruff_cache ./.pytest_cache ./splunk_sdk.egg-info ./__pycache__
find . -name __pycache__ -type d -exec rm -rf {} +

DOCS_BUILDDIR := docs/_build
DOCS_HTMLDIR := $(DOCS_BUILDDIR)/html
DOCS_ZIPFILE := $(DOCS_BUILDDIR)/splunk-sdk-python-docs.zip

.PHONY: docs
docs:
make -C ./docs html
rm -rf $(DOCS_BUILDDIR)
sphinx-build -b html -d $(DOCS_BUILDDIR)/doctrees ./docs $(DOCS_HTMLDIR)
sh docs/munge_links.sh $(DOCS_HTMLDIR)
@echo "[splunk-sdk] ---"
@echo "[splunk-sdk] Build finished. HTML pages available at $(DOCS_HTMLDIR)."

.PHONY: docs-zip
docs-zip: docs
cd $(DOCS_HTMLDIR) && zip -r $(abspath $(DOCS_ZIPFILE)) .
@echo "[splunk-sdk] Zip available at $(DOCS_ZIPFILE)."

## TESTING

Expand All @@ -76,7 +84,7 @@ test-unit:

.PHONY: test-integration
test-integration:
$(PYTEST_CMD) --ff ./tests/integration ./tests/system
$(PYTEST_CMD) ./tests/integration ./tests/system

.PHONY: test-ai
test-ai:
Expand Down Expand Up @@ -122,8 +130,8 @@ docker-refresh: docker-remove docker-start

.PHONY: docker-splunk-restart
docker-splunk-restart:
docker exec -it $(CONTAINER_NAME) sudo sh -c '$(SPLUNK_HOME)/bin/splunk restart --run-as-root'
docker exec -u splunk $(CONTAINER_NAME) $(SPLUNK_HOME)/bin/splunk restart

.PHONY: docker-tail-python-log
docker-tail-python-log:
docker exec -it $(CONTAINER_NAME) sudo tail $(SPLUNK_HOME)/var/log/splunk/python.log
docker exec -u root $(CONTAINER_NAME) sudo tail -n 20 $(SPLUNK_HOME)/var/log/splunk/python.log
19 changes: 0 additions & 19 deletions docs/Makefile

This file was deleted.

190 changes: 0 additions & 190 deletions docs/make.bat

This file was deleted.

Loading