mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-07-20 16:42:33 +00:00
108 lines
4.3 KiB
YAML
108 lines
4.3 KiB
YAML
sudo: true
|
|
language: c
|
|
|
|
before_install:
|
|
- export MAIN_PATH=`pwd`
|
|
# install pyenv to test multiple python version
|
|
- |-
|
|
if [ "$TRAVIS_OS_NAME" == "windows" ] ; then
|
|
choco install pyenv-win
|
|
export PYENV_ROOT=$HOME/.pyenv
|
|
export PATH=$PYENV_ROOT/pyenv-win/bin:$PYENV_ROOT/pyenv-win/shims:$PATH
|
|
pyenv update
|
|
else
|
|
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
|
export PYENV_ROOT="$HOME/.pyenv"
|
|
export PATH="$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH"
|
|
eval "$(pyenv init -)"
|
|
fi
|
|
# install c dependency
|
|
- |-
|
|
if [ "$TRAVIS_OS_NAME" == "linux" ] ; then
|
|
sudo apt-get install software-properties-common
|
|
sudo apt-get install -f libssl-dev libssl1.1
|
|
sudo apt-get install -f
|
|
fi
|
|
- git clone https://github.com/mariadb-corporation/mariadb-connector-c.git ~/.cc_3
|
|
- cd ~/.cc_3
|
|
- mkdir bld
|
|
- cd bld
|
|
- |-
|
|
case $TRAVIS_OS_NAME in
|
|
windows)
|
|
export WIX="c:/Program Files (x86)/WiX Toolset v3.14"
|
|
export MARIADB_CC_INSTALL_DIR=$HOME/conc
|
|
cmake .. -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$MARIADB_CC_INSTALL_DIR
|
|
cmake --build . --config RelWithDebInfo
|
|
cmake --install . --config RelWithDebInfo
|
|
;;
|
|
osx)
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_EXTERNAL_ZLIB:BOOL=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1
|
|
make -j4
|
|
;;
|
|
linux)
|
|
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
|
|
make -j4
|
|
;;
|
|
esac
|
|
- |-
|
|
if [ "$TRAVIS_OS_NAME" != "windows" ] ; then
|
|
sudo make install
|
|
export MARIADB_PLUGIN_DIR==`mariadb_config --plugindir`
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/mariadb
|
|
# install "install-latest" to retrieve latest python version corresponding to major.minor version
|
|
git clone https://github.com/momo-lab/pyenv-install-latest.git $PYENV_ROOT/plugins/pyenv-install-latest
|
|
export REAL_PYTHON_VERSION=$(pyenv install-latest --print $PYTHON_VER)
|
|
else
|
|
export MARIADB_PLUGIN_DIR=$MARIADB_CC_INSTALL/lib/mariadb/plugin
|
|
# On Windows we test against latest stable only
|
|
export REAL_PYTHON_VERSION=$(pyenv install --list | grep --extended-regexp "^\s*[0-9][0-9.]*[0-9]\s*$" | tail -1 | tr -d ' ')
|
|
fi
|
|
|
|
- echo $REAL_PYTHON_VERSION
|
|
- pyenv install $REAL_PYTHON_VERSION
|
|
- export PYENV_VERSION=$REAL_PYTHON_VERSION
|
|
- pyenv versions
|
|
# install server
|
|
- cd $MAIN_PATH
|
|
|
|
env:
|
|
global: PYTHON_VER="3.10" HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 DB=testp CLEAR_TEXT=0
|
|
|
|
import: mariadb-corporation/connector-test-machine:common-build.yml@master
|
|
|
|
jobs:
|
|
include:
|
|
- stage: Language
|
|
env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.9"
|
|
name: "Python 3.9"
|
|
- env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.10"
|
|
name: "Python 3.10"
|
|
- env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.11"
|
|
name: "Python 3.11"
|
|
- env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.12"
|
|
name: "Python 3.12"
|
|
- env: srv=mariadb v=10.11 local=1 PYTHON_VER="3.13"
|
|
name: "Python 3.13"
|
|
|
|
script:
|
|
- python --version
|
|
- python -m pip install .
|
|
# - python setup.py build
|
|
# - python setup.py install
|
|
- cd testing
|
|
- |-
|
|
if [ -z "$BENCH" ] ; then
|
|
python -m unittest discover -v
|
|
else
|
|
pip install mysql-connector-python pymysql pyperf
|
|
export TEST_MODULE=mariadb
|
|
python bench_init.py --inherit-environ=TEST_MODULE,TEST_DB_USER,TEST_DB_HOST,TEST_DB_DATABASE,TEST_DB_PORT,TEST_REQUIRE_TLS,TEST_DB_PASSWORD --copy-env
|
|
python bench.py -o mariadb_bench.json --inherit-environ=TEST_MODULE,TEST_DB_USER,TEST_DB_HOST,TEST_DB_DATABASE,TEST_DB_PORT,TEST_REQUIRE_TLS,TEST_DB_PASSWORD --copy-env
|
|
export TEST_MODULE=mysql.connector
|
|
python bench.py -o mysql-connector-python_bench.json --inherit-environ=TEST_MODULE,TEST_DB_USER,TEST_DB_HOST,TEST_DB_DATABASE,TEST_DB_PORT,TEST_REQUIRE_TLS,TEST_DB_PASSWORD --copy-env
|
|
export TEST_MODULE=pymysql
|
|
python bench.py -o pymysql_bench.json --inherit-environ=TEST_MODULE,TEST_DB_USER,TEST_DB_HOST,TEST_DB_DATABASE,TEST_DB_PORT,TEST_REQUIRE_TLS,TEST_DB_PASSWORD --copy-env
|
|
python -m pyperf compare_to pymysql_bench.json mysql-connector-python_bench.json mariadb_bench.json --table
|
|
fi
|