Skip to content

Commit

Permalink
Remove openshift python module dependencies, use kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
myakove committed Jul 26, 2023
1 parent 7c19259 commit 61fb78d
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 20 deletions.
64 changes: 63 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ Download = "https://pypi.org/project/openshift-python-wrapper/"
[tool.poetry.group.dev.dependencies]
ipdb = "^0.13.13"


[tool.poetry.group.tests.dependencies]
pytest = "^7.4.0"
requests = "^2.31.0"

[tool.poetry-dynamic-versioning.substitution]
files = ["VERSION"]

Expand Down
2 changes: 1 addition & 1 deletion tests/test_resources.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import kubernetes
import pytest
from openshift.dynamic import DynamicClient
from kubernetes.dynamic import DynamicClient

from ocp_resources.namespace import Namespace
from ocp_resources.pod import Pod
Expand Down
37 changes: 19 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{38,39,310,311}, unittests, validate-resources
envlist = py{38,39,310,311}, unittests, validate-resources, tests
skipsdist = True

[flake8]
Expand All @@ -16,35 +16,36 @@ setenv =
PYTHONPATH = {toxinidir}
passenv =
KUBECONFIG
deps =
pytest
commands =
pip install pip -U
pip install .
pip install jinja2 PyYaml
pytest -o log_cli=true tests/test_resources.py -k 'not kubevirt'
sh -c 'curl -sSL https://install.python-poetry.org | python3 -'
poetry install
poetry run pytest -o log_cli=true tests/test_resources.py -k 'not kubevirt'
allowlist_externals =
sh
poetry

[testenv:unittests]
basepython = python3
setenv =
PYTHONPATH = {toxinidir}
deps =
pytest
commands =
pip install pip -U
pip install .
pytest -o log_cli=true tests/unittests
sh -c 'curl -sSL https://install.python-poetry.org | python3 -'
poetry install
poetry run pytest -o log_cli=true tests/unittests
allowlist_externals =
sh
poetry

[testenv:validate-resources]
basepython = python3
setenv =
PYTHONPATH = {toxinidir}
passenv =
KUBECONFIG
deps =
pytest
requests
commands =
pip install pip -U
pip install .
pytest tests/test_validate_resources.py
sh -c 'curl -sSL https://install.python-poetry.org | python3 -'
poetry install
poetry run pytest tests/test_validate_resources.py
allowlist_externals =
sh
poetry

0 comments on commit 61fb78d

Please sign in to comment.