File: check_version.py

package info (click to toggle)
horizon-eda 2.6.0-2.2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,356 kB
  • sloc: cpp: 270,147; ansic: 3,817; python: 2,098; xml: 402; sql: 219; sh: 190; ruby: 61; makefile: 19
file content (29 lines) | stat: -rw-r--r-- 789 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import version as v
import xml.etree.ElementTree as ET
tree = ET.parse('org.horizon_eda.HorizonEDA.metainfo.xml')
root = tree.getroot()
release = root.find("releases").find("release")
version_from_xml = release.attrib["version"]

rc = 0
if version_from_xml == v.string :
	print("Version okay")
else:
	print("Version mismatch %s != %s"%(v.string, version_from_xml))
	rc = 1

if release.find("url").text != f"https://github.com/horizon-eda/horizon/releases/tag/v{v.string}":
	print("URL mismatch")
	rc = 1

#Check changelog versions

for filename in ("CHANGELOG.md", "scripts/CHANGELOG.md.in") :
	first_line = next(open(filename, "r")).strip()
	if first_line != f"# Version {v.string}" :
		print(f"{filename} version mismatch")
		rc = 1
	else :
		print(f"{filename} version okay")

exit(rc)