You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Some admin tools I use.
This commit is contained in:
11
admin-tools/README.md
Normal file
11
admin-tools/README.md
Normal file
@@ -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
|
18
admin-tools/check-newer-versions.sh
Executable file
18
admin-tools/check-newer-versions.sh
Executable file
@@ -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
|
18
admin-tools/check-older-versions.sh
Executable file
18
admin-tools/check-older-versions.sh
Executable file
@@ -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
|
59
admin-tools/how-to-make-a-release.txt
Normal file
59
admin-tools/how-to-make-a-release.txt
Normal file
@@ -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}*
|
14
admin-tools/make-dist-newer.sh
Executable file
14
admin-tools/make-dist-newer.sh
Executable file
@@ -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
|
18
admin-tools/make-dist-older.sh
Executable file
18
admin-tools/make-dist-older.sh
Executable file
@@ -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
|
5
admin-tools/pyenv-newer-versions
Normal file
5
admin-tools/pyenv-newer-versions
Normal file
@@ -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'
|
5
admin-tools/pyenv-older-versions
Normal file
5
admin-tools/pyenv-older-versions
Normal file
@@ -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'
|
16
admin-tools/setup-master.sh
Executable file
16
admin-tools/setup-master.sh
Executable file
@@ -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
|
16
admin-tools/setup-python-2.4.sh
Executable file
16
admin-tools/setup-python-2.4.sh
Executable file
@@ -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
|
Reference in New Issue
Block a user