Skip to content

Commit

Permalink
Merge pull request #351 from tmolteno/fix_regexp
Browse files Browse the repository at this point in the history
Fix regexp for later versions of python
  • Loading branch information
SpheMakh authored Dec 2, 2024
2 parents a02cae6 + 8139a0e commit 44b116d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion scabha/configuratt/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def load_include_files(keyword):
warn = optional = False

# check for (location)filename.yaml or (location)/filename.yaml style
match = re.match("^\\((.+)\\)/?(.+)$", incl)
match = re.match(r"^\((.+)\)/?(.+)$", incl)
if match:
modulename, filename = match.groups()
if modulename.startswith("."):
Expand Down
4 changes: 2 additions & 2 deletions scabha/schema_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ def clickify_parameters(schemas: Union[str, Dict[str, Any]],
elif dtype in ("MS", "File", "Directory"):
dtype = click.Path(exists=(io is schemas.inputs))
else:
list_match = re.fullmatch("List\[(.*)\]", dtype)
tuple_match = re.fullmatch("Tuple\[(.*)\]", dtype)
list_match = re.fullmatch(r"List\[(.*)\]", dtype)
tuple_match = re.fullmatch(r"Tuple\[(.*)\]", dtype)
# List[x] type? Add validation callback to convert elements
if list_match:
elem_type = _atomic_types.get(list_match.group(1).strip(), str)
Expand Down
2 changes: 1 addition & 1 deletion stimela/backends/kube/kube_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}

def resolve_unit(quantity:str, units: Dict = k8s_memory_units_in_bytes):
match = re.fullmatch("^(\d+)(.*)$", quantity)
match = re.fullmatch(r"^(\d+)(.*)$", quantity)
if not match or match.group(2) not in units:
raise ApiException(f"invalid quantity '{quantity}'")
return int(match.group(1))*units[match.group(2)]
Expand Down
4 changes: 2 additions & 2 deletions stimela/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def resolve_recipe_file(filename: str):
return None

# check for (location)filename.yml or (location)/filename.yml style
match1 = re.fullmatch("^\\((.+)\\)/?(.+)$", filename)
match1 = re.fullmatch(r"^\((.+)\)/?(.+)$", filename)
match2 = re.fullmatch(r"^([\w.]+)::(.+)$", filename)
if match1 or match2:
modulename, fname = (match1 or match2).groups()
Expand Down Expand Up @@ -83,7 +83,7 @@ def load_recipe_files(filenames: List[str]):
full_deps = configuratt.ConfigDependencies()
for filename in filenames:
# check for (location)filename.yaml or (location)/filename.yaml style
match1 = re.fullmatch("^\\((.+)\\)/?(.+)$", filename)
match1 = re.fullmatch(r"^\((.+)\)/?(.+)$", filename)
match2 = re.fullmatch(r"^([\w.]+)::(.+)$", filename)
if match1 or match2:
modulename, filename = (match1 or match2).groups()
Expand Down
2 changes: 1 addition & 1 deletion stimela/kitchen/cab.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __post_init__ (self):
self.name = self.command or self.image

# split off first word of name to avoid non-alphanumeric characters
match = re.match("(\w+)", self.name)
match = re.match(r"(\w+)", self.name)
if match:
self.name = match.group(1) or self.flavour.kind
else:
Expand Down
6 changes: 3 additions & 3 deletions stimela/stimela.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ images:
default-python:
registry: quay.io/stimela2
name: python-astro
version: cc0.1.2
version: cc0.1.3
default-casa:
registry: quay.io/stimela2
name: casa
version: cc0.1.2
version: cc0.1.3

opts:
runtime:
casa:
path: casa
opts: [--log2term, --nologger, --nologfile]
wrapper: xvfb-run -a


0 comments on commit 44b116d

Please sign in to comment.