Skip to content

Commit fd06efc

Browse files
committed
Remove tox
1 parent ce7a63f commit fd06efc

File tree

6 files changed

+1102
-351
lines changed

6 files changed

+1102
-351
lines changed

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[run]
22
omit =
3-
.tox/*
43
tests/*

.github/workflows/release.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
name: Release
1+
name: Publish SDK to PyPI
22
on:
33
release:
44
types: [published]
55

6+
env:
7+
PYTHON_VERSION: 3.9
8+
69
jobs:
7-
publish:
8-
name: Deploy release to PyPI
10+
publish-sdk:
11+
name: Publish SDK to PyPI
912
runs-on: ubuntu-latest
1013
permissions:
1114
id-token: write
@@ -14,24 +17,20 @@ jobs:
1417
steps:
1518
- name: Checkout source
1619
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
17-
- name: Set up Python
20+
- name: Set up Python ${{ env.PYTHON_VERSION }}
1821
uses: actions/setup-python@3d1e2d2ca0a067f27da6fec484fce7f5256def85
1922
with:
20-
python-version: 3.9
23+
python-version: ${{ env.PYTHON_VERSION }}
2124
- name: Install dependencies
22-
run: pip install build
23-
- name: Build package
25+
run: pip install .[docs]
26+
- name: Build packages for distribution
2427
run: python -m build
25-
- name: Publish package to PyPI
28+
- name: Publish packages to PyPI
2629
uses: pypa/gh-action-pypi-publish@d417ba7e7683fa9104c42abe611c1f2c93c0727d
27-
- name: Install tox
28-
run: pip install tox
29-
- name: Generate API docs
30-
run: |
31-
rm -rf ./docs/_build
32-
tox -e docs
33-
- name: Docs Upload
30+
- name: Generate API reference
31+
run: make -C ./docs html
32+
- name: Upload docs artifact
3433
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
3534
with:
36-
name: python_sdk_docs
35+
name: python-sdk-docs
3736
path: docs/_build/html

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions/setup-python@3d1e2d2ca0a067f27da6fec484fce7f5256def85
3030
with:
3131
python-version: ${{ matrix.python-version }}
32-
- name: Install tox
33-
run: pip install tox
32+
- name: Install dependencies
33+
run: pip install .[test]
3434
- name: Test Execution
35-
run: tox -e py -- ./tests
35+
run: python -m pytest ./tests

Makefile

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,44 @@ GREEN_COLOR=\033[32;01m
33

44
CONTAINER_NAME := 'splunk'
55

6-
.PHONY: docs
6+
.PHONY: docs test test-unit test-integration up wait_up remove down refresh start restart finish
77
docs:
88
@echo "$(GREEN_COLOR)==> docs $(RESET_COLOR)"
99
@rm -rf ./docs/_build
10-
@tox -e docs
11-
@cd ./docs/_build/html && zip -r ../docs_html.zip . -x ".*" -x "__MACOSX"
12-
@echo "$(ATTN_COLOR)==> Docs pages can be found at ./docs/_build/html, docs bundle available at ./docs/_build/docs_html.zip"
10+
@make -C ./docs html
11+
@echo "$(GREEN_COLOR)==> Docs pages can be found at docs/_build/html"
12+
@echo "$(GREEN_COLOR)==> Docs bundle available at docs/_build/docs_html.zip"
1313

14-
.PHONY: test
1514
test:
1615
@echo "$(GREEN_COLOR)==> test $(RESET_COLOR)"
17-
@tox -e py -- ./tests
16+
@python -m pytest ./tests
1817

19-
.PHONY: test-unit
2018
test:
2119
@echo "$(GREEN_COLOR)==> test $(RESET_COLOR)"
22-
@tox -e py -- ./tests/unit
20+
@python -m pytest ./tests/unit
2321

24-
.PHONY: test-integration
2522
test:
2623
@echo "$(GREEN_COLOR)==> test $(RESET_COLOR)"
27-
@tox -e py -- ./tests/integration ./tests/system
24+
@python -m pytest ./tests/integration ./tests/system
2825

29-
.PHONY: up
3026
up:
3127
@echo "$(GREEN_COLOR)==> up $(RESET_COLOR)"
3228
@docker-compose up -d
3329

34-
.PHONY: remove
3530
remove:
3631
@echo "$(GREEN_COLOR)==> rm $(RESET_COLOR)"
3732
@docker-compose rm -f -s
3833

39-
.PHONY: wait_up
4034
wait_up:
4135
@echo "$(GREEN_COLOR)==> wait_up $(RESET_COLOR)"
4236
@for i in `seq 0 180`; do if docker exec -it $(CONTAINER_NAME) /sbin/checkstate.sh &> /dev/null; then break; fi; printf "\rWaiting for Splunk for %s seconds..." $$i; sleep 1; done
4337

44-
.PHONY: down
4538
down:
4639
@echo "$(GREEN_COLOR)==> down $(RESET_COLOR)"
4740
@docker-compose stop
4841

49-
.PHONY: start
5042
start: up wait_up
5143

52-
.PHONY: restart
5344
restart: down start
5445

55-
.PHONY: refresh
5646
refresh: remove start

pyproject.toml

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ readme = "README.md"
1414
requires-python = ">=3.7"
1515
license = { text = "Apache-2.0" }
1616
authors = [{ name = "Splunk, Inc.", email = "[email protected]" }]
17+
keywords = ["splunk", "sdk"]
1718
classifiers = [
1819
"Programming Language :: Python :: 3",
1920
"Programming Language :: Python :: 3.7",
@@ -29,14 +30,17 @@ classifiers = [
2930

3031
dependencies = ["deprecation", "python-dotenv"]
3132

33+
3234
[dependency-groups]
33-
test = ["tox"]
34-
lint = ["mypy", "ruff"]
3535
build = ["build", "twine"]
36+
docs = ["sphinx", "jinja2"]
37+
lint = ["mypy", "ruff"]
38+
test = ["pytest", "pytest-cov"]
3639
dev = [
3740
{ include-group = "test" },
3841
{ include-group = "lint" },
3942
{ include-group = "build" },
43+
{ include-group = "docs" },
4044
]
4145

4246
[build-system]
@@ -59,31 +63,3 @@ select = [
5963
"ANN", # flake8 type annotations
6064
"RUF", # ruff-specific rules
6165
]
62-
63-
# ! TODO: Migrate to new config paradigm
64-
# https://tox.wiki/en/latest/config.html#pyproject-toml-ini
65-
[tool.tox]
66-
legacy_tox_ini = """
67-
[tox]
68-
envlist = docs,py{37,39,313}
69-
skipsdist = {env:TOXBUILD:false}
70-
71-
[testenv]
72-
passenv = LANG
73-
setenv = SPLUNK_HOME=/opt/splunk
74-
allowlist_externals = make
75-
deps = pytest
76-
pytest-cov
77-
python-dotenv
78-
79-
distdir = build
80-
commands =
81-
{env:TOXBUILD:python -m pytest --cov --cov-config=.coveragerc} {posargs}
82-
83-
[testenv:docs]
84-
description = Build the static HTML docs
85-
basepython = python3.9
86-
deps = sphinx >= 1.7.5, < 2
87-
jinja2 < 3.1.0
88-
commands = make -C docs/ html
89-
"""

0 commit comments

Comments
 (0)