-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple install tests on Travis CI #23
Changes from all commits
b96e228
aa9bd94
ec9d631
63244f1
448c64c
d1dfb7b
6bcff56
6509181
e134ded
6ac9ecb
905498f
33ce842
fdead1d
7814be9
543ef4c
ce9fc7b
e9e3642
5de1003
fef3e5e
09dd8c6
d287e5c
58d7c52
3c940ef
123db6b
c7bbeb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
language: python | ||
|
||
python: | ||
- "3.7-dev" | ||
- "3.6" | ||
- "3.5" | ||
- "3.4" | ||
- "3.3" | ||
- "3.2" | ||
- "2.7" | ||
- "2.6" | ||
|
||
env: | ||
- SCRIPT_SRC=local | ||
- SCRIPT_SRC=remote | ||
|
||
cache: | ||
pip: true | ||
|
||
install: | ||
- pip uninstall --yes setuptools pip | ||
|
||
script: | ||
- .travis/helpers.sh "$TRAVIS_PYTHON_VERSION" "$SCRIPT_SRC" | ||
- pip -V | ||
|
||
jobs: | ||
fast_finish: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#! /usr/bin/env bash | ||
|
||
DEBUG=$DEBUG | ||
|
||
set -euo pipefail | ||
|
||
[[ -n "$DEBUG" ]] && set -xv | ||
|
||
declare -a SPECIAL_VERSIONS=('2.6' '3.2' '3.3') | ||
|
||
function find_get_pip_version() { | ||
local version="$1" | ||
|
||
for v in "${SPECIAL_VERSIONS[@]}" | ||
do | ||
[[ "$version" == "$v" ]] && echo "$version" && return 0 | ||
done | ||
|
||
return 1 | ||
} | ||
|
||
function cat_get_pip() { | ||
local version=$(find_get_pip_version "$1") | ||
|
||
local path="get-pip.py" | ||
[[ -n "$version" ]] && path="$version/$path" | ||
local src="$2" | ||
local cmd=cat | ||
if [[ "$src" == "remote" ]] | ||
then | ||
path="https://bootstrap.pypa.io/$path" | ||
cmd='wget -O - ' | ||
>&2 echo Downloading bootstrap script from remote... | ||
elif [[ "$src" != "local" ]] | ||
then | ||
>&2 echo Wrong source argument: $src | ||
exit 1 | ||
fi | ||
|
||
>&2 echo Version $1 requires following script: $path | ||
$cmd $path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you testing an install into an environment that currently doesn't have pip installed? I can't tell (but I don't think you are)... Someone who has pip installed can simply do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, pip is uninstalled at the start: https://github.com/hugovk/get-pip/blob/c7bbeb9da01074f9f5b1ec0fedd1273aee8460dc/.travis.yml There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, thanks for the pointer. |
||
} | ||
|
||
function main() { | ||
local python_version="$1" | ||
local get_pip_src="$2" | ||
cat_get_pip "$python_version" "$get_pip_src" | python - | ||
} | ||
|
||
# Reset settings | ||
set +eu | ||
|
||
main $* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not at all sure that we should be testing "remote" here. The tests should be testing what's in the repository - for example, the test runs for a PR shouldn't fail because the published version was broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move tests for remote to run only when triggered manually (or via API) and not PR. Deal? I don't want to completely eliminate them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pfmoore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I care much, TBH. As noted, I'm against this approach (of using a shell script) anyway.