Skip to content

Commit 9f9919d

Browse files
authored
Merge pull request #564 from splunk/release/2.0.0
Release/2.0.0
2 parents c5ce1a6 + dbe72dd commit 9f9919d

File tree

92 files changed

+1514
-2847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1514
-2847
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Build package
2020
run: python setup.py sdist
2121
- name: Publish package to PyPI
22-
uses: pypa/[email protected].8
22+
uses: pypa/[email protected].10
2323
with:
2424
user: __token__
2525
password: ${{ secrets.pypi_password }}

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
os:
1313
- ubuntu-latest
14-
python: [3.7]
14+
python: [ 3.7, 3.9]
1515
splunk-version:
1616
- "8.1"
1717
- "8.2"

CHANGELOG.md

+40-20
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
# Splunk Enterprise SDK for Python Changelog
22

3+
## Version 2.0.0
4+
5+
### Feature updates
6+
* `ensure_binary`, `ensure_str` and `assert_regex` utility methods have been migrated from `six.py` to `splunklib/utils.py`
7+
8+
### Major changes
9+
* Removed code specific to Python 2
10+
* Removed six.py dependency
11+
* Removed `__future__` imports
12+
* Refactored and Updated `splunklib` and `tests` to utilize Python 3 features
13+
* Updated CI test matrix to run with Python versions - 3.7 and 3.9
14+
* Refactored Code throwing `deprecation` warnings
15+
* Refactored Code violating Pylint rules
16+
17+
### Bug fixes
18+
* [#527](https://github.com/splunk/splunk-sdk-python/issues/527) Added check for user roles
19+
* Fix to access the metadata "finished" field in search commands using the v2 protocol
20+
* Fix for error messages about ChunkedExternProcessor in splunkd.log for Custom Search Commands
21+
22+
323
## Version 1.7.4
424

525
### Bug fixes
6-
* [#532](https://github.com/splunk/splunk-sdk-python/pull/532) update encoding errors mode to 'replace' [[issue#505](https://github.com/splunk/splunk-sdk-python/issues/505)]
7-
* [#507](https://github.com/splunk/splunk-sdk-python/pull/507) masked sensitive data in logs [[issue#506](https://github.com/splunk/splunk-sdk-python/issues/506)]
26+
* [#532](https://github.com/splunk/splunk-sdk-python/pull/532) Update encoding errors mode to 'replace' [[issue#505](https://github.com/splunk/splunk-sdk-python/issues/505)]
27+
* [#507](https://github.com/splunk/splunk-sdk-python/pull/507) Masked sensitive data in logs [[issue#506](https://github.com/splunk/splunk-sdk-python/issues/506)]
828

929
### Minor changes
1030
* [#530](https://github.com/splunk/splunk-sdk-python/pull/530) Update GitHub CI build status in README and removed RTD(Read The Docs) reference
@@ -35,7 +55,7 @@
3555
* [#471](https://github.com/splunk/splunk-sdk-python/pull/471) Fixed support of Load Balancer "sticky sessions" (persistent cookies) [[issue#438](https://github.com/splunk/splunk-sdk-python/issues/438)]
3656

3757
### Minor changes
38-
* [#466](https://github.com/splunk/splunk-sdk-python/pull/466) tests for CSC apps
58+
* [#466](https://github.com/splunk/splunk-sdk-python/pull/466) Tests for CSC apps
3959
* [#467](https://github.com/splunk/splunk-sdk-python/pull/467) Added 'kwargs' parameter for Saved Search History function
4060
* [#475](https://github.com/splunk/splunk-sdk-python/pull/475) README updates
4161

@@ -45,10 +65,10 @@
4565
* [#468](https://github.com/splunk/splunk-sdk-python/pull/468) SDK Support for splunkd search API changes
4666

4767
### Bug fixes
48-
* [#464](https://github.com/splunk/splunk-sdk-python/pull/464) updated checks for wildcards in StoragePasswords [[issue#458](https://github.com/splunk/splunk-sdk-python/issues/458)]
68+
* [#464](https://github.com/splunk/splunk-sdk-python/pull/464) Updated checks for wildcards in StoragePasswords [[issue#458](https://github.com/splunk/splunk-sdk-python/issues/458)]
4969

5070
### Minor changes
51-
* [#463](https://github.com/splunk/splunk-sdk-python/pull/463) Preserve thirdparty cookies
71+
* [#463](https://github.com/splunk/splunk-sdk-python/pull/463) Preserve third-party cookies
5272

5373
## Version 1.6.20
5474

@@ -74,7 +94,7 @@
7494
* Pre-requisite: Query parameter 'output_mode' must be set to 'json'
7595
* Improves performance by approx ~80-90%
7696
* ResultsReader is deprecated and will be removed in future releases (NOTE: Please migrate to JSONResultsReader)
77-
* [#437](https://github.com/splunk/splunk-sdk-python/pull/437) added setup_logging() method in splunklib for logging
97+
* [#437](https://github.com/splunk/splunk-sdk-python/pull/437) Added setup_logging() method in splunklib for logging
7898
* [#426](https://github.com/splunk/splunk-sdk-python/pull/426) Added new github_commit modular input example
7999
* [#392](https://github.com/splunk/splunk-sdk-python/pull/392) Break out search argument to option parsing for v2 custom search commands
80100
* [#384](https://github.com/splunk/splunk-sdk-python/pull/384) Added Float parameter validator for custom search commands
@@ -90,17 +110,17 @@
90110
### Minor changes
91111
* [#440](https://github.com/splunk/splunk-sdk-python/pull/440) Github release workflow modified to generate docs
92112
* [#430](https://github.com/splunk/splunk-sdk-python/pull/430) Fix indentation in README
93-
* [#429](https://github.com/splunk/splunk-sdk-python/pull/429) documented how to access modular input metadata
113+
* [#429](https://github.com/splunk/splunk-sdk-python/pull/429) Documented how to access modular input metadata
94114
* [#427](https://github.com/splunk/splunk-sdk-python/pull/427) Replace .splunkrc with .env file in test and examples
95115
* [#424](https://github.com/splunk/splunk-sdk-python/pull/424) Float validator test fix
96-
* [#423](https://github.com/splunk/splunk-sdk-python/pull/423) Python3 compatibility for ResponseReader.__str__()
116+
* [#423](https://github.com/splunk/splunk-sdk-python/pull/423) Python 3 compatibility for ResponseReader.__str__()
97117
* [#422](https://github.com/splunk/splunk-sdk-python/pull/422) ordereddict and all its reference removed
98118
* [#421](https://github.com/splunk/splunk-sdk-python/pull/421) Update README.md
99119
* [#387](https://github.com/splunk/splunk-sdk-python/pull/387) Update filter.py
100120
* [#331](https://github.com/splunk/splunk-sdk-python/pull/331) Fix a couple of warnings spotted when running python 2.7 tests
101121
* [#330](https://github.com/splunk/splunk-sdk-python/pull/330) client: use six.string_types instead of basestring
102122
* [#329](https://github.com/splunk/splunk-sdk-python/pull/329) client: remove outdated comment in Index.submit
103-
* [#262](https://github.com/splunk/splunk-sdk-python/pull/262) properly add parameters to request based on the method of the request
123+
* [#262](https://github.com/splunk/splunk-sdk-python/pull/262) Properly add parameters to request based on the method of the request
104124
* [#237](https://github.com/splunk/splunk-sdk-python/pull/237) Don't output close tags if you haven't written a start tag
105125
* [#149](https://github.com/splunk/splunk-sdk-python/pull/149) "handlers" stanza missing in examples/searchcommands_template/default/logging.conf
106126

@@ -170,7 +190,7 @@ https://github.com/splunk/splunk-sdk-python/blob/develop/README.md#customization
170190
* Fixed regression in mod inputs which resulted in error ’file' object has no attribute 'readable’, by not forcing to text/bytes in mod inputs event writer any longer.
171191

172192
### Minor changes
173-
* Minor updates to the splunklib search commands to support Python3
193+
* Minor updates to the splunklib search commands to support Python 3
174194

175195
## Version 1.6.12
176196

@@ -179,32 +199,32 @@ https://github.com/splunk/splunk-sdk-python/blob/develop/README.md#customization
179199
* Made modinput text consistent
180200

181201
### Bug fixes
182-
* Changed permissions from 755 to 644 for python files to pass appinspect checks
202+
* Changed permissions from 755 to 644 for Python files to pass Appinspect checks
183203
* Removed version check on ssl verify toggle
184204

185205
## Version 1.6.11
186206

187207
### Bug Fix
188208

189-
* Fix custom search command V2 failures on Windows for Python3
209+
* Fix custom search command V2 failures on Windows for Python 3
190210

191211
## Version 1.6.10
192212

193213
### Bug Fix
194214

195-
* Fix long type gets wrong values on windows for python 2
215+
* Fix long type gets wrong values on Windows for Python 2
196216

197217
## Version 1.6.9
198218

199219
### Bug Fix
200220

201-
* Fix buffered input in python 3
221+
* Fix buffered input in Python 3
202222

203223
## Version 1.6.8
204224

205225
### Bug Fix
206226

207-
* Fix custom search command on python 3 on windows
227+
* Fix custom search command on Python 3 on Windows
208228

209229
## Version 1.6.7
210230

@@ -278,7 +298,7 @@ The following bugs have been fixed:
278298

279299
### Minor changes
280300

281-
* Use relative imports throughout the the SDK.
301+
* Use relative imports throughout the SDK.
282302

283303
* Performance improvement when constructing `Input` entity paths.
284304

@@ -417,15 +437,15 @@ The following bugs have been fixed:
417437

418438
* Added a script (GenerateHelloCommand) to the searchcommand_app to generate a custom search command.
419439

420-
* Added a human readable argument titles to modular input examples.
440+
* Added a human-readable argument titles to modular input examples.
421441

422442
* Renamed the searchcommand `csv` module to `splunk_csv`.
423443

424444
### Bug fixes
425445

426446
* Now entities that contain slashes in their name can be created, accessed and deleted correctly.
427447

428-
* Fixed a perfomance issue with connecting to Splunk on Windows.
448+
* Fixed a performance issue with connecting to Splunk on Windows.
429449

430450
* Improved the `service.restart()` function.
431451

@@ -519,7 +539,7 @@ The following bugs have been fixed:
519539
### Bug fixes
520540

521541
* When running `setup.py dist` without running `setup.py build`, there is no
522-
longer an `No such file or directory` error on the command line, and the
542+
longer a `No such file or directory` error on the command line, and the
523543
command behaves as expected.
524544

525545
* When setting the sourcetype of a modular input event, events are indexed
@@ -541,7 +561,7 @@ The following bugs have been fixed:
541561
### Bug fix
542562

543563
* When running `setup.py dist` without running `setup.py build`, there is no
544-
longer an `No such file or directory` error on the command line, and the
564+
longer a `No such file or directory` error on the command line, and the
545565
command behaves as expected.
546566

547567
* When setting the sourcetype of a modular input event, events are indexed properly.

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ docs:
3434
.PHONY: test
3535
test:
3636
@echo "$(ATTN_COLOR)==> test $(NO_COLOR)"
37-
@tox -e py27,py37
37+
@tox -e py37,py39
3838

3939
.PHONY: test_specific
4040
test_specific:
@@ -44,17 +44,17 @@ test_specific:
4444
.PHONY: test_smoke
4545
test_smoke:
4646
@echo "$(ATTN_COLOR)==> test_smoke $(NO_COLOR)"
47-
@tox -e py27,py37 -- -m smoke
47+
@tox -e py37,py39 -- -m smoke
4848

4949
.PHONY: test_no_app
5050
test_no_app:
5151
@echo "$(ATTN_COLOR)==> test_no_app $(NO_COLOR)"
52-
@tox -e py27,py37 -- -m "not app"
52+
@tox -e py37,py39 -- -m "not app"
5353

5454
.PHONY: test_smoke_no_app
5555
test_smoke_no_app:
5656
@echo "$(ATTN_COLOR)==> test_smoke_no_app $(NO_COLOR)"
57-
@tox -e py27,py37 -- -m "smoke and not app"
57+
@tox -e py37,py39 -- -m "smoke and not app"
5858

5959
.PHONY: env
6060
env:

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# The Splunk Enterprise Software Development Kit for Python
66

7-
#### Version 1.7.4
7+
#### Version 2.0.0
88

99
The Splunk Enterprise Software Development Kit (SDK) for Python contains library code designed to enable developers to build applications using the Splunk platform.
1010

@@ -19,19 +19,19 @@ The Splunk developer platform enables developers to take advantage of the same t
1919

2020
## Get started with the Splunk Enterprise SDK for Python
2121

22-
The Splunk Enterprise SDK for Python contains library code, and it's examples are located in the [splunk-app-examples](https://github.com/splunk/splunk-app-examples) repository, that show how to programmatically interact with the Splunk platform for a variety of scenarios including searching, saved searches, data inputs, and many more, along with building complete applications.
22+
The Splunk Enterprise SDK for Python contains library code, and its examples are located in the [splunk-app-examples](https://github.com/splunk/splunk-app-examples) repository. They show how to programmatically interact with the Splunk platform for a variety of scenarios including searching, saved searches, data inputs, and many more, along with building complete applications.
2323

2424
### Requirements
2525

2626
Here's what you need to get going with the Splunk Enterprise SDK for Python.
2727

28-
* Python 2.7+ or Python 3.7.
28+
* Python 3.7 or Python 3.9
2929

30-
The Splunk Enterprise SDK for Python has been tested with Python v2.7 and v3.7.
30+
The Splunk Enterprise SDK for Python is compatible with python3 and has been tested with Python v3.7 and v3.9.
3131

32-
* Splunk Enterprise 9.0 or 8.2
32+
* Splunk Enterprise 9.2 or 8.2
3333

34-
The Splunk Enterprise SDK for Python has been tested with Splunk Enterprise 9.0, 8.2 and 8.1
34+
The Splunk Enterprise SDK for Python has been tested with Splunk Enterprise 9.2, 8.2 and 8.1
3535

3636
If you haven't already installed Splunk Enterprise, download it [here](http://www.splunk.com/download).
3737
For more information, see the Splunk Enterprise [_Installation Manual_](https://docs.splunk.com/Documentation/Splunk/latest/Installation).
@@ -61,7 +61,7 @@ Install the sources you cloned from GitHub:
6161
You'll need `docker` and `docker-compose` to get up and running using this method.
6262

6363
```
64-
make up SPLUNK_VERSION=9.0
64+
make up SPLUNK_VERSION=9.2
6565
make wait_up
6666
make test
6767
make down
@@ -110,7 +110,7 @@ here is an example of .env file:
110110
# Access scheme (default: https)
111111
scheme=https
112112
# Your version of Splunk Enterprise
113-
version=9.0
113+
version=9.2
114114
# Bearer token for authentication
115115
#splunkToken=<Bearer-token>
116116
# Session key for authentication

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
# General information about the project.
4545
project = u'Splunk SDK for Python'
46-
copyright = u'2021, Splunk Inc'
46+
copyright = u'2024, Splunk Inc'
4747

4848
# The version info for the project you're documenting, acts as replacement for
4949
# |version| and |release|, also used in various other places throughout the

scripts/build-env.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2011-2020 Splunk, Inc.
1+
# Copyright 2011-2024 Splunk, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"): you may
44
# not use this file except in compliance with the License. You may obtain

scripts/test_specific.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
echo "To run a specific test:"
2-
echo " tox -e py27,py37 [test_file_path]::[TestClassName]::[test_method]"
2+
echo " tox -e py37,py39 [test_file_path]::[TestClassName]::[test_method]"
33
echo "For Example, To run 'test_autologin' testcase from 'test_service.py' file run"
44
echo " tox -e py37 -- tests/test_service.py::ServiceTestCase::test_autologin"

setup.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
#
3-
# Copyright 2011-2015 Splunk, Inc.
3+
# Copyright © 2011-2024 Splunk, Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"): you may
66
# not use this file except in compliance with the License. You may obtain
@@ -24,10 +24,7 @@
2424
failed = False
2525

2626
def run_test_suite():
27-
try:
28-
import unittest2 as unittest
29-
except ImportError:
30-
import unittest
27+
import unittest
3128

3229
def mark_failed():
3330
global failed

sitecustomize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
#
3-
# Copyright 2011-2015 Splunk, Inc.
3+
# Copyright © 2011-2024 Splunk, Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"): you may
66
# not use this file except in compliance with the License. You may obtain

splunklib/__init__.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2011-2015 Splunk, Inc.
1+
# Copyright © 2011-2024 Splunk, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"): you may
44
# not use this file except in compliance with the License. You may obtain
@@ -14,12 +14,10 @@
1414

1515
"""Python library for Splunk."""
1616

17-
from __future__ import absolute_import
18-
from splunklib.six.moves import map
1917
import logging
2018

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

2523

@@ -31,5 +29,6 @@ def setup_logging(level, log_format=DEFAULT_LOG_FORMAT, date_format=DEFAULT_DATE
3129
format=log_format,
3230
datefmt=date_format)
3331

34-
__version_info__ = (1, 7, 4)
32+
33+
__version_info__ = (2, 0, 0)
3534
__version__ = ".".join(map(str, __version_info__))

0 commit comments

Comments
 (0)