Skip to content

Commit a133edc

Browse files
committed
Adjust dependency versions before publishing
1 parent d0197f8 commit a133edc

13 files changed

Lines changed: 223 additions & 182 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Run Splunk AppInspect
2+
description: Package a mock app containing the SDK and its dependencies, then validate it with AppInspect.
3+
4+
inputs:
5+
mock-app-path:
6+
description: Path to app packaged for scanning with AppInspect
7+
required: true
8+
default: ./tests/system/test_apps/generating_app
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Install AppInspect dependencies
14+
shell: bash
15+
run: sudo apt-get install -y libmagic1
16+
- name: Install the SDK and its dependencies into the mock app
17+
shell: bash
18+
run: |
19+
mkdir -p ${{ inputs.mock-app-path }}/bin/lib
20+
uv pip install ".[openai, anthropic]" --target ${{ inputs.mock-app-path }}/bin/lib
21+
- name: Package the mock app
22+
shell: bash
23+
run: |
24+
cd ${{ inputs.mock-app-path }}
25+
tar -czf mock_app.tgz --exclude="__pycache__" bin default metadata
26+
- name: Validate the mock app with AppInspect
27+
shell: bash
28+
run: uvx splunk-appinspect inspect ${{ inputs.mock-app-path }}/mock_app.tgz --included-tags cloud

.github/actions/setup-sdk-environment/action.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@ inputs:
55
python-version:
66
description: Python version used for this run
77
required: true
8+
default: "3.13"
89
deps-group:
910
description: Dependency groups passed to `uv sync --group`
1011
required: true
12+
default: lint
1113

1214
runs:
1315
using: composite
1416
steps:
1517
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
1618
with:
1719
version: 0.11.6
18-
activate-environment: true
1920
python-version: ${{ inputs.python-version }}
20-
- name: Install dependencies from the ${{ inputs.deps-group }} group(s)
21-
run: SDK_DEPS_GROUP="${{ inputs.deps-group }}" make uv-sync-ci
21+
activate-environment: true
22+
enable-cache: true
23+
cache-python: true
24+
- name: Install dependencies from the ${{ inputs.deps-group }} group
2225
shell: bash
26+
env:
27+
SDK_DEPS_GROUP: ${{ inputs.deps-group }}
28+
run: make uv-sync-ci

.github/workflows/appinspect.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: Validate SDK with Splunk AppInspect
2-
on: [ push, workflow_dispatch ]
2+
on: [push, workflow_dispatch]
33

44
env:
55
PYTHON_VERSION: 3.13
6-
MOCK_APP_PATH: ./tests/system/test_apps/generating_app
76

87
jobs:
98
appinspect:
@@ -14,16 +13,5 @@ jobs:
1413
with:
1514
python-version: ${{ env.PYTHON_VERSION }}
1615
deps-group: lint
17-
- name: Install splunk-appinspect dependencies
18-
run: sudo apt-get install -y libmagic1
19-
- name: Install packages for the mock app
20-
run: |
21-
mkdir -p ${{ env.MOCK_APP_PATH }}/bin/lib
22-
uv pip install ".[openai, anthropic]" --target ${{ env.MOCK_APP_PATH }}/bin/lib
23-
- name: Copy splunklib to a test app and package it as a mock app
24-
run: |
25-
cd ${{ env.MOCK_APP_PATH }}
26-
tar -czf mock_app.tgz --exclude="__pycache__" bin default metadata
27-
- name: Validate mock app with splunk-appinspect
28-
run: uvx splunk-appinspect inspect ${{ env.MOCK_APP_PATH }}/mock_app.tgz
29-
--included-tags cloud
16+
- name: Run AppInspect
17+
uses: ./.github/actions/run-appinspect

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Python SDK Lint
22
on: [push, workflow_dispatch]
33

44
jobs:
5-
lint-stage:
5+
lint:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

.github/workflows/pre-release.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
name: Publish SDK to Test PyPI
2-
on: [workflow_dispatch]
1+
name: Publish pre-release to Test PyPI
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
- release/2.x
7+
workflow_dispatch:
38

49
env:
510
PYTHON_VERSION: 3.13
611

