update appveyor and travis configs

This commit is contained in:
Ryan Holmes
2019-02-02 19:06:36 -05:00
parent 01f8c65304
commit 07b8f5b914
15 changed files with 287 additions and 196 deletions

23
scripts/dump_version.py Normal file
View File

@@ -0,0 +1,23 @@
"""
This script is solely used when generating builds. It generates a version number automatically using
git tags as it's basis. Whenever a build is created, run this file beforehand and it should replace
the old version number with the new one in VERSION.YML
"""
import yaml
import subprocess
import os
with open("version.yml", 'r+') as file:
data = yaml.load(file)
file.seek(0)
file.truncate()
# todo: run Version() on the tag to ensure that it's of proper formatting - fail a test if not and prevent building
# python's versioning spec doesn't handle the same format git describe outputs, so convert it.
label = os.environ["PYFA_VERSION"].split('-') if "PYFA_VERSION" in os.environ else subprocess.check_output(["git", "describe", "--tags"]).strip().decode().split('-')
label = '-'.join(label[:-2])+'+'+'-'.join(label[-2:]) if len(label) > 1 else label[0]
print(label)
data['version'] = label
yaml.dump(data, file, default_flow_style=False)