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
128 changes: 0 additions & 128 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
{
"files": {
"./examples/ai_custom_search_app/bin/agentic_reporting_csc.py": [
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 33,
"endColumn": 62,
"lineCount": 1
}
}
],
"./splunklib/__init__.py": [
{
"code": "reportUnknownParameterType",
Expand Down Expand Up @@ -82,114 +72,6 @@
}
}
],
"./splunklib/ai/engines/langchain.py": [
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 79,
"endColumn": 104,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 79,
"endColumn": 104,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 69,
"endColumn": 94,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 59,
"endColumn": 84,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 88,
"endColumn": 113,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 89,
"endColumn": 114,
"lineCount": 1
}
}
],
"./splunklib/ai/serialized_service.py": [
{
"code": "reportPrivateUsage",
"range": {
"startColumn": 30,
"endColumn": 39,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 99,
"endColumn": 122,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 88,
"endColumn": 111,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 88,
"endColumn": 111,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 96,
"endColumn": 119,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 121,
"endColumn": 139,
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 98,
"endColumn": 121,
"lineCount": 1
}
}
],
"./splunklib/ai/tools.py": [
{
"code": "reportUnknownArgumentType",
Expand Down Expand Up @@ -41374,16 +41256,6 @@
}
}
],
"./tests/unit/ai/testdata/tool_defining_tools.py": [
{
"code": "reportUnusedFunction",
"range": {
"startColumn": 8,
"endColumn": 12,
"lineCount": 1
}
}
],
"./tests/unit/modularinput/modularinput_testlib.py": [
{
"code": "reportUnknownParameterType",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/appinspect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 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' }}
9 changes: 5 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ 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:
Expand All @@ -24,7 +25,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 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 All @@ -49,10 +50,10 @@ jobs:
id: get-version
run: echo "version=$(uv version --short)" >> "$GITHUB_OUTPUT"
- name: Build packages for distribution
run: uv build
run: make 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
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 @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 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
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: 7 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@
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:
$(UV_SYNC_CMD) --dev

.PHONY: upgrade
upgrade:
$(UV_SYNC_CMD) --dev --upgrade
$(UV_SYNC_CMD) --upgrade

# Workaround for make being unable to pass arguments to underlying cmd
# $ SDK_DEPS_GROUP="build" make ci-install
# Workaround for gMake not supporting argument passthrough.
# Usage: $ SDK_DEPS_GROUP="dev" make ci-install
SDK_DEPS_GROUP ?= dev

.PHONY: ci-install
Expand All @@ -28,28 +26,25 @@ ci-install:

.PHONY: build
build:
uv build --no-config
uv build

.PHONY: lint
lint: lint-python lint-gh-actions lint-makefile

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

# --fix-only never fails on unfixable violations, so rules that must be enforced
# get a separate strict `ruff check --select` pass.
.PHONY: lint-python
lint-python:
$(UV_RUN_CMD) ruff check --fix-only $(if $(CI),--exit-non-zero-on-fix)
$(UV_RUN_CMD) ruff check --select N
$(UV_RUN_CMD) ruff format $(if $(CI),--check)
$(UV_RUN_CMD) basedpyright

.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

.PHONY: clean
clean:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from splunklib.searchcommands import (
Configuration,
Option,
dispatch, # pyright: ignore[reportPrivateLocalImportUsage]
dispatch,
validators,
)
from splunklib.searchcommands.eventing_command import EventingCommand
Expand Down
50 changes: 24 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ issues = "https://github.com/splunk/splunk-sdk-python/issues"

[project]
name = "splunk-sdk"
version = "3.0.1"
version = "3.0.2"
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.5.2",
"mcp>=1.30.0,<2.0.0",
"pydantic>=2.13.4",
"pydantic>=2.13.5, <2.14.0",
]
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.2", "langchain-anthropic>=1.7.11"]
openai = ["splunk-sdk[ai]>=3.0.2", "langchain-openai>=1.8.3"]
google = [
"splunk-sdk[ai]>=3.0.0",
"langchain-google-genai==4.3.4",
"google-auth>=2.56.3",
"splunk-sdk[ai]>=3.0.2",
"langchain-google-genai>=4.5.1",
"google-auth>=2.62.2",
]

# 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.2",
"pytest>=9.2.0",
"pytest-cov>=7.1.0",
"pytest-asyncio>=1.4.0",
"python-dotenv>=1.2.3",
"pytest-asyncio>=1.5.0",
"python-dotenv>=1.2.4",
"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",
"basedpyright>=1.40.2",
"ruff>=0.17.6",
"mbake>=1.5.0",
"zizmor>=1.32.0",
]
dev = [
"rich>=15.0.0",
Expand Down Expand Up @@ -93,7 +93,7 @@ junit_family = "xunit2"
omit = ["docs/*", "tests/*", "examples/*", "scripts/*"]

[tool.basedpyright]
exclude = [".venv"]
exclude = ["**/bin/lib", "build"]
allowedUntypedLibraries = ["splunklib"]
reportAny = false
reportExplicitAny = false
Expand Down Expand Up @@ -128,9 +128,10 @@ ignore = [
[tool.ruff.lint.isort]
combine-as-imports = true

[tool.ruff.format]
docstring-code-format = true

[tool.ruff.lint.pep8-naming]
# Grandfathered legacy names (mostly public API kept for backwards compatibility).
# Remove entries as names get fixed; do not add new ones without approval.
extend-ignore-names = [
"_buildInternalAIModel",
"_InvalidMessagesException",
Expand Down Expand Up @@ -199,6 +200,3 @@ extend-ignore-names = [
"updateInfo",
"versionSearch",
]

[tool.ruff.format]
docstring-code-format = true
Loading
Loading