712
jobs:
8-
publish-to-test-pypi:
13+
publish-pre-release:
914
runs-on: ubuntu-latest
1015
permissions:
11-
id-token: write
16+
id-token: write # Required for publishing
1217
environment:
1318
name: splunk-test-pypi
1419
steps:
@@ -17,8 +22,16 @@ jobs:
1722
with:
1823
python-version: ${{ env.PYTHON_VERSION }}
1924
deps-group: release
25+
- name: Set temporary pre-release version
26+
run: |
27+
VERSION_BASE="$(uv version --short)"
28+
RUN_NUMBER="${{ github.run_number }}"
29+
COMMIT_SHA="$(git rev-parse --short HEAD)"
30+
uv version --frozen "${VERSION_BASE}.dev${RUN_NUMBER}+g${COMMIT_SHA}"
2031
- name: Build packages for distribution
2132
run: uv build
33+
- name: Run AppInspect
34+
uses: ./.github/actions/run-appinspect
2235
- name: Publish packages to Test PyPI
2336
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
2437
with:

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
publish-to-pypi:
1111
runs-on: ubuntu-latest
1212
permissions:
13-
id-token: write
13+
id-token: write # Required for publishing
1414
environment:
1515
name: splunk-pypi
1616
steps:
@@ -21,6 +21,8 @@ jobs:
2121
deps-group: release
2222
- name: Build packages for distribution
2323
run: uv build
24+
- name: Run AppInspect
25+
uses: ./.github/actions/run-appinspect
2426
- name: Publish packages to PyPI
2527
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b
2628
with:

.github/workflows/test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,41 @@ concurrency:
66
cancel-in-progress: true
77

88
jobs:
9-
test-stage:
10-
runs-on: ${{ matrix.os }}
9+
test:
1110
strategy:
1211
matrix:
1312
os: [ubuntu-latest]
1413
python-version: [3.13]
1514
splunk-version: [latest]
15+
runs-on: ${{ matrix.os }}
1616
steps:
1717
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1818
- uses: ./.github/actions/setup-sdk-environment
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
deps-group: test
2222
- name: Download Splunk MCP Server App
23-
run: uv run ./scripts/download_splunk_mcp_server_app.py
2423
env:
2524
SPLUNKBASE_USERNAME: ${{ secrets.SPLUNKBASE_USERNAME }}
2625
SPLUNKBASE_PASSWORD: ${{ secrets.SPLUNKBASE_PASSWORD }}
26+
run: uv run ./scripts/download_splunk_mcp_server_app.py
2727
- name: Launch Splunk Docker instance
2828
run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d
2929
- name: Set up .env
3030
run: cp .env.template .env
3131
- name: Write internal AI secrets to .env
32-
run: |
33-
echo "internal_ai_app_key=$INTERNAL_AI_APP_KEY" >> .env
34-
echo "internal_ai_client_id=$INTERNAL_AI_CLIENT_ID" >> .env
35-
echo "internal_ai_client_secret=$INTERNAL_AI_CLIENT_SECRET" >> .env
36-
echo "internal_ai_token_url=$INTERNAL_AI_TOKEN_URL" >> .env
37-
echo "internal_ai_base_url=$INTERNAL_AI_BASE_URL" >> .env
3832
env:
3933
INTERNAL_AI_APP_KEY: ${{ secrets.INTERNAL_AI_APP_KEY }}
4034
INTERNAL_AI_CLIENT_ID: ${{ secrets.INTERNAL_AI_CLIENT_ID }}
4135
INTERNAL_AI_CLIENT_SECRET: ${{ secrets.INTERNAL_AI_CLIENT_SECRET }}
4236
INTERNAL_AI_TOKEN_URL: ${{ secrets.INTERNAL_AI_TOKEN_URL }}
4337
INTERNAL_AI_BASE_URL: ${{ secrets.INTERNAL_AI_BASE_URL }}
38+
run: |
39+
echo "internal_ai_app_key=$INTERNAL_AI_APP_KEY" >> .env
40+
echo "internal_ai_client_id=$INTERNAL_AI_CLIENT_ID" >> .env
41+
echo "internal_ai_client_secret=$INTERNAL_AI_CLIENT_SECRET" >> .env
42+
echo "internal_ai_token_url=$INTERNAL_AI_TOKEN_URL" >> .env
43+
echo "internal_ai_base_url=$INTERNAL_AI_BASE_URL" >> .env
4444
- name: Restore pytest cache
4545
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop' }}
4646
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
@@ -51,5 +51,5 @@ jobs:
5151
pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}-
5252
- name: Run unit tests
5353
run: make test-unit
54-
- name: Run entire test suite
54+
- name: Run integration/system tests
5555
run: make test-integration

docs/conf.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
# All configuration values have a default; values that are commented out
1010
# serve to show the default.
1111

