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

Commit 317d9ff

Browse files
committed
Add tox and travis support
1 parent 8704ce3 commit 317d9ff

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

.travis.yml

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

run_tox.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
# Script to fetch latest swagger spec.
18+
# Puts the updated spec at api/swagger-spec/
19+
20+
set -o errexit
21+
set -o nounset
22+
set -o pipefail
23+
24+
RUNNING_DIR=$(pwd)
25+
TMP_DIR=$(mktemp -d)
26+
27+
function cleanup()
28+
{
29+
cd "${RUNNING_DIR}"
30+
# rm -rf "${TMP_DIR}"
31+
}
32+
trap cleanup EXIT SIGINT
33+
34+
35+
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")
36+
pushd "${SCRIPT_ROOT}" > /dev/null
37+
SCRIPT_ROOT=`pwd`
38+
popd > /dev/null
39+
40+
cd "${TMP_DIR}"
41+
git clone https://github.com/kubernetes-incubator/client-python.git
42+
cd client-python
43+
cp -r "${SCRIPT_ROOT}/." kubernetes/base
44+
45+
echo "Running tox from the main repo on $TOXENV environment"
46+
# Run the user-provided command.
47+
"${@}"
48+

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)