Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/actions/setup-sdk-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
runs:
using: composite
steps:
- uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
- uses: astral-sh/setup-uv@v10.3.3
with:
python-version: 3.13
activate-environment: true
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/actions.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This file is machine-generated by `gh actions-lock`.
# Do not edit by hand; run `gh actions-lock` to update.
# Docs: https://gh.io/actions-lockfile
version: 'v0.0.3'
workflows:
'.github/workflows/appinspect.yml':
- 'actions/checkout@v7.0.1'
- 'astral-sh/setup-uv@v10.3.3'
'.github/workflows/cd.yml':
- 'actions/checkout@v7.0.1'
- 'actions/download-artifact@v8.0.2'
- 'actions/upload-artifact@v7.0.2'
- 'astral-sh/setup-uv@v10.3.3'
- 'pypa/gh-action-pypi-publish@v1.14.3'
'.github/workflows/lint.yml':
- 'actions/checkout@v7.0.1'
- 'astral-sh/setup-uv@v10.3.3'
'.github/workflows/test.yml':
- 'actions/cache@v6.1.0'
- 'actions/checkout@v7.0.1'
- 'astral-sh/setup-uv@v10.3.3'
dependencies:
'actions/cache@v6.1.0':
ref: 'v6.1.0'
commit: 'sha1-55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
owner_id: 44036562
repo_id: 215566462
'actions/checkout@v7.0.1':
ref: 'v7.0.1'
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
owner_id: 44036562
repo_id: 197814629
'actions/download-artifact@v8.0.2':
ref: 'v8.0.2'
commit: 'sha1-9000827ccba6bdab643e8b6fd33ac0654aef8333'
owner_id: 44036562
repo_id: 192626254
'actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405':
ref: 'v6.2.0'
commit: 'sha1-a309ff8b426b58ec0e2a45f0f869d46889d02405'
owner_id: 44036562
repo_id: 192625525
'actions/upload-artifact@v7.0.2':
ref: 'v7.0.2'
commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9'
owner_id: 44036562
repo_id: 192625955
'astral-sh/setup-uv@v10.3.3':
ref: 'v10.3.3'
commit: 'sha1-68559e99cc807c1eb7e9238fd43a15bba460eec2'
owner_id: 115962839
repo_id: 846733598
'pypa/gh-action-pypi-publish@v1.14.3':
ref: 'v1.14.3'
commit: 'sha1-7245906fb61fa33a13554f9d5fb856fe61758086'
owner_id: 647025
repo_id: 178055147
uses:
- 'actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405'
6 changes: 3 additions & 3 deletions .github/workflows/appinspect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
name: Run AppInspect
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-sdk-environment
- uses: $/.github/actions/setup-sdk-environment
with:
deps-group: lint
- name: Run AppInspect
uses: ./.github/actions/run-appinspect
uses: $/.github/actions/run-appinspect
continue-on-error: ${{ github.event_name == 'pull_request' }}
21 changes: 11 additions & 10 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ permissions: {}
jobs:
build-distributables:
name: Build release distributables
# Why building is separate from publishing:
# We separate building from publishing, as poisoned build deps could
# take advantage of escalated privileges during publishing, more info:
# https://github.com/pypa/gh-action-pypi-publish/issues/217#issuecomment-1965727093
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-sdk-environment
- uses: $/.github/actions/setup-sdk-environment
with:
deps-group: release
- name: Set pre-release version
Expand Down Expand Up @@ -52,16 +53,16 @@ jobs:
run: uv build
- name: Run AppInspect
if: startsWith(github.ref, 'refs/tags/') == true
uses: ./.github/actions/run-appinspect
uses: $/.github/actions/run-appinspect
- name: Upload distributables
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
uses: actions/upload-artifact@v7.0.2
with:
name: splunk-sdk-${{ steps.get-version.outputs.version }}
path: dist/
- name: Generate API reference
run: make docs-zip
- name: Upload docs artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
uses: actions/upload-artifact@v7.0.2
with:
name: python-sdk-docs
path: docs/_build/splunk-sdk-python-docs.zip
Expand All @@ -78,12 +79,12 @@ jobs:
url: https://test.pypi.org/project/splunk-sdk/
steps:
- name: Download distributables
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
uses: actions/download-artifact@v8.0.2
with:
name: splunk-sdk-${{ needs.build-distributables.outputs.version }}
path: dist/
- name: Publish packages to Test PyPI
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
uses: pypa/gh-action-pypi-publish@v1.14.3
with:
repository-url: https://test.pypi.org/legacy/

