This might work, no guarantees....you would replace the parts to point to your gitlab repo, etc. You'll have to make sure you import both requests and LooseVersion at the beginning of your init file. What I'm not 100% sure on is if the pip declaration will replace the tokens in the url or not, but if not you could just force it to the main zip download url of your master repo.
def get_latest(self, target, check, full_data=False, online=True):
request_url = "https://gitlab.com/api/v4/projects/{user}%2F{repo}/releases".format(check)
resp = requests.get(request_url)
version_data = resp.json()
version = version_data[0]["name"]
current_version = check.get("current")
information = dict(
local=dict(
name=current_version,
value=current_version,
),
remote=dict(
name=version,
value=version
)
)
self._logger.info("current version: %s" % current_version)
self._logger.info("remote version: %s" % version)
needs_update = LooseVersion(current_version) < LooseVersion(version)
self._logger.info("needs update: %s" % needs_update)
return information, not needs_update
def get_update_information(self):
return dict(
canvas=dict(
displayName="Canvas Plugin",
displayVersion=self._plugin_version,
current=self._plugin_version,
python_checker=self,
type="python_checker",
user="mosaic-mfg",
repo="canvas-plugin"
pip="https://gitlab.com/mosaic-mfg/canvas-plugin/-/archive/{target_version}/canvas-plugin-{target_version}.zip"
)
)