Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

robotframework-pythonlibcore

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robotframework-pythonlibcore - pypi Package Compare versions

Comparing version
4.1.2
to
4.2.0
+2
-2
PKG-INFO
Metadata-Version: 2.1
Name: robotframework-pythonlibcore
Version: 4.1.2
Version: 4.2.0
Summary: Tools to ease creating larger test libraries for Robot Framework using Python.

@@ -15,6 +15,6 @@ Home-page: https://github.com/robotframework/PythonLibCore

Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only

@@ -21,0 +21,0 @@ Classifier: Programming Language :: Python :: Implementation :: CPython

@@ -14,6 +14,6 @@ #!/usr/bin/env python

Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3 :: Only

@@ -20,0 +20,0 @@ Programming Language :: Python :: Implementation :: CPython

Metadata-Version: 2.1
Name: robotframework-pythonlibcore
Version: 4.1.2
Version: 4.2.0
Summary: Tools to ease creating larger test libraries for Robot Framework using Python.

@@ -15,6 +15,6 @@ Home-page: https://github.com/robotframework/PythonLibCore

Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only

@@ -21,0 +21,0 @@ Classifier: Programming Language :: Python :: Implementation :: CPython

@@ -24,3 +24,3 @@ # Copyright 2017- Robot Framework Foundation

from dataclasses import dataclass
from typing import Any, Callable, List, Optional, get_type_hints
from typing import Any, Callable, List, Optional, Union, get_type_hints

@@ -31,3 +31,3 @@ from robot.api.deco import keyword # noqa F401

__version__ = "4.1.2"
__version__ = "4.2.0"

@@ -43,2 +43,6 @@

class NoKeywordFound(PythonLibCoreException):
pass
class HybridCore:

@@ -54,3 +58,3 @@ def __init__(self, library_components):

def add_library_components(self, library_components):
self.keywords_spec["__init__"] = KeywordBuilder.build(self.__init__)
self.keywords_spec["__init__"] = KeywordBuilder.build(self.__init__) # type: ignore
for component in library_components:

@@ -130,2 +134,4 @@ for name, func in self.__get_members(component):

spec = self.keywords_spec.get(name)
if not spec:
raise NoKeywordFound(f"Could not find keyword: {name}")
return spec.argument_specification

@@ -140,2 +146,4 @@

spec = self.keywords_spec.get(name)
if not spec:
raise NoKeywordFound(f"Could not find keyword: {name}")
return spec.documentation

@@ -151,3 +159,3 @@

if keyword_name == "__init__":
return self.__init__
return self.__init__ # type: ignore
if keyword_name.startswith("__") and keyword_name.endswith("__"):

@@ -213,7 +221,7 @@ return None

@classmethod
def _get_arg_spec(cls, function: Callable):
def _get_arg_spec(cls, function: Callable) -> inspect.FullArgSpec:
return inspect.getfullargspec(function)
@classmethod
def _get_args(cls, arg_spec: inspect.FullArgSpec, function: Callable):
def _get_args(cls, arg_spec: inspect.FullArgSpec, function: Callable) -> list:
args = cls._drop_self_from_args(function, arg_spec)

@@ -232,3 +240,3 @@ args.reverse()

@classmethod
def _drop_self_from_args(cls, function: Callable, arg_spec: inspect.FullArgSpec):
def _drop_self_from_args(cls, function: Callable, arg_spec: inspect.FullArgSpec) -> list:
return arg_spec.args[1:] if inspect.ismethod(function) else arg_spec.args

@@ -246,7 +254,7 @@

def _get_named_only_args(cls, arg_spec: inspect.FullArgSpec) -> list:
rf_spec = []
rf_spec: list = []
kw_only_args = arg_spec.kwonlyargs if arg_spec.kwonlyargs else []
if not arg_spec.varargs and kw_only_args:
rf_spec.append("*")
kw_only_defaults = arg_spec.kwonlydefaults if arg_spec.kwonlydefaults else []
kw_only_defaults = arg_spec.kwonlydefaults if arg_spec.kwonlydefaults else {}
for kw_only_arg in kw_only_args:

@@ -284,5 +292,4 @@ if kw_only_arg in kw_only_defaults:

@classmethod
def _args_as_list(cls, function, arg_spec):
function_args = []
function_args.extend(cls._drop_self_from_args(function, arg_spec))
def _args_as_list(cls, function, arg_spec) -> list:
function_args = cls._drop_self_from_args(function, arg_spec)
if arg_spec.varargs:

@@ -311,7 +318,7 @@ function_args.append(arg_spec.varargs)

class PluginParser:
def __init__(self, base_class: Optional[Any] = None, python_object: List[Any] = []):
def __init__(self, base_class: Optional[Any] = None, python_object=None):
self._base_class = base_class
self._python_object = python_object
self._python_object = python_object if python_object else []
def parse_plugins(self, plugins: str) -> List:
def parse_plugins(self, plugins: Union[str, List[str]]) -> List:
imported_plugins = []

@@ -335,7 +342,7 @@ importer = Importer("test library")

def _string_to_modules(self, modules):
parsed_modules = []
def _string_to_modules(self, modules: Union[str, List[str]]):
parsed_modules: list = []
if not modules:
return parsed_modules
for module in modules.split(","):
for module in self._modules_splitter(modules):
module = module.strip()

@@ -355,1 +362,9 @@ module_and_args = module.split(";")

return parsed_modules
def _modules_splitter(self, modules: Union[str, List[str]]):
if isinstance(modules, str):
for module in modules.split(","):
yield module
else:
for module in modules:
yield module