Skip to content

Commit 5d15936

Browse files
authored
Merge pull request #37 from nexB/35-update-pyenv
Try to run test correctly on Linux AND macOS
2 parents 619a871 + 0aa006c commit 5d15936

3 files changed

Lines changed: 93 additions & 39 deletions

File tree

.travis.yml

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
1-
language: generic
2-
3-
env:
4-
matrix:
5-
- PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`"
6-
- PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`"
7-
8-
9-
# Travis does not offer OSX with arbitrary python versions (like 2.7.13 above)
10-
# So, you cannot simply have the following section in your build matrix:
11-
# os:
12-
# - linux
13-
# - osx
14-
# Instead, you have to include OSX entries into the build matrix manually.
15-
# In particular, this means specifying the environment variables again.
16-
17-
# The following was adapted from here:
18-
# https://docs.travis-ci.com/user/multi-os/
19-
# Set `language: generic` to clear `language: python` from above
20-
# Set `python:` (to empty) to clear it from the travis-ci web interface
21-
# Set `osx_image: xcode7.3` to pin OSX version see here:
22-
# https://docs.travis-ci.com/user/osx-ci-environment/
23-
241
matrix:
252
include:
263
- os: osx
274
language: generic
28-
python:
29-
osx_image: xcode7.3
30-
env: PYTHON_EXE="`pyenv install -s 2.7.14 && pyenv local 2.7.14`"
5+
env:
6+
- PYENV_PYTHON="2.7.14"
7+
318
- os: osx
329
language: generic
33-
python:
34-
osx_image: xcode7.3
35-
env: PYTHON_EXE="`pyenv install -s 3.6.1 && pyenv local 3.6.1`"
10+
env:
11+
- PYENV_PYTHON="3.6.1"
12+
13+
- os: linux
14+
language: generic
15+
env:
16+
- PYENV_PYTHON="2.7.14"
17+
18+
- os: linux
19+
language: generic
20+
env:
21+
- PYENV_PYTHON="3.6.1"
3622

3723

3824
install:
25+
- |
26+
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
27+
rm -rf ~/.pyenv
28+
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
29+
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
30+
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
31+
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
32+
exec "$SHELL"
33+
fi
34+
- which pyenv
3935
- pyenv install --list
40-
- echo $PYTHON_EXE
36+
- python --version
37+
- pyenv install "$PYENV_PYTHON"
38+
- pyenv global "$PYENV_PYTHON"
4139
- python --version
4240
- ./configure
4341

44-
before_script:
45-
- bin/about-code check --verbose .
4642

4743
script:
44+
- bin/about-code check --verbose .
4845
- "bin/py.test -vvs"
4946

47+
5048
notifications:
5149
irc:
5250
channels:

appveyor.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ environment:
44
matrix:
55
- PYTHON_EXE: "C:\\Python27\\python.exe"
66
- PYTHON_EXE: "C:\\Python27-x64\\python.exe"
7-
- PYTHON_EXE: "C:\\Python34\\python.exe"
8-
- PYTHON_EXE: "C:\\Python34-x64\\python.exe"
9-
- PYTHON_EXE: "C:\\Python35\\python.exe"
10-
- PYTHON_EXE: "C:\\Python35-x64\\python.exe"
117
- PYTHON_EXE: "C:\\Python36\\python.exe"
128
- PYTHON_EXE: "C:\\Python36-x64\\python.exe"
139

@@ -21,8 +17,5 @@ test_script:
2117
- 'bin\python -c "from __future__ import print_function;import sys;print(sys.getdefaultencoding())"'
2218
- 'bin\py.test -vvs'
2319

24-
on_success:
25-
- "python etc/scripts/irc-notify.py aboutcode [{project_name}:{branch}] {short_commit}: \"{message}\" ({author}) {color_green}Succeeded,Details: {build_url},Commit: {commit_url}"
26-
2720
on_failure:
2821
- "python etc/scripts/irc-notify.py aboutcode [{project_name}:{branch}] {short_commit}: \"{message}\" ({author}) {color_red}Failed,Details: {build_url},Commit: {commit_url}"

azure-pipelines.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
trigger:
2+
branches:
3+
include: ['pipeline']
4+
tags:
5+
include: ['*']
6+
7+
jobs:
8+
- job: tests
9+
displayName: Run tests
10+
steps:
11+
- script: ./configure
12+
- script: ./bin/py.test -vvs tests/commoncode
13+
14+
jobs:
15+
- job: Tests
16+
17+
strategy:
18+
19+
matrix:
20+
Python_27_Linux:
21+
imageName: 'ubuntu-16.04'
22+
python.version: '2.7'
23+
Python_27_Mac:
24+
imageName: 'macos-10.13'
25+
python.version: '2.7'
26+
Python_27_Win:
27+
imageName: 'vs2017-win2016'
28+
python.version: '2.7'
29+
30+
Python_36_Linux:
31+
imageName: 'ubuntu-16.04'
32+
python.version: '3.6'
33+
Python_36_Mac:
34+
imageName: 'macos-10.13'
35+
python.version: '3.6'
36+
Python_36_Windows:
37+
imageName: 'vs2017-win2016'
38+
python.version: '3.6'
39+
40+
Python_37_Linux:
41+
imageName: 'ubuntu-16.04'
42+
python.version: '3.7'
43+
Python_37_Mac:
44+
imageName: 'macos-10.13'
45+
python.version: '3.7'
46+
Python_37_Windows:
47+
imageName: 'vs2017-win2016'
48+
python.version: '3.7'
49+
50+
pool:
51+
vmImage: $(imageName)
52+
53+
steps:
54+
55+
- task: UsePythonVersion@0
56+
inputs:
57+
versionSpec: '$(python.version)'
58+
architecture: 'x64'
59+
60+
- script: |
61+
configure
62+
bin/py.test -vvs
63+
displayName: 'Run tests'

0 commit comments

Comments
 (0)