From 9a2534556cc43690c0aa281706dff613e3a43528 Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 11 Oct 2017 21:14:30 -0400 Subject: [PATCH] Some admin tools I use. --- admin-tools/README.md | 11 +++++ admin-tools/check-newer-versions.sh | 18 ++++++++ admin-tools/check-older-versions.sh | 18 ++++++++ admin-tools/how-to-make-a-release.txt | 59 +++++++++++++++++++++++++++ admin-tools/make-dist-newer.sh | 14 +++++++ admin-tools/make-dist-older.sh | 18 ++++++++ admin-tools/pyenv-newer-versions | 5 +++ admin-tools/pyenv-older-versions | 5 +++ admin-tools/setup-master.sh | 16 ++++++++ admin-tools/setup-python-2.4.sh | 16 ++++++++ 10 files changed, 180 insertions(+) create mode 100644 admin-tools/README.md create mode 100755 admin-tools/check-newer-versions.sh create mode 100755 admin-tools/check-older-versions.sh create mode 100644 admin-tools/how-to-make-a-release.txt create mode 100755 admin-tools/make-dist-newer.sh create mode 100755 admin-tools/make-dist-older.sh create mode 100644 admin-tools/pyenv-newer-versions create mode 100644 admin-tools/pyenv-older-versions create mode 100755 admin-tools/setup-master.sh create mode 100755 admin-tools/setup-python-2.4.sh diff --git a/admin-tools/README.md b/admin-tools/README.md new file mode 100644 index 00000000..0dce281f --- /dev/null +++ b/admin-tools/README.md @@ -0,0 +1,11 @@ +Making a release is a somewhat tedious process so I've automated it a little + + +Here are tools that I, rocky, use to check and build a distribution. + +They are customized to my environment: +- I use pyenv to various Python versions installed +- I have git repos for xdis, and spark parser at the same level as uncompyle6 + +There may be other rocky-specific things that need customization. +how-to-make-a-release.txt has overall how I make a release diff --git a/admin-tools/check-newer-versions.sh b/admin-tools/check-newer-versions.sh new file mode 100755 index 00000000..a6d27051 --- /dev/null +++ b/admin-tools/check-newer-versions.sh @@ -0,0 +1,18 @@ +#!/bin/bash +cd $(dirname ${BASH_SOURCE[0]}) +if ! source ./pyenv-newer-versions ; then + exit $? +fi +if ! source ./setup-master.sh ; then + exit $? +fi +cd .. +for version in $PYVERSIONS; do + if ! pyenv local $version ; then + exit $? + fi + make clean && python setup.py develop + if ! make check; then + exit $? + fi +done diff --git a/admin-tools/check-older-versions.sh b/admin-tools/check-older-versions.sh new file mode 100755 index 00000000..53a00f6f --- /dev/null +++ b/admin-tools/check-older-versions.sh @@ -0,0 +1,18 @@ +#!/bin/bash +cd $(dirname ${BASH_SOURCE[0]}) +if ! source ./pyenv-older-versions ; then + exit $? +fi +if ! source ./setup-python-2.4.sh ; then + exit $? +fi +cd .. +for version in $PYVERSIONS; do + if ! pyenv local $version ; then + exit $? + fi + make clean && python setup.py develop + if ! make check ; then + exit $? + fi +done diff --git a/admin-tools/how-to-make-a-release.txt b/admin-tools/how-to-make-a-release.txt new file mode 100644 index 00000000..38e346ac --- /dev/null +++ b/admin-tools/how-to-make-a-release.txt @@ -0,0 +1,59 @@ +git pull + +Change version in uncompyle6/version.py +source uncompyle6/version.py +echo $VERSION +git commit -m"Get ready for release $VERSION" . + +Update ChangeLog: + make ChangeLog + +Update NEWS from ChangeLog +make check + +git commit --amend . + +git push + +Make sure pyenv is running +# Pyenv + +source make-dist/pyenv-versions + + +Test all python versions: + for version in $PYVERSIONS; do pyenv local $version && make clean && python setup.py develop && make check; done + +# Switch to python-2.4 and build that first... + + +---- + +./setup-python-2.4.sh + +rm ChangeLog +git merge master +check uncompyle6/version.py to see it has changed +make ChangeLog + +Update NEWS from master branch + +git commit -m"Get ready for release $VERSION" . + +PYVERSIONS='2.4.6 2.5.6' + +for version in $PYVERSIONS; do pyenv local $version && make clean && python setup.py develop && make check; done + +make-dist-older.sh + +git tag release-python-2.4-$VERSION +git push --tags + +. ./setup-master.sh + +./make-dist-newer.sh + +git tag release-$VERSION + + +twine upload dist/uncompyle6-${VERSION}* diff --git a/admin-tools/make-dist-newer.sh b/admin-tools/make-dist-newer.sh new file mode 100755 index 00000000..4f10e3b1 --- /dev/null +++ b/admin-tools/make-dist-newer.sh @@ -0,0 +1,14 @@ +#!/bin/bash +PACKAGE=uncompyle6 +source $PACKAGE/version.py +. ./setup-master.sh +echo $VERSION +PYVERSIONS='3.5.2 3.6.2 2.6.9 3.3.6 2.7.13 3.4.2 3.5.6' +for pyversion in $PYVERSIONS; do + # Pick out first two numbers + first_two=$(echo $pyversion | cut -d'.' -f 1-2 | sed -e 's/\.//') + python setup.py bdist_egg bdist_wheel + mv -v dist/uncompyle6-$VERSION-{py2.py3,py$first_two}-none-any.whl +done + +python ./setup.py sdist diff --git a/admin-tools/make-dist-older.sh b/admin-tools/make-dist-older.sh new file mode 100755 index 00000000..8300bf95 --- /dev/null +++ b/admin-tools/make-dist-older.sh @@ -0,0 +1,18 @@ +#!/bin/bash +PACKAGE=uncompyle6 +if ! source ./setup-python-2.4.sh ; then + exit $? +fi +source $PACKAGE/version.py +echo $VERSION +PYVERSIONS='2.4.6 2.5.6' +for pyversion in $PYVERSIONS; do + # Pick out first two numbers + first_two=$(echo $pyversion | cut -d'.' -f 1-2 | sed -e 's/\.//') + rm -fr build + python setup.py bdist_egg +done +tarball=dist/uncompyle6-$VERSION-tar.gz +if -f $tarball; then + rm dist/uncompyle6-$VERSION-tar.gz +fi diff --git a/admin-tools/pyenv-newer-versions b/admin-tools/pyenv-newer-versions new file mode 100644 index 00000000..559670b5 --- /dev/null +++ b/admin-tools/pyenv-newer-versions @@ -0,0 +1,5 @@ +if [[ $0 == ${BASH_SOURCE[0]} ]] ; then + echo "This script should be *sourced* rather than run directly through bash" + exit 1 +fi +export PYVERSIONS='3.5.2 3.6.2 2.6.9 3.3.6 pypy-5.0.1 2.7.13 3.4.2' diff --git a/admin-tools/pyenv-older-versions b/admin-tools/pyenv-older-versions new file mode 100644 index 00000000..f5d03e18 --- /dev/null +++ b/admin-tools/pyenv-older-versions @@ -0,0 +1,5 @@ +if [[ $0 == ${BASH_SOURCE[0]} ]] ; then + echo "This script should be *sourced* rather than run directly through bash" + exit 1 +fi +export PYVERSIONS='2.4.6 2.5.6' diff --git a/admin-tools/setup-master.sh b/admin-tools/setup-master.sh new file mode 100755 index 00000000..84fade5e --- /dev/null +++ b/admin-tools/setup-master.sh @@ -0,0 +1,16 @@ +#!/bin/bash +PYTHON_VERSION=3.6.3 + +owd=$(pwd) +bs=${BASH_SOURCE[0]} +if [[ $0 == $bs ]] ; then + echo "This script should be *sourced* rather than run directly through bash" + exit 1 +fi +mydir=$(dirname $bs) +fulldir=$(readlink -f $mydir) +cd $fulldir/.. +(cd ../python-spark && git checkout master && pyenv local $PYTHON_VERSION) && \ + (cd ../python-xdis && git checkout master && pyenv local $PYTHON_VERSION) && \ + git checkout master && pyenv local $PYTHON_VERSION +cd $owd diff --git a/admin-tools/setup-python-2.4.sh b/admin-tools/setup-python-2.4.sh new file mode 100755 index 00000000..f4665ab7 --- /dev/null +++ b/admin-tools/setup-python-2.4.sh @@ -0,0 +1,16 @@ +#!/bin/bash +PYTHON_VERSION=2.4.6 + +owd=$(pwd) +bs=${BASH_SOURCE[0]} +if [[ $0 == $bs ]] ; then + echo "This script should be *sourced* rather than run directly through bash" + exit 1 +fi +mydir=$(dirname $bs) +fulldir=$(readlink -f $mydir) +cd $fulldir/.. +(cd ../python-spark && git checkout python-2.4 && pyenv local $PYTHON_VERSION) && \ + (cd ../python-xdis && git checkout python-2.4 && pyenv local $PYTHON_VERSION) && \ + git checkout python-2.4 && pyenv local $PYTHON_VERSION +cd $owd