Skip to content
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
10 changes: 5 additions & 5 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
with:
fetch-depth: 0 # setuptools_scm needs this to calculate the version

- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.10"

- name: Save pip cache
uses: actions/cache@v4
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9","3.10","3.11", "3.12"]
python-version: ["3.10","3.11", "3.12", "3.13", "3.14"]


steps:
Expand Down Expand Up @@ -166,10 +166,10 @@ jobs:

# steps:
# - uses: actions/checkout@v4
# - name: Set up Python 3.9
# - name: Set up Python 3.10
# uses: actions/setup-python@v5
# with:
# python-version: 3.9
# python-version: "3.10"

# - name: Save pip cache
# uses: actions/cache@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dist
htmlcov
venv
docs/src/
_version.py

.coverage
.coverage.develop
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TOX_ENV := .tox/wheel/pyvenv.cfg
WHEEL = $(wildcard dist/*.whl)
PIP = python -m pip install --upgrade --upgrade-strategy eager

PYTHON_VERSIONS = 3.9 3.10 3.11 3.12 3.13
PYTHON_VERSIONS = 3.10 3.11 3.12 3.13 3.14
comma := ,
empty :=
space := $(empty) $(empty)
Expand Down Expand Up @@ -54,7 +54,7 @@ venv: Makefile
python -m venv $@

# Build wheel and source tarball for upload to PyPI
build: README.rst $(SRCS)
build: docs/readme.rst $(SRCS)
python setup.py sdist bdist_wheel
@touch $@

Expand Down Expand Up @@ -175,7 +175,6 @@ clean:
rm -rf .coverage .coverage.develop .lint .mypy_cache .static .tox .wheel htmlcov .twinecheck
rm -rf $(PKG)/__pycache__ $(TPKG)/__pycache__ $(TPKG)/cli/__pycache__/ $(TPKG)/config/__pycache__
rm -rf build dist src/*.egg-info .eggs
make -C docs clean

clean-all: clean
rm -rf cache
rm -rf cache venv
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ University of Illinois Urbana-Champaign on a best-effort basis.
As of the last update to this README, the expected End-of-Life
and End-of-Support dates of this product are 29 September 2027.

Per `Splunk Software Support Policy`_, each minor release of Splunk SOAR is supported for 24 months after the release. Splunk SOAR 7.0.0 Release notes give a release date of
Per `Splunk Software Support Policy`_, each minor release of Splunk SOAR is supported for 24 months after the release. Splunk SOAR 7.0.0 Release notes give a release date of
29 September 2027.

.. _Splunk Software Support Policy: https://www.splunk.com/en_us/legal/splunk-software-support-policy.html

End-of-Life was decided upon based on these dependencies:

- Python 3.13 (31 October 2029) `End of Life for Python Versions`_
- Python 3.14 (31 October 2030) `End of Life for Python Versions`_
- Splunk SOAR 7.0.0 (29 September 2027) `Splunk SOAR 7.0.0 Release Notes`_

.. _End of Life for Python Versions: https://endoflife.date/python
Expand Down
48 changes: 24 additions & 24 deletions docs/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ so we recommend ensuring setuptools is up to date before installing::
Usage
=====

The following `__init__` and `handle_action` boilerplate are required:

```python
class ExampleConnector(BaseConnector, NiceBaseConnector):
def __init__(self):
BaseConnector.__init__(self)
NiceBaseConnector.__init__(
self, phantom.APP_SUCCESS, phantom.APP_ERROR)

def handle_action(self, param):
# handle_action is an abstract method; it MUST be implemented here.
self.nice_handle_action(param)
```

The decorator `@handle` is used to register a handler to process an action:

```python
@handle('add')
def _handle_add(self, param):
action_result = self.add_action_result(ActionResult(dict(param)))

return action_result.set_status(phantom.APP_SUCCESS,
f"Sum {self.x + self.y}")
```
The following `__init__` and `handle_action` boilerplate are required::

```python
class ExampleConnector(BaseConnector, NiceBaseConnector):
def __init__(self):
BaseConnector.__init__(self)
NiceBaseConnector.__init__(
self, phantom.APP_SUCCESS, phantom.APP_ERROR)

def handle_action(self, param):
# handle_action is an abstract method; it MUST be implemented here.
self.nice_handle_action(param)
```

The decorator `@handle` is used to register a handler to process an action::

```python
@handle('add')
def _handle_add(self, param):
action_result = self.add_action_result(ActionResult(dict(param)))

return action_result.set_status(phantom.APP_SUCCESS,
f"Sum {self.x + self.y}")
```
62 changes: 62 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,68 @@
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "phantom-toolbox"
dynamic = ["version"]
dependencies = [
"requests",
"wheel-inspect",
]
description = "Splunk SOAR Application development libraries and utilities"
authors = [
{name = "David D. Riddle", email = "securitysupport@illinois.edu"}
]
readme = "docs/readme.rst"
license = { text = "NCSA" }
classifiers = [
"Development Status :: 3 - Alpha",
"Operating System :: OS Independent",
"Environment :: Console",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Libraries",
"Topic :: Security",
"Topic :: Utilities",
]
requires-python = ">=3.10"

[project.urls]
Homepage = "https://github.com/techservicesillinois/phantom-toolbox/"
"Bug Reports" = "https://github.com/techservicesillinois/phantom-toolbox/issues"
Source = "https://github.com/techservicesillinois/phantom-toolbox/"
Changelog = "https://github.com/techservicesillinois/phantom-toolbox/blob/main/CHANGELOG.md"

[project.optional-dependencies]
test = [
"pytest",
"coverage",
"setuptools_scm", # Hack to install pytest-splunk-soar-connectors
"pytest-splunk-soar-connectors @ git+https://github.com/splunk/pytest-splunk-soar-connectors.git",
]

[project.scripts]
phantom = "phtoolbox.cli:main"

[options]
include-package-data = true

[options.package_data]
phtoolbox = "py.typed"

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools_scm]
version_file = "src/phtoolbox/_version.py"
local_scheme = "dirty-tag"

[tool.pytest.ini_options]
minversion = "7.2"
pythonpath = "src"
Expand Down
50 changes: 0 additions & 50 deletions setup.cfg

This file was deleted.

21 changes: 2 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
from setuptools import setup
import setuptools


def version():
from setuptools_scm.version import get_local_dirty_tag

def clean_scheme(version):
# Disable local scheme by default since it is not supported
# by PyPI (See PEP 440). If code is not committed add +dirty
# to version to prevent upload to either PyPI or test PyPI.
return get_local_dirty_tag(version) if version.dirty else ''

return {'local_scheme': clean_scheme}


setup(
use_scm_version=version,
setup_requires=['setuptools_scm', 'wheel'],
package_data={"phtoolbox": ["py.typed"]},
)
setuptools.setup()
Loading