Skip to content

Add pyproject remove setup.py commands #628

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*coverage_html_report*
.coverage
.coverage.*
.python-version
.vscode
__stdout__
docs/_build
Expand All @@ -24,5 +23,6 @@ dist/
tests/searchcommands/apps/app_with_logging_configuration/*.log
*.observed
venv/
.venv/
.tox
test-reports/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9
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
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
version: '3.6'

services:
splunk:
image: "splunk/splunk:${SPLUNK_VERSION}"
container_name: splunk
platform: linux/amd64
environment:
- SPLUNK_START_ARGS=--accept-license
- SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
Expand Down
37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[build-system]
requires = ["setuptools>=68.0.0"]
build-backend = "setuptools.build_meta"

[project]
name = "splunk-sdk"
dynamic = ["version"]
authors = [{ name = "Splunk, Inc.", email = "[email protected]" }]
license.file = "LICENSE"
requires-python = ">=3.7"
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]
test = ["tox>=4.8.0", "pytest>=7.4.4"]
build = ["twine", "build"]

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


[tool.setuptools.exclude-package-data]
"*" = ["tests/*"]
39 changes: 6 additions & 33 deletions setup.py
100755 → 100644
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())
20 changes: 11 additions & 9 deletions splunklib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@

import logging

DEFAULT_LOG_FORMAT = '%(asctime)s, Level=%(levelname)s, Pid=%(process)s, Logger=%(name)s, File=%(filename)s, ' \
'Line=%(lineno)s, %(message)s'
DEFAULT_DATE_FORMAT = '%Y-%m-%d %H:%M:%S %Z'

DEFAULT_LOG_FORMAT = (
"%(asctime)s, Level=%(levelname)s, Pid=%(process)s, Logger=%(name)s, File=%(filename)s, "
"Line=%(lineno)s, %(message)s"
)
DEFAULT_DATE_FORMAT = "%Y-%m-%d %H:%M:%S %Z"


# To set the logging level of splunklib
# ex. To enable debug logs, call this method with parameter 'logging.DEBUG'
# default logging level is set to 'WARNING'
def setup_logging(level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE_FORMAT):
logging.basicConfig(level=level,
format=log_format,
datefmt=date_format)
def setup_logging(
level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE_FORMAT
):
logging.basicConfig(level=level, format=log_format, datefmt=date_format)


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