Skip to content
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

Release/2.0.0 #564

Merged
merged 76 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
72d5fe1
removing python 2.7 from CI and local testing
ashah-splunk May 6, 2022
e3a09e7
code changes based on Pylint and 2to3 tool suggestions
ashah-splunk May 6, 2022
6429ae4
refractoring
ashah-splunk May 6, 2022
4cb0f4a
code changes
ashah-splunk May 6, 2022
aeae735
reverting f string change
ashah-splunk May 6, 2022
b0ca411
adding python 3.9 to CI
ashah-splunk May 9, 2022
5c90746
Merge branch 'py3-code-migration' into py3-testcases-refractor
ashah-splunk May 9, 2022
9329894
removed support for python2 from modularinput
akaila-splunk May 11, 2022
308873b
Merge branch 'py3-code-migration' into py3-modularinput-refactor
akaila-splunk May 11, 2022
83ecdf4
Update __init__.py
vmalaviya-splunk May 11, 2022
fe37aeb
Update binding.py
vmalaviya-splunk May 11, 2022
3231549
Update client.py
vmalaviya-splunk May 11, 2022
66dc351
Update data.py
vmalaviya-splunk May 11, 2022
a808a03
Update results.py
vmalaviya-splunk May 11, 2022
7e63b6a
Delete six.py
vmalaviya-splunk May 11, 2022
739a94a
Merge pull request #453 from splunk/py3-modularinput-refactor
ashah-splunk May 11, 2022
64de6a4
Merge pull request #454 from splunk/py3-testcases-refractor
ashah-splunk May 11, 2022
f68d408
Merge pull request #455 from splunk/py2to3-core
ashah-splunk May 11, 2022
4735248
Update argument.py
ashah-splunk May 11, 2022
464e75d
Merge branch 'py3-code-migration' of https://github.com/splunk/splunk…
ashah-splunk May 11, 2022
a066e7c
python 3.9
ashah-splunk May 11, 2022
5340cfc
Update tox.ini
ashah-splunk May 11, 2022
893b0d7
changes
ashah-splunk May 11, 2022
ec6907a
test changes for six.py removal
ashah-splunk May 11, 2022
9ffee31
refractor changes
ashah-splunk May 12, 2022
9df86a2
Merge branch 'develop' into py3-code-migration
ashah-splunk May 12, 2022
2c207d9
Update binding.py
ashah-splunk May 16, 2022
0250984
Update results.py
ashah-splunk May 16, 2022
b8d5b9c
Update client.py
ashah-splunk May 16, 2022
ea0b34b
refactoring
ashah-splunk May 17, 2022
079df7b
2to3 code refactoring
ashah-splunk May 17, 2022
3af370d
test case fix
ashah-splunk May 17, 2022
3a26633
sonar changes
ashah-splunk May 17, 2022
924a0eb
adding else after raise
ashah-splunk May 17, 2022
ed117bc
2to3 suggested changes
ashah-splunk May 17, 2022
468c92a
Update Makefile
ashah-splunk May 25, 2022
c772272
refractor changes
akaila-splunk Jun 3, 2022
78d9610
Merge branch 'develop' into py3-code-migration
ashah-splunk Jun 17, 2022
ff3f814
Update test.yml
ashah-splunk Oct 12, 2022
5094e0e
Update test.yml
ashah-splunk Oct 12, 2022
f1080cf
Merge branch 'develop' into py3-code-migration
akaila-splunk Oct 13, 2022
917cf04
updated binding.py
akaila-splunk Oct 13, 2022
8cc4c21
updated comments examples
akaila-splunk Nov 4, 2022
fc9b7c0
Merge branch 'develop' into py3-code-migration
ashah-splunk Dec 2, 2022
bf40010
added access to finished flag within metadata
ashah-splunk Dec 20, 2022
72372f9
Update internals.py
ashah-splunk Dec 20, 2022
14cdb92
Update test_search_command.py
ashah-splunk Dec 21, 2022
8c90d1e
refactoring
ashah-splunk Jan 17, 2023
fbcdd82
Merge branch 'develop' into py3-code-migration
ashah-splunk Feb 21, 2023
0766ed8
Update client.py
ashah-splunk Feb 22, 2023
b003be2
update string formatting
akaila-splunk Mar 3, 2023
3354403
Update test.yml
ashah-splunk Mar 9, 2023
d18b735
Copyright year updates
ashah-splunk Mar 9, 2023
d091844
Merge branch 'develop' into py3-code-migration
ashah-splunk Aug 7, 2023
2ee5000
matrix update
ashah-splunk Aug 7, 2023
21323ea
moved utility/helper functions to utils.py file
akaila-splunk Aug 21, 2023
d8d7da4
updates
ashah-splunk Sep 8, 2023
f40d2e8
Merge branch 'py3-code-migration' of https://github.com/splunk/splunk…
ashah-splunk Sep 8, 2023
54a6926
added check for user role
akaila-splunk Nov 8, 2023
e249ec1
Merge pull request #556 from splunk/master
ashah-splunk Feb 2, 2024
0738778
Removed __test__ flags
ashah-splunk Feb 5, 2024
a8ede1a
Updates as per the review/feedback comments
ashah-splunk Feb 7, 2024
bad9127
Copyright year updates
ashah-splunk Feb 17, 2024
621232a
Remove conversion of iterables into list objects
maszyk99 Mar 4, 2024
6082881
Remove pass statement
maszyk99 Mar 4, 2024
9053482
Remove unneeded string format usage
maszyk99 Mar 4, 2024
1d1cc20
Pass correct args to logger
maszyk99 Mar 7, 2024
d805a7a
updated code
ashah-splunk Mar 13, 2024
e23fa4d
Update internals.py
ashah-splunk Mar 13, 2024
a633d6f
Add comment about json encoder back
maszyk99 Mar 13, 2024
85807ef
reverted line separators
ashah-splunk Mar 15, 2024
f37f17e
Merge pull request #456 from splunk/py3-code-migration
ashah-splunk Mar 15, 2024
b12a4bf
Version updated
ashah-splunk Mar 15, 2024
9baa455
Update README.md
PKing70 Mar 18, 2024
d849fda
Update CHANGELOG.md
PKing70 Mar 18, 2024
dbe72dd
Merge pull request #565 from splunk/PKing70-patch-1
ashah-splunk Mar 20, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Build package
run: python setup.py sdist
- name: Publish package to PyPI
uses: pypa/[email protected].8
uses: pypa/[email protected].10
with:
user: __token__
password: ${{ secrets.pypi_password }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
matrix:
os:
- ubuntu-latest
python: [3.7]
python: [ 3.7, 3.9]
splunk-version:
- "8.1"
- "8.2"
Expand Down
60 changes: 40 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
# Splunk Enterprise SDK for Python Changelog

## Version 2.0.0

### Feature updates
* `ensure_binary`, `ensure_str` and `assert_regex` utility methods have been migrated from `six.py` to `splunklib/utils.py`

### Major changes
* Removed code specific to Python 2
* Removed six.py dependency
* Removed `__future__` imports
* Refactored and Updated `splunklib` and `tests` to utilize Python 3 features
* Updated CI test matrix to run with Python versions - 3.7 and 3.9
* Refactored Code throwing `deprecation` warnings
* Refactored Code violating Pylint rules

### Bug fixes
* [#527](https://github.com/splunk/splunk-sdk-python/issues/527) Added check for user roles
* Fix to access the metadata "finished" field in search commands using the v2 protocol
* Fix for error messages about ChunkedExternProcessor in splunkd.log for Custom Search Commands


## Version 1.7.4

### Bug fixes
* [#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)]
* [#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)]
* [#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)]
* [#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)]

### Minor changes
* [#530](https://github.com/splunk/splunk-sdk-python/pull/530) Update GitHub CI build status in README and removed RTD(Read The Docs) reference
Expand Down Expand Up @@ -35,7 +55,7 @@
* [#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)]

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

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

### Bug fixes
* [#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)]
* [#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)]

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

## Version 1.6.20

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

Expand Down Expand Up @@ -170,7 +190,7 @@ https://github.com/splunk/splunk-sdk-python/blob/develop/README.md#customization
* 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.

### Minor changes
* Minor updates to the splunklib search commands to support Python3
* Minor updates to the splunklib search commands to support Python 3

## Version 1.6.12

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

### Bug fixes
* Changed permissions from 755 to 644 for python files to pass appinspect checks
* Changed permissions from 755 to 644 for Python files to pass Appinspect checks
* Removed version check on ssl verify toggle

## Version 1.6.11

### Bug Fix

* Fix custom search command V2 failures on Windows for Python3
* Fix custom search command V2 failures on Windows for Python 3

## Version 1.6.10

### Bug Fix

* Fix long type gets wrong values on windows for python 2
* Fix long type gets wrong values on Windows for Python 2

## Version 1.6.9

### Bug Fix

* Fix buffered input in python 3
* Fix buffered input in Python 3

## Version 1.6.8

### Bug Fix

* Fix custom search command on python 3 on windows
* Fix custom search command on Python 3 on Windows

## Version 1.6.7

Expand Down Expand Up @@ -278,7 +298,7 @@ The following bugs have been fixed:

### Minor changes

* Use relative imports throughout the the SDK.
* Use relative imports throughout the SDK.

* Performance improvement when constructing `Input` entity paths.

Expand Down Expand Up @@ -417,15 +437,15 @@ The following bugs have been fixed:

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

* Added a human readable argument titles to modular input examples.
* Added a human-readable argument titles to modular input examples.

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

### Bug fixes

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

* Fixed a perfomance issue with connecting to Splunk on Windows.
* Fixed a performance issue with connecting to Splunk on Windows.

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

Expand Down Expand Up @@ -519,7 +539,7 @@ The following bugs have been fixed:
### Bug fixes

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

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

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

* When setting the sourcetype of a modular input event, events are indexed properly.
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ docs:
.PHONY: test
test:
@echo "$(ATTN_COLOR)==> test $(NO_COLOR)"
@tox -e py27,py37
@tox -e py37,py39

.PHONY: test_specific
test_specific:
Expand All @@ -44,17 +44,17 @@ test_specific:
.PHONY: test_smoke
test_smoke:
@echo "$(ATTN_COLOR)==> test_smoke $(NO_COLOR)"
@tox -e py27,py37 -- -m smoke
@tox -e py37,py39 -- -m smoke

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

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

.PHONY: env
env:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# The Splunk Enterprise Software Development Kit for Python

#### Version 1.7.4
#### Version 2.0.0

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

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

## Get started with the Splunk Enterprise SDK for Python

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.
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.

### Requirements

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

* Python 2.7+ or Python 3.7.
* Python 3.7 or Python 3.9

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

* Splunk Enterprise 9.0 or 8.2
* Splunk Enterprise 9.2 or 8.2

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

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

```
make up SPLUNK_VERSION=9.0
make up SPLUNK_VERSION=9.2
make wait_up
make test
make down
Expand Down Expand Up @@ -110,7 +110,7 @@ here is an example of .env file:
# Access scheme (default: https)
scheme=https
# Your version of Splunk Enterprise
version=9.0
version=9.2
# Bearer token for authentication
#splunkToken=<Bearer-token>
# Session key for authentication
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

# General information about the project.
project = u'Splunk SDK for Python'
copyright = u'2021, Splunk Inc'
copyright = u'2024, Splunk Inc'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2011-2020 Splunk, Inc.
# Copyright 2011-2024 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
Expand Down
2 changes: 1 addition & 1 deletion scripts/test_specific.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo "To run a specific test:"
echo " tox -e py27,py37 [test_file_path]::[TestClassName]::[test_method]"
echo " tox -e py37,py39 [test_file_path]::[TestClassName]::[test_method]"
echo "For Example, To run 'test_autologin' testcase from 'test_service.py' file run"
echo " tox -e py37 -- tests/test_service.py::ServiceTestCase::test_autologin"
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, Inc.
# Copyright © 2011-2024 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
Expand All @@ -24,10 +24,7 @@
failed = False

def run_test_suite():
try:
import unittest2 as unittest
except ImportError:
import unittest
import unittest

def mark_failed():
global failed
Expand Down
2 changes: 1 addition & 1 deletion sitecustomize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, Inc.
# Copyright © 2011-2024 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
Expand Down
9 changes: 4 additions & 5 deletions splunklib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2011-2015 Splunk, Inc.
# Copyright © 2011-2024 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
Expand All @@ -14,12 +14,10 @@

"""Python library for Splunk."""

from __future__ import absolute_import
from splunklib.six.moves import map
import logging

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


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

__version_info__ = (1, 7, 4)

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