Skip to content

Add pyproject.toml and remove deprecated setup commands #627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: pip install twine
python-version: 3.9
- name: Install build and twine
run: pip install build twine
- name: Build package
run: python setup.py sdist
run: python -m build
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-22.04
python: [ 3.7, 3.9, 3.13]
splunk-version:
- "8.1"
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,9 @@ Use `pip`:

[sudo] pip install splunk-sdk

Install the Python egg:

[sudo] pip install --egg splunk-sdk

Install the sources you cloned from GitHub:

[sudo] python setup.py install
[sudo] python -m pip install .

## Testing Quickstart

Expand Down
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[build-system]
requires = ["setuptools>=77.0.3"]
build-backend = "setuptools.build_meta"

[project]
name = "splunk-sdk"
dynamic = ["version"]
authors = [{ name = "Splunk, Inc.", email = "[email protected]" }]
license = "Apache-2.0"
license-files = ["LICENSE"]
description = "The Splunk Software Development Kit for Python"
readme = "README.md"
dependencies = ["deprecation>=2.1.0"]
Copy link
Preview

Copilot AI Jul 28, 2025

Choose a reason for hiding this comment

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

The dependency constraint has been tightened from just "deprecation" to "deprecation>=2.1.0". This could potentially break existing installations that have older versions. Consider whether this version requirement is necessary or if it should be more permissive.

Suggested change
dependencies = ["deprecation>=2.1.0"]
dependencies = ["deprecation"]

Copilot uses AI. Check for mistakes.

classifiers = [
"Programming Language :: Python",
"Development Status :: 6 - Mature",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries :: Application Frameworks",
]

[project.urls]
Homepage = "http://github.com/splunk/splunk-sdk-python"


[project.optional-dependencies]
dev = ["tox>=4.8.0"]

[tool.setuptools]
packages = ["splunklib", "splunklib.modularinput", "splunklib.searchcommands"]
39 changes: 6 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,12 @@

from setuptools import setup

import splunklib

setup(
author="Splunk, Inc.",
def get_version():
with open("splunklib/__init__.py") as f:
for line in f:
if line.startswith("__version__"):
return line.split("=")[1].strip().strip('"').strip("'")

author_email="[email protected]",

description="The Splunk Software Development Kit for Python.",

license="http://www.apache.org/licenses/LICENSE-2.0",

name="splunk-sdk",

packages = ["splunklib",
"splunklib.modularinput",
"splunklib.searchcommands"],

install_requires=[
"deprecation",
],

url="http://github.com/splunk/splunk-sdk-python",

version=splunklib.__version__,

classifiers = [
"Programming Language :: Python",
"Development Status :: 6 - Mature",
"Environment :: Other Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries :: Application Frameworks",
],
)
setup(version=get_version())
3 changes: 1 addition & 2 deletions splunklib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ def setup_logging(level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE
datefmt=date_format)


__version_info__ = (2, 1, 0)
__version__ = ".".join(map(str, __version_info__))
__version__ = "2.1.0"
Loading