-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #900 from vespa-engine/update-pyvespa-version
feat(pypi): update release workflow to use OIDC auth
- Loading branch information
Showing
5 changed files
with
100 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ description = "A Python wrapper for Vespa CLI tools, supporting multiple platfor | |
keywords = [ "vespa", "cli", "wrapper",] | ||
name = "vespacli" | ||
readme = "README.md" | ||
version = "8.391.23" | ||
version = "8.dev" | ||
[[project.authors]] | ||
name = "Thomas Thoresen" | ||
email = "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
from download_binaries import VespaBinaryDownloader | ||
from vespacli._version_generated import vespa_version | ||
import sys | ||
import requests | ||
from packaging import version | ||
|
||
if __name__ == "__main__": | ||
|
||
def get_latest_pypi_version() -> version.Version: | ||
response = requests.get( | ||
"https://pypi.org/simple/vespacli/", | ||
headers={"Accept": "application/vnd.pypi.simple.v1+json"} | ||
) | ||
latest_version = response.json()["releases"][-1]["version"] | ||
return version.parse(latest_version) | ||
|
||
|
||
def get_latest_github_version() -> version.Version: | ||
downloader = VespaBinaryDownloader() | ||
new_version = downloader.get_latest_version() | ||
found_newer = new_version != vespa_version | ||
if found_newer: | ||
print(f"{new_version}") | ||
return version.parse(downloader.get_latest_version()) | ||
|
||
|
||
if __name__ == "__main__": | ||
gh_release = get_latest_github_version() | ||
pypi_release = get_latest_pypi_version() | ||
if gh_release > pypi_release: | ||
print(f"{0}" % gh_release) | ||
else: | ||
print("NA") | ||
sys.exit(0) |
This file was deleted.
Oops, something went wrong.