diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90ef8171..73c3cc69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/gh-action-pypi-publish@v1.8.10 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc8bd208..ad4c4a77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: - - ubuntu-latest + - ubuntu-22.04 python: [ 3.7, 3.9, 3.13] splunk-version: - "8.1" diff --git a/README.md b/README.md index 7cd66cc2..3c5ba360 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..9952745a --- /dev/null +++ b/pyproject.toml @@ -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 = "devinfo@splunk.com" }] +license = "Apache-2.0" +license-files = ["LICENSE"] +description = "The Splunk Software Development Kit for Python" +readme = "README.md" +dependencies = ["deprecation>=2.1.0"] +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"] diff --git a/setup.py b/setup.py index d19a09eb..f9661c34 100755 --- a/setup.py +++ b/setup.py @@ -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="devinfo@splunk.com", - 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()) diff --git a/splunklib/__init__.py b/splunklib/__init__.py index 5f83b2ac..d7aa5be8 100644 --- a/splunklib/__init__.py +++ b/splunklib/__init__.py @@ -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"