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

Commit c1b44f9

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

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-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

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
}
31+
trap cleanup EXIT SIGINT
32+
33+
34+
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")
35+
pushd "${SCRIPT_ROOT}" > /dev/null
36+
SCRIPT_ROOT=`pwd`
37+
popd > /dev/null
38+
39+
cd "${TMP_DIR}"
40+
git clone https://github.com/kubernetes-incubator/client-python.git
41+
cd client-python
42+
git config user.email "[email protected]"
43+
git config user.name "kubenetes client"
44+
git rm -rf kubernetes/base
45+
git commit -m "DO NOT MERGE, removing submodule for testing only"
46+
mkdir kubernetes/base
47+
cp -r "${SCRIPT_ROOT}/." kubernetes/base
48+
rm -rf kubernetes/base/.git
49+
rm -rf kubernetes/base/.tox
50+
git add kubernetes/base
51+
git commit -m "DO NOT MERGE, adding changes for testing."
52+
git status
53+
54+
echo "Running tox from the main repo on $TOXENV environment"
55+
# Run the user-provided command.
56+
"${@}"
57+

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)