Skip to content

Commit

Permalink
Support Python 3.19 (#1)
Browse files Browse the repository at this point in the history
* Add Python 3.19 to the CI workflow
* fix type hints for Python 3.19
  • Loading branch information
superstar54 authored Nov 28, 2024
1 parent a1e4cf3 commit 74cd45b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
python-version: ['3.12']
python-version: ['3.9', '3.12']
aiida-version: ['stable']

services:
Expand Down
2 changes: 1 addition & 1 deletion src/aiida_pythonjob/data/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_serializer_from_entry_points() -> dict:
eps = get_serializer_from_entry_points()


def serialize_to_aiida_nodes(inputs: dict | None = None) -> dict:
def serialize_to_aiida_nodes(inputs: dict) -> dict:
"""Serialize the inputs to a dictionary of AiiDA data nodes.
Args:
Expand Down
25 changes: 13 additions & 12 deletions src/aiida_pythonjob/launch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import inspect
import os
from typing import Any, Callable
from typing import Any, Callable, Dict, Optional, Union

from aiida.orm import AbstractCode, Computer, FolderData, List, SinglefileData, Str

Expand All @@ -10,18 +10,19 @@


def prepare_pythonjob_inputs(
function: Callable[..., Any] | None = None,
function_inputs: dict[str, Any] | None = None,
function_outputs: dict[str, Any] | None = None,
code: AbstractCode | None = None,
command_info: dict[str, str] | None = None,
computer: str | Computer = "localhost",
metadata: dict[str, Any] | None = None,
upload_files: dict[str, str] = {},
process_label: str | None = None,
pickled_function: PickledFunction | None = None,
function: Optional[Callable[..., Any]] = None,
function_inputs: Optional[Dict[str, Any]] = None,
function_outputs: Optional[Dict[str, Any]] = None,
code: Optional[AbstractCode] = None,
command_info: Optional[Dict[str, str]] = None,
computer: Union[str, Computer] = "localhost",
metadata: Optional[Dict[str, Any]] = None,
upload_files: Dict[str, str] = {},
process_label: Optional[str] = None,
pickled_function: Optional[PickledFunction] = None,
**kwargs: Any,
) -> dict[str, Any]:
) -> Dict[str, Any]:
pass
"""Prepare the inputs for PythonJob"""

if function is None and pickled_function is None:
Expand Down
6 changes: 3 additions & 3 deletions src/aiida_pythonjob/utils.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from typing import Optional
from typing import Optional, Union

from aiida.common.exceptions import NotExistent
from aiida.orm import Computer, InstalledCode, load_code, load_computer


def get_or_create_code(
label: str = "python3",
computer: Optional[str | Computer] = "localhost",
computer: Optional[Union[str, "Computer"]] = "localhost",
filepath_executable: Optional[str] = None,
prepend_text: str = "",
):
) -> InstalledCode:
"""Try to load code, create if not exit."""

try:
Expand Down

0 comments on commit 74cd45b

Please sign in to comment.