Skip to content

Commit 5b61a5b

Browse files
MarDiehlvsoch
authored andcommitted
silence deprecation warnings
spotted with re (python 3.9.7) and semver 2.13.0. VersionInfo.parse is available since semver 2.8.1, see https://github.com/python-semver/python-semver/releases/tag/2.8.1
1 parent 4f583e6 commit 5b61a5b

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
1717
singularity on pypi), and the versions here will coincide with these releases.
1818

1919
## [master](https://github.com/singularityhub/singularity-cli/tree/master)
20+
- updating CI/tests and fixing deprecations (warnings) (0.1.17)
2021
- fixing bug with defining comments earlier (0.1.16)
2122
- ensure options and args from instance init are honored (0.1.15)
2223
- choose output for stream_command (0.1.14)

spython/main/parse/parsers/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,6 @@ def _replace_from_dict(self, string, args):
155155
string: the string with replacements made
156156
"""
157157
for key, value in args.items():
158-
if re.search("\$(" + key + "|\{[^}]*\})", string):
159-
string = re.sub("\$(" + key + "|\{[^}]*\})", value, string)
158+
if re.search(r"\$(" + key + r"|\{[^}]*\})", string):
159+
string = re.sub(r"\$(" + key + r"|\{[^}]*\})", value, string)
160160
return string

spython/utils/terminal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def get_singularity_version_info():
102102
version_string = version_string[len(prefix) :]
103103
elif "/" in version_string: # Handle old stuff like "x.y.z-pull/123-0a5d"
104104
version_string = version_string.replace("/", "+", 1)
105-
return semver.parse_version_info(version_string)
105+
return semver.VersionInfo.parse(version_string)
106106

107107

108108
def get_installdir():

spython/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

77

8-
__version__ = "0.1.16"
8+
__version__ = "0.1.17"
99
AUTHOR = "Vanessa Sochat"
1010
AUTHOR_EMAIL = "[email protected]"
1111
NAME = "spython"
@@ -14,6 +14,6 @@
1414
DESCRIPTION = "Command line python tool for working with singularity."
1515
LICENSE = "LICENSE"
1616

17-
INSTALL_REQUIRES = (("semver", {"min_version": "2.8.0"}),)
17+
INSTALL_REQUIRES = (("semver", {"min_version": "2.8.1"}),)
1818

1919
TESTS_REQUIRES = (("pytest", {"min_version": "4.6.2"}),)

0 commit comments

Comments
 (0)