# generates a version data file that will be read by pyinstaller
import pyinstaller_versionfile
import sys
import os
import re

# TODO move this to the do-it scripts

# this file contains the actual version, generated by setuptools_scm
mymodule_dir = os.path.join(os.path.dirname( __file__ ), '..')
sys.path.append(mymodule_dir)
from tabcmd.execution._version import version

print(version)
numeric_version = re.sub(r'[a-z+]', '', version.lower())
print(numeric_version)

output_file = os.path.join(mymodule_dir, "versionfile.txt")
print(output_file)
input_file = os.path.join(mymodule_dir, 'res', "metadata.yml")
pyinstaller_versionfile.create_versionfile_from_input_file(
    output_file, input_file,
    # optional, can be set to overwrite version information (equivalent to --version when using the CLI)
    version=numeric_version
)

# generates a version data file that will be read by pyinstaller
import pyinstaller_versionfile
import sys
import os
import re

# TODO move this to the do-it scripts

# this file contains the actual version, generated by setuptools_scm
mymodule_dir = os.path.join(os.path.dirname( __file__ ), '..')
sys.path.append(mymodule_dir)
from tabcmd.execution._version import version

print(version)
numeric_version = re.sub(r'[a-z+]', '', version.lower())
print(numeric_version)

output_file = os.path.join(mymodule_dir, "versionfile.txt")
print(output_file)
input_file = os.path.join(mymodule_dir, 'res', "metadata.yml")
pyinstaller_versionfile.create_versionfile_from_input_file(
    output_file, input_file,
    # optional, can be set to overwrite version information (equivalent to --version when using the CLI)
    version=numeric_version
)

# generates a version data file that will be read by pyinstaller # TODO move this to the do-it scripts # this file contains the actual version, generated by setuptools_scm # optional, can be set to overwrite version information (equivalent to --version when using the CLI)