# HG changeset patch # User Dan Buch # Date 1323235059 18000 # Node ID e0d072b2e7d00e7aa3f031e1a817da2c32f72740 # Parent 7fc2c4bb264a05f5ef48232c28a72ac773506f11 Moving dev scripts into their own dir, futzing with paths a bit diff -r 7fc2c4bb264a05f5ef48232c28a72ac773506f11 -r e0d072b2e7d00e7aa3f031e1a817da2c32f72740 devscripts/fetch-reindent-versions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/devscripts/fetch-reindent-versions Wed Dec 07 00:17:39 2011 -0500 @@ -0,0 +1,13 @@ +#!/bin/bash + +TOP=$(dirname $(dirname $(readlink -f $0))) +REPO_BASE="http://hg.python.org/cpython-fullhistory" + +for tag in "2.3.7" "2.4.6" "2.5.5" "2.6.6" "2.7.1" "3.0.1" "3.1.3" "3.2" +do + vnum="v$(echo $tag | sed 's/\.//g' | cut -b 1-2)" + dest="${TOP}/reindent/${vnum}/reindent.py" + dl_url="${REPO_BASE}/raw-file/v${tag}/Tools/scripts/reindent.py" + echo "Downloading ${dl_url} to ${dest}" + curl "${dl_url}" > "${dest}" 2>/dev/null +done diff -r 7fc2c4bb264a05f5ef48232c28a72ac773506f11 -r e0d072b2e7d00e7aa3f031e1a817da2c32f72740 devscripts/test-python-versions --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/devscripts/test-python-versions Wed Dec 07 00:17:39 2011 -0500 @@ -0,0 +1,58 @@ +#!/usr/bin/env python +""" +This is a very crude version compatibility script that cycles through a bunch +of python versions likely (???) to still be in use. The script itself has only +been tested on linux, so any feedback from users on other platforms is much +appreciated. +""" +from __future__ import print_function + +import sys +from os.path import dirname, abspath, join as pathjoin +from subprocess import check_call, PIPE + + +VERSIONS = ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2'] +REINDENT_SCRIPT = pathjoin( + dirname(dirname(abspath(__file__))), 'scripts', 'reindent' +) + + +def main(): + had_failure = False + passes = 0 + + for version in VERSIONS: + exe = 'python{0}'.format(version) + + try: + check_call([exe, '-c', 'import sys'], stdout=PIPE, stderr=PIPE) + print('+ Testing {0}'.format(exe), end='') + + try: + check_call([exe, REINDENT_SCRIPT, '-h'], + stdout=PIPE, stderr=PIPE) + # yes, it is *hilarious* that I'm using tabs in a script to + # test `reindent` + print('\t\tPASS') + passes += 1 + + except OSError: + had_failure = True + print('\t\tFAIL') + + except OSError: + print('- {0} not detected\tSKIP'.format(exe)) + + print('=' * 36) + print('Summary: ', end='') + + if had_failure: + print('FAIL') + else: + print('PASS ({0}% awesomeness)'.format( + int(100 * (float(passes) / float(len(VERSIONS)))))) + + +if __name__ == '__main__': + sys.exit(main()) diff -r 7fc2c4bb264a05f5ef48232c28a72ac773506f11 -r e0d072b2e7d00e7aa3f031e1a817da2c32f72740 fetch-reindent-versions --- a/fetch-reindent-versions Wed Dec 07 00:00:34 2011 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -#!/bin/bash - -HERE=$(dirname $(readlink -f $0)) -REPO_BASE="http://hg.python.org/cpython-fullhistory" - -for tag in "2.3.7" "2.4.6" "2.5.5" "2.6.6" "2.7.1" "3.0.1" "3.1.3" "3.2" -do - vnum="v$(echo $tag | sed 's/\.//g' | cut -b 1-2)" - dest="${HERE}/reindent/${vnum}/reindent.py" - curl -o "${dest}" "${REPO_BASE}/raw-file/v${tag}/Tools/scripts/reindent.py" -done diff -r 7fc2c4bb264a05f5ef48232c28a72ac773506f11 -r e0d072b2e7d00e7aa3f031e1a817da2c32f72740 test-python-versions --- a/test-python-versions Wed Dec 07 00:00:34 2011 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -#!/usr/bin/env python -""" -This is a very crude version compatibility script that cycles through a bunch -of python versions likely (???) to still be in use. The script itself has only -been tested on linux, so any feedback from users on other platforms is much -appreciated. -""" -from __future__ import print_function - -import sys -import os -from subprocess import check_call, PIPE - - -HERE = os.path.dirname(os.path.abspath(__file__)) -VERSIONS = ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2'] - - -def main(): - had_failure = False - passes = 0 - reindent_script = os.path.join(HERE, 'scripts', 'reindent') - for version in VERSIONS: - exe = 'python{0}'.format(version) - try: - check_call([exe, '-c', 'import sys'], stdout=PIPE, stderr=PIPE) - print('+ Testing {0}'.format(exe), end='') - try: - check_call([exe, reindent_script, '-h'], - stdout=PIPE, stderr=PIPE) - # yes, it is *hilarious* that I'm using tabs in a script to - # test `reindent` - print('\t\tPASS') - passes += 1 - except OSError: - had_failure = True - print('\t\tFAIL') - except OSError: - print('- {0} not detected\tSKIP'.format(exe)) - - print('=' * 36) - print('Summary: ', end='') - - if had_failure: - print('FAIL') - else: - print('PASS ({0}% awesomeness)'.format( - int(100 * (float(passes) / float(len(VERSIONS)))))) - - -if __name__ == '__main__': - sys.exit(main())