Skip to content

Commit

Permalink
Make improvements to release script
Browse files Browse the repository at this point in the history
  • Loading branch information
texasaggie97-zz committed Nov 19, 2019
1 parent fc50f6e commit cd3880c
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions tools/build_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

pp = pprint.PrettyPrinter(indent=4, width=100)

default_python_cmd = ['c:/Python27/python.exe']
default_python_cmd = ['python.exe']
drivers_to_release = ['nifake', 'nidcpower', 'nidigital', 'nidmm', 'niswitch', 'nimodinst', 'nifgen', 'niscope', 'nise', 'nitclk']


def configure_logging(lvl=logging.WARNING, logfile=None):
Expand Down Expand Up @@ -105,24 +106,10 @@ def main():

if args.update:
logging.info('Updating versions')
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nifake/metadata/config_addon.py', ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nifake/metadata/config_addon.py', ] + passthrough_params)
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nidcpower/metadata/config_addon.py', ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nidcpower/metadata/config_addon.py', ] + passthrough_params)
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nidmm/metadata/config_addon.py', ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nidmm/metadata/config_addon.py', ] + passthrough_params)
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/niswitch/metadata/config_addon.py', ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/niswitch/metadata/config_addon.py', ] + passthrough_params)
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nimodinst/metadata/config_addon.py', ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nimodinst/metadata/config_addon.py', ] + passthrough_params)
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nifgen/metadata/config_addon.py', ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nifgen/metadata/config_addon.py', ] + passthrough_params)
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/niscope/metadata/config_addon.py', ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/niscope/metadata/config_addon.py', ] + passthrough_params)
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nise/metadata/config_addon.py', ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nise/metadata/config_addon.py', ] + passthrough_params)
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nitclk/metadata/config_addon.py', ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/nitclk/metadata/config_addon.py', ] + passthrough_params)

for d in drivers_to_release:
logging.info(pp.pformat(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/{}/metadata/config_addon.py'.format(d), ] + passthrough_params))
check_call(python_cmd + ['tools/updateReleaseInfo.py', '--src-file', 'src/{}/metadata/config_addon.py'.format(d), ] + passthrough_params)

if args.build:
logging.info('Clean and build')
Expand All @@ -135,7 +122,10 @@ def main():

if args.upload:
logging.info('Uploading to PyPI')
complete_twine_cmd = twine_cmd + ['upload', 'bin/nidcpower/dist/*', 'bin/nidigital/dist/*', 'bin/nidmm/dist/*', 'bin/nimodinst/dist/*', 'bin/niswitch/dist/*', 'bin/nifgen/dist/*', 'bin/niscope/dist/*', 'bin/nise/dist/*', 'bin/nitclk/dist/*']
complete_twine_cmd = twine_cmd + ['upload']
for d in drivers_to_release:
complete_twine_cmd += ['bin/{}/dist/*'.format(d)]

logging.info(pp.pformat(complete_twine_cmd))
if not args.preview:
check_call(complete_twine_cmd)
Expand Down

0 comments on commit cd3880c

Please sign in to comment.