Skip to content

Commit cffd126

Browse files
author
rocky
committed
Better package testing
1 parent 817eec2 commit cffd126

File tree

4 files changed

+117
-4
lines changed

4 files changed

+117
-4
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xasm
44
====
55

6-
*NOTE: this is in beta*
6+
*NOTE: this is in beta.*
77

88
A cross-version Python bytecode assembler
99

@@ -55,7 +55,7 @@ A GNU makefile is also provided so ``make install`` (possibly as root or
5555
sudo) will do the steps above.
5656

5757

58-
*If you are using Python before 3.11*, do not install using PyPI, but instead install using a file in the [GitHub Releases section](https://github.com/rocky/python-xasm/releases). Older Python used to use `easy_install <https://python101.pythonlibrary.org/chapter29_pip.html#using-easy-install>`_. But this is no longer supported in PyPi or newer Python versions. And vice versa, *poetry* nor *pip*, (the newer ways) are not supported on older Pythons.
58+
*If you are using Python before 3.11*, do not install using PyPI, but instead install using a file in the `GitHub Releases section <https://github.com/rocky/python-xasm/releases>`_. Older Python used to use `easy_install <https://python101.pythonlibrary.org/chapter29_pip.html#using-easy-install>`_. But this is no longer supported in PyPi or newer Python versions. And vice versa, *poetry* nor *pip*, (the newer ways) are not supported on older Pythons.
5959

6060
If the Python version you are running xasm is between Python 3.6 through 3.11, use a tarball called xasm_36-*x.y.z*.tar.gz.
6161

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/bash
2+
PACKAGE_MODULE=xasm
3+
xasm_owd=$(pwd)
4+
bs=${BASH_SOURCE[0]}
5+
mydir=$(dirname $bs)
6+
xasm_fulldir=$(readlink -f $mydir)
7+
cd $xasm_fulldir
8+
. ./checkout_common.sh
9+
10+
pyenv_file="pyenv-3.6-3.10-versions"
11+
if ! source $pyenv_file ; then
12+
echo "Having trouble reading ${pyenv_file} version $(pwd)"
13+
exit 1
14+
fi
15+
16+
source ../${PACKAGE_MODULE}/version.py
17+
if [[ ! $__version__ ]] ; then
18+
echo "Something is wrong: __version__ should have been set."
19+
exit 1
20+
fi
21+
22+
cd ../dist/
23+
24+
install_file="xasm_36-${__version__}.tar.gz"
25+
install_check_command="pyc-xasm --help"
26+
for version in $PYVERSIONS; do
27+
echo "*** Installing ${install_file} for Python ${version} ***"
28+
echo $version
29+
pyenv local $version
30+
pip install $install_file
31+
$install_check_command
32+
echo "----"
33+
done

admin-tools/install-all-newest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ fi
2121

2222
cd ../dist/
2323

24-
install_check_command="xasm --version"
25-
install_file="xasm-${__version__}.tar.gz"
24+
install_check_command="xasm --help"
25+
install_file="pyc-xasm-${__version__}.tar.gz"
2626
for pyversion in $PYVERSIONS; do
2727
echo "*** Installing ${install_file} for Python ${pyversion} ***"
2828
pyenv local $pyversion

admin-tools/make-dist-3.6-3.10.sh

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/bin/bash
2+
# The name Python's import uses.
3+
# It is reflected in the directory structure.
4+
PACKAGE_MODULE="xasm"
5+
6+
# The name that PyPi sees this as.
7+
# It is set in setup.py's name.
8+
PACKAGE_NAME="xasm"
9+
10+
# FIXME put some of the below in a common routine
11+
function finish {
12+
if [[ -n "$make_dist_xasm_36_owd" ]] then
13+
cd $make_dist_xasm_36_owd
14+
fi
15+
}
16+
17+
make_dist_xasm_36_owd=$(pwd)
18+
cd $(dirname ${BASH_SOURCE[0]})
19+
trap finish EXIT
20+
21+
if ! source ./pyenv-3.6-3.10-versions ; then
22+
exit $?
23+
fi
24+
25+
if ! source ./setup-python-3.6.sh ; then
26+
exit $?
27+
fi
28+
29+
cd ..
30+
31+
source ${PACKAGE_MODULE}/version.py
32+
if [[ ! -n $__version__ ]]; then
33+
echo "Something is wrong: __version__ should have been set."
34+
exit 1
35+
fi
36+
37+
for pyversion in $PYVERSIONS; do
38+
case ${pyversion:0:4} in
39+
"graal" )
40+
echo "$pyversion - Graal does not get special packaging"
41+
continue
42+
;;
43+
"jyth" )
44+
echo "$pyversion - Jython does not get special packaging"
45+
continue
46+
;;
47+
"pypy" )
48+
echo "$pyversion - PyPy does not get special packaging"
49+
continue
50+
;;
51+
"pyst" )
52+
echo "$pyversion - Pyston does not get special packaging"
53+
continue
54+
;;
55+
esac
56+
echo "*** Packaging ${PACKAGE_NAME} for version ${__version__} on Python ${pyversion} ***"
57+
if ! pyenv local $pyversion ; then
58+
exit $?
59+
fi
60+
# pip bdist_egg create too-general wheels. So
61+
# we narrow that by moving the generated wheel.
62+
63+
# Pick out first two number of version, e.g. 3.5.1 -> 35
64+
first_two=$(echo $pyversion | cut -d'.' -f 1-2 | sed -e 's/\.//')
65+
rm -fr build
66+
python setup.py bdist_wheel
67+
mv -v dist/${PACKAGE_MODULE}-${__version__}-{py3,py$first_two}-none-any.whl
68+
done
69+
70+
python ./setup.py sdist
71+
tarball=dist/${PACKAGE_NAME}-${__version__}.tar.gz
72+
73+
if [[ -f $tarball ]]; then
74+
version_specific_tarball=dist/${PACKAGE_NAME}_36-${__version__}.tar.gz
75+
mv -v $tarball $version_specific_tarball
76+
twine check $version_specific_tarball
77+
78+
fi
79+
twine check dist/${PACKAGE_MODULE}-${__version__}-py3*.whl
80+
finish

0 commit comments

Comments
 (0)