diff --git a/kernelci/api/helper.py b/kernelci/api/helper.py index c7ddb733c5..33f9255aac 100644 --- a/kernelci/api/helper.py +++ b/kernelci/api/helper.py @@ -465,7 +465,7 @@ def _is_job_filtered(self, node): return False # pylint: disable=too-many-arguments - def create_job_node(self, job_config, input_node, + def create_job_node(self, job_config, input_node, *, runtime=None, platform=None, retry_counter=0): """Create a new job node based on input and configuration""" jobfilter = input_node.get('jobfilter') diff --git a/kernelci/cli/event.py b/kernelci/cli/event.py index daef5b6ab2..5cb915b7d4 100644 --- a/kernelci/cli/event.py +++ b/kernelci/cli/event.py @@ -57,7 +57,7 @@ def unsubscribe(config, api, sub_id, secrets): @Args.api @catch_error # pylint: disable=too-many-arguments -def send(input_file, channel, is_json, config, api, secrets): +def send(input_file, channel, *, is_json, config, api, secrets): """Read some data and send it as an event on a channel""" api = get_api(config, api, secrets) data = json.load(input_file) if is_json else input_file.read() @@ -90,7 +90,7 @@ def receive(sub_id, config, api, indent, secrets): @Args.api @catch_error # pylint: disable=too-many-arguments -def push(input_file, list_name, is_json, config, api, secrets): +def push(input_file, list_name, *, is_json, config, api, secrets): """Read some data and push it as an event on a list""" api = get_api(config, api, secrets) data = json.load(input_file) if is_json else input_file.read() diff --git a/kernelci/cli/job.py b/kernelci/cli/job.py index 3539143b6c..6809601073 100644 --- a/kernelci/cli/job.py +++ b/kernelci/cli/job.py @@ -37,7 +37,7 @@ def kci_job(): @Args.api @Args.indent @catch_error -def new(name, input_node_id, platform, # pylint: disable=too-many-arguments +def new(name, input_node_id, *, platform, # pylint: disable=too-many-arguments runtime, config, api, indent, secrets): """Create a new job node""" configs = kernelci.config.load(config) @@ -78,7 +78,7 @@ def new(name, input_node_id, platform, # pylint: disable=too-many-arguments @Args.config @Args.api @catch_error -def generate(node_id, # pylint: disable=too-many-arguments, too-many-locals +def generate(node_id, *, # pylint: disable=too-many-arguments, too-many-locals runtime, storage, platform, output, config, api, secrets): """Generate a job definition in a file""" configs = kernelci.config.load(config) @@ -152,7 +152,7 @@ def _get_runtime(runtime, config, secrets): @Args.runtime @Args.config @catch_error -def submit(runtime, job_path, wait, # pylint: disable=too-many-arguments +def submit(job_path, *, runtime, wait, # pylint: disable=too-many-arguments config, secrets, api): # pylint: disable=unused-argument """Submit a job definition to its designated runtime""" configs = kernelci.config.load(config) diff --git a/kernelci/cli/node.py b/kernelci/cli/node.py index 2754e548d1..7c6121792e 100644 --- a/kernelci/cli/node.py +++ b/kernelci/cli/node.py @@ -50,7 +50,7 @@ def get(node_id, config, api, indent): @Args.page_number @catch_error # pylint: disable=too-many-arguments -def find(attributes, config, api, indent, page_length, page_number): +def find(attributes, *, config, api, indent, page_length, page_number): """Find nodes with arbitrary attributes""" api = get_api(config, api) offset, limit = get_pagination(page_length, page_number) diff --git a/kernelci/cli/user.py b/kernelci/cli/user.py index f2b1cef517..63037f1eca 100644 --- a/kernelci/cli/user.py +++ b/kernelci/cli/user.py @@ -49,7 +49,7 @@ def whoami(config, api, indent, secrets): @Args.page_number @catch_error # pylint: disable=too-many-arguments -def find(attributes, config, api, indent, secrets, page_length, page_number): +def find(attributes, *, config, api, indent, secrets, page_length, page_number): """Find user profiles with arbitrary attributes""" api = get_api(config, api, secrets) offset, limit = get_pagination(page_length, page_number) diff --git a/kernelci/config/job.py b/kernelci/config/job.py index 6f5608db4d..c4a293e4a9 100644 --- a/kernelci/config/job.py +++ b/kernelci/config/job.py @@ -14,7 +14,7 @@ class Job(YAMLConfigObject): # pylint: disable=too-many-instance-attributes yaml_tag = '!Job' # pylint: disable=too-many-arguments - def __init__(self, name, template, kind="node", image=None, params=None, rules=None, + def __init__(self, name, template, *, kind="node", image=None, params=None, rules=None, kcidb_test_suite=None, priority=None): self._name = name self._template = template diff --git a/kernelci/config/platform.py b/kernelci/config/platform.py index 7c5b9c6bb6..289bf48670 100644 --- a/kernelci/config/platform.py +++ b/kernelci/config/platform.py @@ -15,7 +15,7 @@ class Platform(YAMLConfigObject): yaml_tag = '!Platform' # pylint: disable=too-many-arguments - def __init__(self, name, arch="x86_64", base_name=None, + def __init__(self, name, *, arch="x86_64", base_name=None, boot_method="grub", context=None, compatible=None, dtb=None, mach="x86", params=None, rules=None): self._name = name diff --git a/kernelci/config/runtime.py b/kernelci/config/runtime.py index 0c2650cf0e..247d52b633 100644 --- a/kernelci/config/runtime.py +++ b/kernelci/config/runtime.py @@ -87,6 +87,7 @@ class RuntimeLAVA(Runtime): # pylint: disable=too-many-arguments def __init__( self, + *, url=None, priority=None, priority_min=None, diff --git a/kernelci/config/scheduler.py b/kernelci/config/scheduler.py index e452e0751f..ea578b8f05 100644 --- a/kernelci/config/scheduler.py +++ b/kernelci/config/scheduler.py @@ -14,7 +14,7 @@ class SchedulerEntry(YAMLConfigObject): yaml_tag = '!SchedulerEntry' # pylint: disable=too-many-arguments - def __init__(self, job, runtime, event, platforms=None, rules=None): + def __init__(self, job, runtime, event, *, platforms=None, rules=None): self._job = job self._runtime = runtime self._event = event diff --git a/kernelci/runtime/__init__.py b/kernelci/runtime/__init__.py index d93bdad756..6c98c22e18 100644 --- a/kernelci/runtime/__init__.py +++ b/kernelci/runtime/__init__.py @@ -76,7 +76,8 @@ class Runtime(abc.ABC): TEMPLATES = ['config/runtime', '/etc/kernelci/runtime'] # pylint: disable=unused-argument,too-many-arguments - def __init__(self, config, user=None, token=None, custom_template_dir=None, kcictx=None): + def __init__(self, config, *, user=None, token=None, + custom_template_dir=None, kcictx=None): """A Runtime object can be used to run jobs in a runtime environment *config* is a kernelci.config.runtime.Runtime object diff --git a/kernelci/runtime/lava.py b/kernelci/runtime/lava.py index 547786eb77..0b3df3a8c4 100644 --- a/kernelci/runtime/lava.py +++ b/kernelci/runtime/lava.py @@ -345,9 +345,7 @@ def _get_priority(self, job): node = job.node submitter = node.get('submitter') if submitter and submitter != 'service:pipeline': - priority = priority + 1 - if priority > self.config.priority_max: - priority = self.config.priority_max + priority = min(priority + 1, self.config.priority_max) return priority def get_params(self, job, api_config=None): diff --git a/kernelci/scheduler.py b/kernelci/scheduler.py index bbdcd9402c..3fceb53735 100644 --- a/kernelci/scheduler.py +++ b/kernelci/scheduler.py @@ -49,6 +49,7 @@ def get_schedule(self, event, channel='node'): for config in self.get_configs(event, channel): runtime_name = config.runtime.get('name') runtime_type = config.runtime.get('type') + runtime = None if runtime_name: runtime = self._runtimes.get(runtime_name) elif runtime_type: diff --git a/pyproject.toml b/pyproject.toml index 59220bb958..e08aa5e8dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,21 +15,21 @@ readme = "README.md" requires-python = ">=3.9" license = {text = "LGPL-2.1-or-later"} dependencies = [ - "azure-storage-blob==12.23.1", - "azure-storage-file-share==12.13.0", + "azure-storage-blob==12.27.1", + "azure-storage-file-share==12.23.1", "bson==0.5.10", - "click==8.1.3", - "cloudevents==1.9.0", + "click==8.3.1", + "cloudevents==1.12.0", "docker==7.1.0", "jinja2==3.1.6", - "kubernetes==26.1.0", - "paramiko==3.4.0", - "pydantic==2.9.2", - "pyelftools==0.29", - "pytest==7.4.0", - "pyyaml==6.0.2", - "requests==2.32.4", - "scp==0.14.5", + "kubernetes==34.1.0", + "paramiko==4.0.0", + "pydantic==2.12.5", + "pyelftools==0.32", + "pytest==9.0.2", + "pyyaml==6.0.3", + "requests==2.32.5", + "scp==0.15.0", "toml==0.10.2", ] authors = [ @@ -58,13 +58,13 @@ classifiers = [ [project.optional-dependencies] dev = [ - "mypy==1.4.1", - "pycodestyle==2.10.0", - "pylint==2.17.2", - "pytest-mock==3.11.1", - "types-PyYAML==6.0.12.10", - "types-requests==2.31.0.1", - "types-urllib3==1.26.25.13", + "mypy==1.19.1", + "pycodestyle==2.14.0", + "pylint==4.0.4", + "pytest-mock==3.15.1", + "types-PyYAML==6.0.12.20250915", + "types-requests==2.32.4.20250913", + "types-urllib3==1.26.25.14", ] [project.urls] diff --git a/requirements-dev.txt b/requirements-dev.txt index 17596fcdde..9ddd6b7fae 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,8 @@ -r requirements.txt -mypy==1.4.1 -pycodestyle==2.10.0 -pylint==2.17.2 -pytest-mock==3.11.1 -types-PyYAML==6.0.12.10 -types-requests==2.31.0.1 -types-urllib3==1.26.25.13 +mypy==1.19.1 +pycodestyle==2.14.0 +pylint==4.0.4 +pytest-mock==3.15.1 +types-PyYAML==6.0.12.20250915 +types-requests==2.32.4.20250913 +types-urllib3==1.26.25.14 diff --git a/requirements.txt b/requirements.txt index ec6424a3d3..4ef150d573 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,16 +1,16 @@ -azure-storage-blob==12.23.1 -azure-storage-file-share==12.13.0 +azure-storage-blob==12.27.1 +azure-storage-file-share==12.23.1 bson==0.5.10 -click==8.1.3 -cloudevents==1.9.0 +click==8.3.1 +cloudevents==1.12.0 docker==7.1.0 jinja2==3.1.6 kubernetes==34.1.0 -paramiko==3.4.0 -pydantic==2.9.2 -pyelftools==0.29 -pytest==7.4.0 -pyyaml==6.0.2 -requests==2.32.4 -scp==0.14.5 +paramiko==4.0.0 +pydantic==2.12.5 +pyelftools==0.32 +pytest==9.0.2 +pyyaml==6.0.3 +requests==2.32.5 +scp==0.15.0 toml==0.10.2