Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Commit 43a88f8

Browse files
committed
Add tox and travis support
1 parent 8704ce3 commit 43a88f8

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed

.travis.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
sudo: required
4+
5+
matrix:
6+
include:
7+
- python: 2.7
8+
env: TOXENV=py27
9+
- python: 2.7
10+
env: TOXENV=py27-functional
11+
- python: 2.7
12+
env: TOXENV=update-pep8
13+
- python: 2.7
14+
env: TOXENV=docs
15+
- python: 2.7
16+
env: TOXENV=coverage,codecov
17+
- python: 3.4
18+
env: TOXENV=py34
19+
- python: 3.5
20+
env: TOXENV=py35
21+
- python: 3.5
22+
env: TOXENV=py35-functional
23+
- python: 3.6
24+
env: TOXENV=py36
25+
- python: 3.6
26+
env: TOXENV=py36-functional
27+
28+
install:
29+
- pip install tox
30+
31+
script:
32+
- ./run_tox.sh tox
33+

run_tox.sh

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
RUNNING_DIR=$(pwd)
22+
TMP_DIR=$(mktemp -d)
23+
24+
function cleanup()
25+
{
26+
cd "${RUNNING_DIR}"
27+
}
28+
trap cleanup EXIT SIGINT
29+
30+
31+
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")
32+
pushd "${SCRIPT_ROOT}" > /dev/null
33+
SCRIPT_ROOT=`pwd`
34+
popd > /dev/null
35+
36+
cd "${TMP_DIR}"
37+
git clone https://github.com/kubernetes-incubator/client-python.git
38+
cd client-python
39+
git config user.email "[email protected]"
40+
git config user.name "kubenetes client"
41+
git rm -rf kubernetes/base
42+
git commit -m "DO NOT MERGE, removing submodule for testing only"
43+
mkdir kubernetes/base
44+
cp -r "${SCRIPT_ROOT}/." kubernetes/base
45+
rm -rf kubernetes/base/.git
46+
rm -rf kubernetes/base/.tox
47+
git add kubernetes/base
48+
git commit -m "DO NOT MERGE, adding changes for testing."
49+
git status
50+
51+
echo "Running tox from the main repo on $TOXENV environment"
52+
# Run the user-provided command.
53+
"${@}"
54+

tox.ini

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[tox]
2+
skipsdist = True
3+
envlist = py27, py34, py35, py36
4+
5+
[testenv]
6+
passenv = TOXENV CI TRAVIS TRAVIS_*
7+
commands =
8+
python -V
9+
pip install nose
10+
./run_tox.sh nosetests []
11+

0 commit comments

Comments
 (0)