Add "-v"/"--version" argument to set the installer version string.

This commit is contained in:
Ryan Volz 2021-04-16 15:44:52 -04:00
parent 7b0aafca98
commit 8cf14767a8

View File

@ -136,6 +136,9 @@ if __name__ == "__main__":
distname = os.getenv("DISTNAME", "radioconda") distname = os.getenv("DISTNAME", "radioconda")
source = os.getenv("SOURCE", "github.com/ryanvolz/radioconda") source = os.getenv("SOURCE", "github.com/ryanvolz/radioconda")
dt = datetime.datetime.now()
version = dt.strftime("%Y.%m.%d")
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description=( description=(
"Re-render installer specification directories to be used by conda" "Re-render installer specification directories to be used by conda"
@ -153,6 +156,16 @@ if __name__ == "__main__":
" (default: %(default)s)" " (default: %(default)s)"
), ),
) )
parser.add_argument(
"-v",
"--version",
type=str,
default=version,
help=(
"Version tag for the installer, defaults to the current date."
" (default: %(default)s)"
),
)
parser.add_argument( parser.add_argument(
"--company", "--company",
type=str, type=str,
@ -198,12 +211,9 @@ if __name__ == "__main__":
conda_executable=args.conda_exe, mamba=True, micromamba=True conda_executable=args.conda_exe, mamba=True, micromamba=True
) )
dt = datetime.datetime.now()
version = dt.strftime("%Y.%m.%d")
constructor_specs = render_constructor_specs( constructor_specs = render_constructor_specs(
environment_file=args.environment_file, environment_file=args.environment_file,
version=version, version=args.version,
company=args.company, company=args.company,
license_file=args.license_file, license_file=args.license_file,
output_dir=args.output_dir, output_dir=args.output_dir,