forked from spoqa/sqlalchemy-utc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
91 lines (83 loc) · 2.55 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
language: python
python:
# Supported versions
- pypy3
- 3.6
- 3.7
- 3.8
- 3.9
- pypy
# Unsupported from Python team
- 2.7
# Completely unsupported
- 3.4
- 3.5
# See:
# https://www.python.org/downloads/
# https://www.pypy.org/download_advanced.html
env:
# Supported versions
- SQLALCHEMY_VER=">=1.3.0,<1.4.0" PIP_OPTS=""
- SQLALCHEMY_VER=">=1.4.0,<1.5.0" PIP_OPTS=""
# Unsupported versions
- SQLALCHEMY_VER=">=1.0.0,<1.1.0" PIP_OPTS=""
- SQLALCHEMY_VER=">=1.1.0,<1.2.0" PIP_OPTS=""
- SQLALCHEMY_VER=">=1.2.0,<1.3.0" PIP_OPTS=""
# See: https://www.sqlalchemy.org/download.html
services:
- postgresql
- mysql
jobs:
exclude:
# No package of SQLAlchemy v1.4 for these Python versions
- python: 3.4
env: SQLALCHEMY_VER=">=1.4.0,<1.5.0" PIP_OPTS=""
- python: 3.5
env: SQLALCHEMY_VER=">=1.4.0,<1.5.0" PIP_OPTS=""
before_install:
- export PY=`python -c 'import sys; print("pypy" if hasattr(sys,"pypy_version_info") else "%d.%d" % sys.version_info[:2])'`
- export PY_VER=`python -c 'import sys; print("%d.%d" % sys.version_info[:2])'`
- echo "PY='$PY'"
- echo "PY_VER='$PY_VER'"
- if [[ "$PY" = "pypy" ]]; then
export PG_URL="postgresql+psycopg2cffi:///utc_test";
export MYSQL_URL="mysql+pymysql://root@localhost/utc_test";
else
export PG_URL="postgresql+psycopg2:///utc_test";
export MYSQL_URL="mysql+mysqlconnector://root@localhost/utc_test";
fi
- export TEST_DATABASE_URLS="$PG_URL $MYSQL_URL"
install:
- if [[ "$PIP_OPTS" != "" ]]; then
pip install $PIP_OPTS "SQLAlchemy $SQLALCHEMY_VER";
else
pip install "SQLAlchemy $SQLALCHEMY_VER";
fi
- pip install -e .
- pip install pytest codecov flake8 flake8-import-order
# pytest-cov 2.10.0 requires a pytest >= 4.6 which is not available in the Python 2.7 environment.
# Use an older version for it.
- if [[ "$PY_VER" = "2.7" && "$PY" != "pypy" ]]; then
pip install 'pytest-cov < 2.10.0';
else
pip install pytest-cov;
fi
# PyMySQL dropped support for Python 2.7 in version 1.0.0:
# https://github.com/PyMySQL/PyMySQL/blob/master/CHANGELOG.md#v100
# mysql-coonector-python did the same since version 8.0.24:
# https://dev.mysql.com/doc/connector-python/en/connector-python-versions.html
- if [[ "$PY" = "pypy" ]]; then
pip install psycopg2cffi 'pymysql < 1.0.0';
elif [[ "$PY_VER" = "2.7" ]]; then
pip install psycopg2 'mysql-connector-python < 8.0.24';
else
pip install psycopg2 mysql-connector-python;
fi
before_script:
- createdb -E utf8 -T postgres utc_test
- mysql -e 'CREATE DATABASE utc_test;'
script:
- pytest --cov=. --durations=10 tests
- flake8 .
after_success:
- codecov