Expand All @@ -99,11 +100,11 @@ jobs:
url: https://pypi.org/project/splunk-sdk/
steps:
- name: Download distributables
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
uses: actions/download-artifact@v8.0.2
with:
name: splunk-sdk-${{ needs.build-distributables.outputs.version }}
path: dist/
- name: Publish packages to PyPI
uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
uses: pypa/gh-action-pypi-publish@v1.14.3
with:
repository-url: https://upload.pypi.org/legacy/
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ jobs:
name: Run linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-sdk-environment
- uses: $/.github/actions/setup-sdk-environment
with:
deps-group: lint
- name: Verify uv.lock is up-to-date
run: uv lock --check
- name: Verify files are linted and formatted
run: make lint
env:
# Needed for `gh actions-lock --verify`
GH_TOKEN: ${{ github.token }}
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
matrix:
splunk-version: [latest]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-sdk-environment
- uses: $/.github/actions/setup-sdk-environment
with:
deps-group: test
- name: (weekly deps check) Upgrade dependencies to latest
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
echo "internal_ai_base_url=$INTERNAL_AI_BASE_URL" >> .env
- name: Restore pytest cache
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop' }}
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
uses: actions/cache@v6.1.0
with:
path: .pytest_cache
key: pytest-cache-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }}
Expand Down
5 changes: 5 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rules:
unpinned-uses:
config:
policies:
astral-sh/setup-uv: ref-pin

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locking doesn't work with composite actions, I don't think we'll merge this in until GH fixes this.

