Skip to content

Commit f37f17e

Browse files
authored
Merge pull request #456 from splunk/py3-code-migration
Removed Support for Python2
2 parents e249ec1 + 85807ef commit f37f17e

File tree

92 files changed

+1485
-2825
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

+1485
-2825
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Splunk Enterprise SDK for Python Changelog
22

3+
## Version 2.0.0-beta
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 Python2
10+
* Removed six.py dependency
11+
* Removed `__future__` imports
12+
* Refactored & Updated `splunklib` and `tests` to utilise Python3 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
316
## Version 1.7.4
417

518
### Bug fixes

Makefile

Lines changed: 4 additions & 4 deletions
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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ The Splunk Enterprise SDK for Python contains library code, and it's examples ar
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)