Skip to content

Commit

Permalink
Fix find_pulpcore_version script for new pyproject.toml changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gerrod3 committed Nov 21, 2024
1 parent 03ce792 commit 5ec03cb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .ci/scripts/find_pulpcore_version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import argparse
import requests
from packaging.version import parse
import configparser
import tomllib


if __name__ == "__main__":
Expand All @@ -15,12 +15,11 @@
version = ""
if opts.branch == "main":
# Used for nightly image, find the pulpcore version from @main
r = requests.get("https://raw.githubusercontent.com/pulp/pulpcore/main/.bumpversion.cfg")
r = requests.get("https://raw.githubusercontent.com/pulp/pulpcore/refs/heads/main/pyproject.toml")
if r.status_code == 200:
config = configparser.ConfigParser()
config.read_string(r.text)
if "bumpversion" in config:
version = config["bumpversion"]["current_version"]
config = tomllib.loads(r.text)
if "project" in config:
version = config["project"]["version"]
else:
print("Failed to find current version on main")
exit(1)
Expand Down

0 comments on commit 5ec03cb

Please sign in to comment.