Skip to content

Commit

Permalink
Merge pull request #37 from gisaia/feat/latest_version_warning_dev
Browse files Browse the repository at this point in the history
Update latest version checking to avoid warning in dev mode
  • Loading branch information
WilliGautier authored Nov 6, 2024
2 parents 81fd2d9 + 8df0443 commit 6a0bb93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions arlas/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,16 @@ def main():
try:
json = requests.get('https://pypi.org/pypi/arlas.cli/json').json()
if json:
version = json.get("info", {}).get("version", None)
if version:
if not version == arlas_cli_version:
latest_version = json.get("info", {}).get("version", None)
if latest_version:
if arlas_cli_version == "_".join(["arlas", "cli", "versions"]):
# Local dev 'python3.10 -m arlas.cli.cli' usage
...
elif arlas_cli_version != latest_version:
print("WARNING: You are not using the latest version of arlas_cli! Please update with:", file=sys.stderr)
print("pip3.10 install arlas_cli==" + version, file=sys.stderr)
print("pip3.10 install arlas_cli==" + latest_version, file=sys.stderr)
else:
print("WARNING: Can not identify arlas.cli version.", file=sys.stderr)
print("WARNING: Can not identify arlas.cli latest version.", file=sys.stderr)
except Exception:
print("WARNING: Can not contact pypi.org to identify if this arlas_cli is the latest version.", file=sys.stderr)
app.add_typer(collections, name="collections")
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ else
exit 1
fi

echo "Build and releas the image with version ${VERSION}"
echo "Build and release the image with version ${VERSION}"

# PYTHON PIP
./scripts/publish.sh $VERSION
Expand Down

0 comments on commit 6a0bb93

Please sign in to comment.