Skip to content

Commit 475452e

Browse files
author
Cecylia Borek
committed
go back to setup.py dynamic version
1 parent 17b8013 commit 475452e

File tree

5 files changed

+37
-22
lines changed

5 files changed

+37
-22
lines changed

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
version: '3.6'
2-
31
services:
42
splunk:
53
image: "splunk/splunk:${SPLUNK_VERSION}"
64
container_name: splunk
5+
platform: linux/amd64
76
environment:
87
- SPLUNK_START_ARGS=--accept-license
98
- SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113

pyproject.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "splunk-sdk"
7-
version = "2.1.0"
7+
dynamic = ["version"]
88
authors = [{ name = "Splunk, Inc.", email = "[email protected]" }]
99
license.file = "LICENSE"
10-
requires-python = ">=3.7, <=3.13"
10+
requires-python = ">=3.7"
1111
description = "The Splunk Software Development Kit for Python"
1212
readme = "README.md"
13-
dependencies = [
14-
"deprecation>=2.1.0",
15-
"importlib-metadata>=6.7.0",
16-
]
13+
dependencies = ["deprecation>=2.1.0"]
1714
classifiers = [
1815
"Programming Language :: Python",
1916
"Development Status :: 6 - Mature",
@@ -29,7 +26,7 @@ Homepage = "http://github.com/splunk/splunk-sdk-python"
2926

3027

3128
[project.optional-dependencies]
32-
dev = ["tox>=4.8.0", "pytest>=7.4.4"]
29+
test = ["tox>=4.8.0", "pytest>=7.4.4"]
3330
build = ["twine", "build"]
3431

3532
[tool.setuptools]

setup.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python
2+
#
3+
# Copyright © 2011-2024 Splunk, Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"): you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
from setuptools import setup
18+
19+
20+
def get_version():
21+
with open("splunklib/__init__.py") as f:
22+
for line in f:
23+
if line.startswith("__version__"):
24+
return line.split("=")[1].strip().strip('"').strip("'")
25+
26+
27+
setup(version=get_version())

splunklib/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
import logging
1818

19-
try:
20-
import importlib.metadata as importlib
21-
except (ImportError, ModuleNotFoundError):
22-
# For Python < 3.8, use importlib_metadata backport
23-
import importlib_metadata as importlib
2419

2520
DEFAULT_LOG_FORMAT = (
2621
"%(asctime)s, Level=%(levelname)s, Pid=%(process)s, Logger=%(name)s, File=%(filename)s, "
@@ -38,4 +33,4 @@ def setup_logging(
3833
logging.basicConfig(level=level, format=log_format, datefmt=date_format)
3934

4035

41-
__version__ = importlib.version("splunk-sdk")
36+
__version__ = "2.1.0"

uv.lock

Lines changed: 4 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)