Skip to content

Commit

Permalink
apio install: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Mar 13, 2024
1 parent 4c029aa commit ec10304
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions apio/managers/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""Implementation for the apio INSTALL command"""

import sys
import re
import shutil

from os.path import isdir
Expand Down Expand Up @@ -442,35 +441,6 @@ def _get_valid_version(self, url_version: str) -> str:
click.secho("Check the resources/packages.json file", fg="red")
sys.exit(1)

# -- This function can be removed
@staticmethod
def _find_required_version(releases, tag_name, req_v):
for release in releases:
if "tag_name" in release:
tag = tag_name.replace("%V", req_v)
if tag == release.get("tag_name"):
return req_v
return None

@staticmethod
def _find_latest_version(releases, tag_name, spec_v):
print("->Find latest version")

for release in releases:
if "tag_name" in release:
pattern = tag_name.replace("%V", "(?P<v>.*?)") + "$"
print(f"Pattern: {pattern}")
print(f"Release tag_name: {release.get('tag_name')}")
match = re.search(pattern, release.get("tag_name"))
if match:
prerelease = release.get("prerelease", False)
if not prerelease:
version = match.group("v")
print(f"Match: Version: {version}")
if util.check_package_version(version, spec_v):
return version
return None

def _download(self, url: str) -> str:
"""Download the given file (url). Return the path of
the destination file
Expand Down

0 comments on commit ec10304

Please sign in to comment.