Skip to content

Commit

Permalink
bugfix/workaround: fix version parsing in case of snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
craftamap committed Oct 17, 2021
1 parent 48918ed commit 7138dcc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pluploader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,13 @@ def install_server(
except (FileNotFoundError, zipfile.BadZipFile, KeyError, pathutil.PluginKeyNotFoundError):
logging.error("Could not get the plugin key of the supplied jar - are you sure you want to upload a plugin, mate?")
else:
version_to_install = version_parse(plugin_info.version)
# WORKAROUND: replace -SNAPSHOT with .dev, to follow python versioning scheme
# TODO: find a new library that can parse -SNAPSHOT correctly
version_to_install = version_parse(plugin_info.version.replace("-SNAPSHOT", ".dev"))
try:
version_installed = version_parse(upm.get_plugin(plugin_info.key).version)
# WORKAROUND: replace -SNAPSHOT with .dev, to follow python versioning scheme
# TODO: find a new library that can parse -SNAPSHOT correctly
version_installed = version_parse(upm.get_plugin(plugin_info.key).version.replace("-SNAPSHOT", ".dev"))
if version_installed > version_to_install:
logging.warning(
f"Looks like you are trying to install a .jar with a lower version ({version_to_install}) than already "
Expand Down

0 comments on commit 7138dcc

Please sign in to comment.