Skip to content

Commit

Permalink
silence deprecation warnings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MarDiehl authored and vsoch committed Oct 2, 2021
1 parent 4f583e6 commit 5b61a5b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The client here will eventually be released as "spython" (and eventually to
singularity on pypi), and the versions here will coincide with these releases.

## [master](https://github.com/singularityhub/singularity-cli/tree/master)
- updating CI/tests and fixing deprecations (warnings) (0.1.17)
- fixing bug with defining comments earlier (0.1.16)
- ensure options and args from instance init are honored (0.1.15)
- choose output for stream_command (0.1.14)
Expand Down
4 changes: 2 additions & 2 deletions spython/main/parse/parsers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,6 @@ def _replace_from_dict(self, string, args):
string: the string with replacements made
"""
for key, value in args.items():
if re.search("\$(" + key + "|\{[^}]*\})", string):
string = re.sub("\$(" + key + "|\{[^}]*\})", value, string)
if re.search(r"\$(" + key + r"|\{[^}]*\})", string):
string = re.sub(r"\$(" + key + r"|\{[^}]*\})", value, string)
return string
2 changes: 1 addition & 1 deletion spython/utils/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_singularity_version_info():
version_string = version_string[len(prefix) :]
elif "/" in version_string: # Handle old stuff like "x.y.z-pull/123-0a5d"
version_string = version_string.replace("/", "+", 1)
return semver.parse_version_info(version_string)
return semver.VersionInfo.parse(version_string)


def get_installdir():
Expand Down
4 changes: 2 additions & 2 deletions spython/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


__version__ = "0.1.16"
__version__ = "0.1.17"
AUTHOR = "Vanessa Sochat"
AUTHOR_EMAIL = "vsochat@stanford.edu"
NAME = "spython"
Expand All @@ -14,6 +14,6 @@
DESCRIPTION = "Command line python tool for working with singularity."
LICENSE = "LICENSE"

INSTALL_REQUIRES = (("semver", {"min_version": "2.8.0"}),)
INSTALL_REQUIRES = (("semver", {"min_version": "2.8.1"}),)

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

0 comments on commit 5b61a5b

Please sign in to comment.