Skip to content

Commit

Permalink
twister: pytest: remove unnecessary requirements
Browse files Browse the repository at this point in the history
Remove requirements, which are not used in this plugin version.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
  • Loading branch information
gopiotr committed May 9, 2023
1 parent bd873f3 commit 2aec417
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 49 deletions.
4 changes: 0 additions & 4 deletions scripts/pylib/pytest-twister-ext/requirements-tests.txt

This file was deleted.

8 changes: 3 additions & 5 deletions scripts/pylib/pytest-twister-ext/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
marshmallow==3.19.0
psutil==5.9.4
pyserial==3.5
pytest==7.2.0
PyYAML==6.0
psutil
pyserial
pytest>=7.0.0
2 changes: 0 additions & 2 deletions scripts/pylib/pytest-twister-ext/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ packages = find:
package_dir =
=src
install_requires =
marshmallow
psutil
pyserial
pytest>=7.0.0
PyYAML>=5.1

[options.packages.find]
where = src
Expand Down
37 changes: 0 additions & 37 deletions scripts/pylib/pytest-twister-ext/src/twister_ext/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,12 @@
import os.path
import platform
import shlex
from pathlib import Path

import yaml.parser

from twister_ext.exceptions import TwisterExtException

_WINDOWS = platform.system() == 'Windows'

logger = logging.getLogger(__name__)


def string_to_set(value: str | set) -> set[str]:
if isinstance(value, str):
return set(value.split())
else:
return value


def string_to_list(value: str | list) -> list[str]:
if isinstance(value, str):
return list(value.split())
else:
return value


def safe_load_yaml(filename: Path) -> dict:
"""
Return data from yaml file.
:param filename: path to yaml file
:return: data read from yaml file
"""
# __tracebackhide__ = True
with filename.open(encoding='UTF-8') as file:
try:
data = yaml.safe_load(file)
except yaml.parser.ParserError as exc:
logger.error('Parsing error for yaml file %s: %s', filename, exc)
raise TwisterExtException(f'Cannot load data from yaml file: {filename}')
else:
return data


def log_command(logger: logging.Logger, msg: str, args: list, level: int = logging.DEBUG):
"""
Platform-independent helper for logging subprocess invocations.
Expand Down
1 change: 0 additions & 1 deletion scripts/pylib/pytest-twister-ext/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ minversion = 3.20.0
distshare = {homedir}/.tox/distshare

[testenv]
deps = -rrequirements-tests.txt
commands =
pytest tests {env:_TOX_COVERAGE_RUN:} {posargs:}
setenv =
Expand Down

0 comments on commit 2aec417

Please sign in to comment.