Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Synse authored Mar 21, 2024
2 parents 788ab3a + f37f17e commit a7d2f5a
Show file tree
Hide file tree
Showing 92 changed files with 1,560 additions and 2,839 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2.3.2
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: pip install twine
- name: Build package
run: python setup.py sdist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.3.1
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.pypi_password }}
Expand Down
9 changes: 6 additions & 3 deletions .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: [ 2.7, 3.7 ]
python: [ 3.7, 3.9]
splunk-version:
- "8.1"
- "8.2"
Expand All @@ -20,13 +20,13 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Run docker-compose
run: SPLUNK_VERSION=${{matrix.splunk-version}} docker-compose up -d

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

Expand All @@ -35,3 +35,6 @@ jobs:

- name: Test Execution
run: tox -e py
fossa-scan:
uses: splunk/oss-scanning-public/.github/workflows/oss-scan.yml@main
secrets: inherit
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Splunk Enterprise SDK for Python Changelog

## Version 2.0.0-beta

### 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 Python2
* Removed six.py dependency
* Removed `__future__` imports
* Refactored & Updated `splunklib` and `tests` to utilise Python3 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
## 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)]

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

## Version 1.7.3

### Bug fixes
* [#493](https://github.com/splunk/splunk-sdk-python/pull/493) Fixed file permission for event_writer.py file [[issue#487](https://github.com/splunk/splunk-sdk-python/issues/487)]
* [#500](https://github.com/splunk/splunk-sdk-python/pull/500) Replaced index_field with accelerated_field for kvstore [[issue#497](https://github.com/splunk/splunk-sdk-python/issues/497)]
* [#502](https://github.com/splunk/splunk-sdk-python/pull/502) Updated check for IPv6 addresses

### Minor changes
* [#490](https://github.com/splunk/splunk-sdk-python/pull/490) Added ACL properties update feature
* [#495](https://github.com/splunk/splunk-sdk-python/pull/495) Added Splunk 8.1 in GitHub Actions Matrix
* [#485](https://github.com/splunk/splunk-sdk-python/pull/485) Added test case for cookie persistence
* [#503](https://github.com/splunk/splunk-sdk-python/pull/503) README updates on accessing "service" instance in CSC and ModularInput apps
* [#504](https://github.com/splunk/splunk-sdk-python/pull/504) Updated authentication token names in docs to reduce confusion
* [#494](https://github.com/splunk/splunk-sdk-python/pull/494) Reuse splunklib.__version__ in handler.request

## Version 1.7.2

### Minor changes
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
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[![Build Status](https://travis-ci.org/splunk/splunk-sdk-python.svg?branch=master)](https://travis-ci.org/splunk/splunk-sdk-python)
[![Documentation Status](https://readthedocs.org/projects/splunk-python-sdk/badge/?version=latest)](https://splunk-python-sdk.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://github.com/splunk/splunk-sdk-python/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/splunk/splunk-sdk-python/actions/workflows/test.yml)

[Reference Docs](https://dev.splunk.com/enterprise/reference)

# The Splunk Enterprise Software Development Kit for Python

#### Version 1.7.2
#### Version 1.7.4

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 @@ -24,13 +25,13 @@ The Splunk Enterprise SDK for Python contains library code, and it's examples ar

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 and 8.2
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 @@ -60,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 @@ -109,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 All @@ -127,7 +128,7 @@ The Splunk Enterprise SDK for Python contains a collection of unit tests. To run

You can also run individual test files, which are located in **/splunk-sdk-python/tests**. To run a specific test, enter:

make specific_test_name
make test_specific

The test suite uses Python's standard library, the built-in `unittest` library, `pytest`, and `tox`.

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
4 changes: 3 additions & 1 deletion scripts/test_specific.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
echo "To run a specific test:"
echo " tox -e py27,py37 [test_file_path]::[test_name]"
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, 2)

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

0 comments on commit a7d2f5a

Please sign in to comment.