12+
import importlib.metadata
1213
from datetime import datetime
1314

14-
import splunklib
15-
1615
# If extensions (or modules to document with autodoc) are in another directory,
1716
# add these directories to sys.path here. If the directory is relative to the
1817
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -41,16 +40,15 @@
4140

4241
# General information about the project.
4342
project = "Splunk SDK for Python"
44-
copyright = f"{datetime.now().year}, Splunk Inc."
43+
copyright = f"2011-{datetime.now().year} Splunk, Inc."
4544

4645
# The version info for the project you're documenting, acts as replacement for
4746
# |version| and |release|, also used in various other places throughout the
4847
# built documents.
4948
#
5049
# The short X.Y version.
51-
version = splunklib.__version__
52-
# The full version, including alpha/beta/rc tags.
53-
release = splunklib.__version__
50+
release = importlib.metadata.version("splunk-sdk")
51+
version = ".".join(release.split(".")[:2])
5452

5553
# The language for content autogenerated by Sphinx. Refer to documentation
5654
# for a list of supported languages.

pyproject.toml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ download = "https://github.com/splunk/splunk-sdk-python/releases/latest"
88

99
[project]
1010
name = "splunk-sdk"
11-
dynamic = ["version"]
11+
version = "3.0.0"
1212
description = "Splunk Software Development Kit for Python"
1313
readme = "README.md"
1414
requires-python = ">=3.13"
@@ -33,33 +33,31 @@ dependencies = []
3333
# Treat the same as NPM's `dependencies`
3434
[project.optional-dependencies]
3535
compat = ["six>=1.17.0"]
36-
ai = ["httpx==0.28.1", "langchain>=1.2.15", "mcp>=1.27.0", "pydantic>=2.13.1"]
37-
anthropic = ["splunk-sdk[ai]>=2.1.1", "langchain-anthropic>=1.4.0"]
38-
openai = ["splunk-sdk[ai]>=2.1.1", "langchain-openai>=1.1.13"]
36+
ai = ["httpx==0.28.1", "langchain>=1.2.15", "mcp>=1.27.0", "pydantic>=2.13.3"]
37+
anthropic = ["splunk-sdk[ai]>=2.1.1", "langchain-anthropic>=1.4.2"]
38+
openai = ["splunk-sdk[ai]>=2.1.1", "langchain-openai>=1.2.1"]
3939

4040
# Treat the same as NPM's `devDependencies`
4141
[dependency-groups]
4242
test = [
43-
"splunk-sdk[ai]",
43+
"splunk-sdk[openai, anthropic]>=2.1.1",
4444
"pytest>=9.0.3",
4545
"pytest-cov>=7.1.0",
4646
"pytest-asyncio>=1.3.0",
4747
"python-dotenv>=1.2.2",
4848
"vcrpy>=8.1.1",
4949
]
50-
release = ["build>=1.4.3", "jinja2>=3.1.6", "sphinx>=9.1.0", "twine>=6.2.0"]
51-
lint = ["basedpyright>=1.39.0", "ruff>=0.15.10"]
50+
release = ["build>=1.4.4", "jinja2>=3.1.6", "sphinx>=9.1.0", "twine>=6.2.0"]
51+
lint = ["basedpyright>=1.39.3", "ruff>=0.15.12"]
5252
dev = [
53-
"rich>=14.3.3",
54-
"splunk-sdk[openai, anthropic]",
53+
"rich>=15.0.0",
5554
{ include-group = "test" },
5655
{ include-group = "lint" },
5756
{ include-group = "release" },
5857
]
5958

6059
[build-system]
61-
# setuptools v61 introduces pyproject.toml support
62-
requires = ["setuptools>=61.0.0"]
60+
requires = ["setuptools>=82.0.1"]
6361
build-backend = "setuptools.build_meta"
6462

6563
[tool.setuptools]
@@ -72,9 +70,6 @@ packages = [
7270
"splunklib.ai.engines",
7371
]
7472

75-
[tool.setuptools.dynamic]
76-
version = { attr = "splunklib.__version__" }
77-
7873
[tool.basedpyright]
7974
exclude = [".venv"]
8075
allowedUntypedLibraries = ["splunklib"]

splunklib/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,3 @@ def setup_logging(
3030
level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE_FORMAT
3131
):
3232
logging.basicConfig(level=level, format=log_format, datefmt=date_format)
33-
34-
35-
__version_info__ = (3, 0, 0)
36-
__version__ = ".".join(map(str, __version_info__))

0 commit comments

Comments
 (0)