Skip to content

Commit 18ac8fa

Browse files
authored
chore: address deprecation warnings (#282)
1 parent dda73ce commit 18ac8fa

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

packages/gcp-sphinx-docfx-yaml/docfx_yaml/extension.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ class Bcolors:
8787
REFFUNCTION = 'func'
8888
INITPY = '__init__.py'
8989
# Regex expression for checking references of pattern like ":class:`~package_v1.module`"
90-
REF_PATTERN = ':(py:)?(func|class|meth|mod|ref|attr|exc):`~?[a-zA-Z0-9_.<> ]*(\(\))?`'
90+
REF_PATTERN = r':(py:)?(func|class|meth|mod|ref|attr|exc):`~?[a-zA-Z0-9_.<> ]*(\(\))?`'
9191
# Regex expression for checking references of pattern like "~package_v1.subpackage.module"
92-
REF_PATTERN_LAST = '~([a-zA-Z0-9_<>]*\.)*[a-zA-Z0-9_<>]*(\(\))?'
92+
REF_PATTERN_LAST = r'~([a-zA-Z0-9_<>]*\.)*[a-zA-Z0-9_<>]*(\(\))?'
9393
# Regex expression for checking references of pattern like
9494
# "[module][google.cloud.cloudkms_v1.module]"
95-
REF_PATTERN_BRACKETS = '\[[a-zA-Z0-9_<>\-. ]+\]\[[a-zA-Z0-9_<>\-. ]+\]'
95+
REF_PATTERN_BRACKETS = r'\[[a-zA-Z0-9_<>\-. ]+\]\[[a-zA-Z0-9_<>\-. ]+\]'
9696

9797
REF_PATTERNS = [
9898
REF_PATTERN,

packages/gcp-sphinx-docfx-yaml/docfx_yaml/markdown_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def _highlight_md_codeblocks(mdfile_path: str) -> None:
220220

221221
def _clean_image_links(mdfile_path: str) -> None:
222222
"""Cleans extra whitespace that breaks image links in index.html file."""
223-
image_link_pattern='\[\s*!\[image\]\(.*\)\s*\]\(.*\)'
223+
image_link_pattern=r'\[\s*!\[image\]\(.*\)\s*\]\(.*\)'
224224
new_lines = []
225225
with open(mdfile_path) as mdfile:
226226
file_content = mdfile.read()

packages/gcp-sphinx-docfx-yaml/docfx_yaml/monkeypatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from .utils import transform_node as _transform_node
2626
from .nodes import remarks
2727

28-
TYPE_SEP_PATTERN = '(\[|\]|, |\(|\))'
28+
TYPE_SEP_PATTERN = r'(\[|\]|, |\(|\))'
2929

3030
def _get_desc_data(node):
3131
assert node.tagname == 'desc'

packages/gcp-sphinx-docfx-yaml/docfx_yaml/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def slugify(value):
3030
3131
# From Django
3232
"""
33-
value = re.sub('[^\w\s-]', '', value).strip()
34-
return re.sub('[-\s]+', '-', value)
33+
value = re.sub(r'[^\w\s-]', '', value).strip()
34+
return re.sub(r'[-\s]+', '-', value)
3535

3636

3737
def transform_string(app, string):

0 commit comments

Comments
 (0)