1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Common targets: `make install`, `make build` (sdist and wheel into `dist/`), `ma
- Changes to `splunklib/ai/` or `tests/integration/ai/`: also run `make docker-start` then `make test-ai`; a new `@ai_snapshot_test` records into `tests/integration/ai/snapshots/` and needs `internal_ai_*` values in `.env` (delete a snapshot JSON to re-record it).
- Changes to `examples/` or `tests/system/test_apps/`: restart the container with `make docker-restart` and run `make test-integration`.
- Changes to `.github/workflows/` or `.github/actions/`: run `make lint` (zizmor checks workflow security).
- [`$/` is a valid GitHub shorthand for repo root.](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-using-an-action-in-the-same-repository-as-the-workflow-at-the-running-commit-recommended)
- Changes to `Makefile`: run `make lint` (mbake formats and validates it).
- Dependency changes in `pyproject.toml`: run `make install` and commit the updated `uv.lock` (CI runs `uv lock --check`), then `make test-unit`.
- Changes to `docs/` or docstrings only: run `make docs` and check for Sphinx warnings.
Expand Down
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
UV_SYNC_CMD := uv sync --no-config
# https://docs.astral.sh/uv/reference/cli/#uv-run
UV_RUN_CMD := uv run
# https://docs.zizmor.sh/usage
ZIZMOR_CMD := $(UV_RUN_CMD) zizmor --pedantic --strict-collection

.PHONY: install
install:
Expand All @@ -18,8 +16,8 @@ install:
upgrade:
$(UV_SYNC_CMD) --dev --upgrade

# Workaround for make being unable to pass arguments to underlying cmd
# $ SDK_DEPS_GROUP="build" make ci-install
# Workaround for Make not supporting pasing arguments to underlying cmd, e.g.
# $ SDK_DEPS_GROUP="dev" make ci-install
SDK_DEPS_GROUP ?= dev

.PHONY: ci-install
Expand All @@ -34,11 +32,14 @@ build:
lint: lint-python lint-gh-actions lint-makefile

.PHONY: lint-gh-actions
# https://docs.zizmor.sh/usage
lint-gh-actions:
$(ZIZMOR_CMD) ./.github
uvx zizmor --pedantic --strict-collection ./.github
gh extension install github/gh-actions-lock
gh actions-lock --verify

# --fix-only never fails on unfixable violations, so rules that must be enforced
# get a separate strict `ruff check --select` pass.
# --fix-only never fails on unfixable violations, so some rules need to be
# enforced with a separate `ruff check`.
.PHONY: lint-python
lint-python:
$(UV_RUN_CMD) ruff check --fix-only $(if $(CI),--exit-non-zero-on-fix)
Expand All @@ -48,8 +49,8 @@ lint-python:

.PHONY: lint-makefile
lint-makefile:
$(UV_RUN_CMD) mbake format --config ./.bake.toml $(if $(CI),--check) Makefile
$(UV_RUN_CMD) mbake validate --config ./.bake.toml Makefile
$(UV_RUN_CMD) mbake format --config ./.bake.toml $(if $(CI),--check) ./Makefile
$(UV_RUN_CMD) mbake validate --config ./.bake.toml ./Makefile

.PHONY: clean
clean:
Expand Down
32 changes: 16 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ version = "3.0.1"
description = "Splunk Software Development Kit for Python"
readme = "README.md"
requires-python = ">=3.13"
license = { text = "Apache-2.0" }
authors = [{ name = "Splunk, Inc.", email = "devinfo@splunk.com" }]
license = "Apache-2.0"
authors = [{ name = "Splunk Inc.", email = "devinfo@splunk.com" }]
keywords = ["splunk", "sdk"]
classifiers = [
"Programming Language :: Python :: 3",
Expand All @@ -34,35 +34,35 @@ dependencies = []
[project.optional-dependencies]
compat = ["six>=1.17.0"]
ai = [
"httpx==0.28.1",
"langchain>=1.3.15",
"httpx>=0.28.1",
"langchain>=1.4.9",
"mcp>=1.30.0,<2.0.0",
"pydantic>=2.13.4",
]
anthropic = ["splunk-sdk[ai]>=3.0.0", "langchain-anthropic>=1.5.6"]
openai = ["splunk-sdk[ai]>=3.0.0", "langchain-openai>=1.5.1"]
anthropic = ["splunk-sdk[ai]>=3.0.1", "langchain-anthropic>=1.7.10"]
openai = ["splunk-sdk[ai]>=3.0.1", "langchain-openai>=1.7.4"]
google = [
"splunk-sdk[ai]>=3.0.0",
"langchain-google-genai==4.3.4",
"google-auth>=2.56.3",
"splunk-sdk[ai]>=3.0.1",
"langchain-google-genai>=4.5.0",
"google-auth>=2.62.1",
]

# Treat the same as NPM's `devDependencies`
[dependency-groups]
test = [
"splunk-sdk[openai, anthropic, google]>=3.0.0",
"pytest>=9.1.1",
"splunk-sdk[openai, anthropic, google]>=3.0.1",
"pytest>=9.2.0",
"pytest-cov>=7.1.0",
"pytest-asyncio>=1.4.0",
"pytest-asyncio>=1.5.0",
"python-dotenv>=1.2.3",
"vcrpy>=8.3.0",
]
release = ["build>=1.5.0", "jinja2>=3.1.6", "sphinx>=9.1.0", "twine>=7.0.0"]
release = ["build>=1.6.1", "jinja2>=3.1.6", "sphinx>=9.2.0", "twine>=7.0.0"]
lint = [
"basedpyright>=1.39.10",
"ruff>=0.16.3",
"mbake>=1.4.6",
"zizmor==1.29.0",
"ruff>=0.17.5",
"mbake>=1.5.0",
"zizmor>=1.32.0",
]
dev = [
"rich>=15.0.0",
Expand Down
Loading
Loading