This commit is contained in:
Gnarwhal 2024-09-14 18:14:28 +00:00
parent f0f49cce18
commit 0f3b523d68
Signed by: Gnarwhal
GPG key ID: 80DB5B37E4C96776
6 changed files with 15 additions and 3 deletions

View file

@ -29,3 +29,8 @@ sshare-validate = "sshare.validator:main"
[tool.setuptools_scm] [tool.setuptools_scm]
version_file = "src/sshare/version.py" version_file = "src/sshare/version.py"
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib"
]

View file

@ -14,6 +14,9 @@
import importlib import importlib
import importlib.util import importlib.util
import sys
from pathlib import Path
from sshare.plugin.config import Flag from sshare.plugin.config import Flag
from sshare.plugin.config import NoDefault from sshare.plugin.config import NoDefault
@ -49,9 +52,9 @@ class PluginLoader:
] ]
@staticmethod @staticmethod
def at(logger=None, config=dict(), flags=dict(), *args): def at(*args, logger=None, config=dict(), flags=dict()):
return [ return [
Plugin.external(plugin, logger, config, flags) Plugin.external(Path(plugin), logger, config, flags)
for plugin for plugin
in args in args
] ]

View file

@ -113,7 +113,7 @@ def main():
arg_parser.add_argument( arg_parser.add_argument(
"plugins", "plugins",
nargs="*", nargs="*",
help="plugin(s) to be validated", help="plugin(s) to be validated (Default: all external plugins)",
) )
arguments = arg_parser.parse_args() arguments = arg_parser.parse_args()
if arguments.dev: if arguments.dev:

4
tests/test_test.py Normal file
View file

@ -0,0 +1,4 @@
from src.sshare.plugin.config import Argument
def test_foo():
assert True