Commit 80ae99f7 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

add wheels python scripts for linux

parent fdc7c3b8
#!/bin/bash
# compile wheel
for PYBIN in /opt/python/*/bin/; do
echo "Compiling using pip version ${PYBIN}...."
PATH=/opt2/local/swig-p37/bin/:${PATH} "${PYBIN}/pip" wheel /unsio/ -w wheelhouse
done
# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
echo "repairing $whl...."
auditwheel repair "$whl" -w .
done
# Install package and test
for PYBIN in /opt/python/*/bin/; do
echo "Installing from $PYBIN ...."
"${PYBIN}/pip" install python-unsio --no-index -f .
echo
done
#!/bin/bash
mkdir /works
cd /works
HDF5_ROOT=/opt2/local/HDF5/hdf5-1.8.20 /opt2/local/bin/cmake /unsio/ -DCMAKE_INSTALL_PREFIX=/usr
make -j 5
make install
#!/usr/bin/env python
import os,sys,glob
import shlex,subprocess
def launch_cmd(cmd,run=True,verbose=True,my_env=""):
#args=shlex.split(cmd)
args=cmd
if verbose:
print(args)
if run:
_env=os.environ.copy()
_env=_env.update(my_env)
#subprocess.Popen(args,env=_env)
subprocess.call(args,shell=True,env=_env)
def clean(py_inter,run=True):
cmd=py_inter+' setup.py clean --all'
launch_cmd(cmd,run=run)
def create_wheel(py_inter,run=True):
#cmd=py_inter+' CC=/usr/bin/cc CXX=/usr/bin/c++ setup.py bdist_wheel'
my_env={}
my_env["PATH"]="/opt2/local/swig-p37/bin/:"+os.environ['PATH'] # give path access to swig
#my_env["CXX"]="/usr/bin/c++"
cmd="PATH=/opt2/local/swig-p37/bin/:"+os.environ['PATH']+" "+py_inter+' setup.py bdist_wheel'
launch_cmd(cmd,run=run,my_env=my_env)
def repair_wheel(run=True):
for whl in glob.glob("dist/python_unsio*linux*.whl"):
print(whl)
cmd='auditwheel repair -w fixed-wheel '+whl
launch_cmd(cmd,run=run)
for pyp in glob.glob("/opt/python/cp*/bin/python"):
py_inter=pyp
print(py_inter)
clean(py_inter,run=True)
create_wheel(py_inter,run=True)
repair_wheel(run=True)
#!/bin/bash
# compile wheel
for PYBIN in /opt/python/*/bin/; do
echo "Compiling using pip version ${PYBIN}...."
#"${PYBIN}/python"
PATH=/opt2/local/swig-p37/bin/:${PATH} "${PYBIN}/pip" wheel /unsio/ -w wheelhouse
done
#!/bin/bash
# package centos to install
yum install -y zlib-devel
# install numpy precompiled for every python version and not the latest for compatibility
# cp27
/opt/python/cp27-cp27m/bin/pip install https://files.pythonhosted.org/packages/1e/1f/42ec033fe7522ea5e16352b5491cca5d08bd05fd1d19b5be9dd9d2a3a15d/numpy-1.8.2-cp27-cp27m-manylinux1_x86_64.whl
# cp27mu
/opt/python/cp27-cp27mu/bin/pip install https://files.pythonhosted.org/packages/17/f3/404bc85be67150663024d2bb5af654c7d16cf678077690dda27b91be14eb/numpy-1.8.2-cp27-cp27mu-manylinux1_x86_64.whl
# cp34
/opt/python/cp34-cp34m/bin/pip install https://files.pythonhosted.org/packages/33/7d/46d8905d39f462e0f6d1f38e1d165adc2939b9f91ca800e1cba8ef0c0f24/numpy-1.8.2-cp34-cp34m-manylinux1_x86_64.whl
# cp35
/opt/python/cp35-cp35m/bin/pip install https://files.pythonhosted.org/packages/f4/69/4ae20782ac53363af7e153bb902d83d861a6e50fec4dc1e71d86bc5747d4/numpy-1.9.0-cp35-cp35m-manylinux1_x86_64.whl
# cp36
/opt/python/cp36-cp36m/bin/pip install https://files.pythonhosted.org/packages/a6/cf/a4b4398cabe57968d44d4091ed6644f69704f4783c90c05fa480a8fb0b11/numpy-1.11.3-cp36-cp36m-manylinux1_x86_64.whl
# cp37
/opt/python/cp37-cp37m/bin/pip install https://files.pythonhosted.org/packages/3f/e7/7f24ef402a5766c677683e313c5595137d754cb9eb1c99627803280e79d5/numpy-1.14.5-cp37-cp37m-manylinux1_x86_64.whl
#!/bin/bash
# Install package and test
for PYBIN in /opt/python/*/bin/; do
echo "Installing from $PYBIN ...."
"${PYBIN}/pip" install python-unsio --no-index -f /opt2/wheel
echo
done
#!/bin/bash
# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
echo "repairing $whl...."
auditwheel repair "$whl" -w /opt2/wheel
done
#!/bin/bash
# start docker
docker run -it -v /home/jcl/works/GIT/unsio:/unsio -v /home/jcl/works/GIT/python-wheel:/opt2 quay.io/pypa/manylinux1_x86_64
#!/bin/bash
# install mandatory packages
/opt2/scripts/install_requirements.sh
# build and install UNSIO library
/opt2/scripts/build_unsio.sh
# build wheels for every python version
#/opt2/scripts/build_wheel.sh
/opt/python/cp37-cp37m/bin/python /unsio/py/wheels/linux/build_wheel.py
# repair wheels for every python version
#/opt2/scripts/repair_wheel.sh
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment