mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-05 17:00:58 +01:00
Merge pull request #1468 from xonsh/multi-os
Updates to #1465 using miniconda everywhere
This commit is contained in:
commit
60aafcfb16
4 changed files with 61 additions and 8 deletions
55
.travis.yml
55
.travis.yml
|
@ -1,11 +1,52 @@
|
|||
language: python
|
||||
python:
|
||||
- 3.4
|
||||
- 3.5
|
||||
- "nightly"
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
language: generic
|
||||
env: PYTHON="3.4" MINICONDA_OS="Linux"
|
||||
- os: linux
|
||||
language: generic
|
||||
env: PYTHON="3.5" MINICONDA_OS="Linux"
|
||||
- os: osx
|
||||
language: generic
|
||||
env: PYTHON="3.4" MINICONDA_OS="MacOSX"
|
||||
- os: osx
|
||||
language: generic
|
||||
env: PYTHON="3.5" MINICONDA_OS="MacOSX"
|
||||
- os: linux
|
||||
python: "nightly"
|
||||
env: RUN_COVERAGE=true
|
||||
|
||||
before_install:
|
||||
- if [[ ! "$TRAVIS_PYTHON_VERSION" == "nightly" ]]; then
|
||||
URL="https://repo.continuum.io/miniconda/Miniconda3-latest-${MINICONDA_OS}-x86_64.sh";
|
||||
wget "${URL}" -O miniconda.sh;
|
||||
bash miniconda.sh -b -p $HOME/miniconda;
|
||||
export PATH="$HOME/miniconda/bin:$PATH";
|
||||
hash -r;
|
||||
conda config --set always_yes yes --set changeps1 no;
|
||||
conda update -q conda;
|
||||
conda info -a;
|
||||
fi
|
||||
|
||||
install:
|
||||
- pip install -r requirements-tests.txt
|
||||
- if [[ ! "$TRAVIS_PYTHON_VERSION" == "nightly" ]]; then
|
||||
conda create -q -n test_env python=${PYTHON} pygments prompt_toolkit ply pytest pytest-timeout psutil;
|
||||
source activate test_env;
|
||||
python setup.py install;
|
||||
else
|
||||
pip install -r requirements-tests.txt;
|
||||
fi
|
||||
|
||||
script:
|
||||
- py.test --flake8 --cov=. --cov-report=term
|
||||
- if [ $RUN_COVERAGE = true]; then
|
||||
py.test --flake8 --cov=. --cov-report=term --timeout=10;
|
||||
else
|
||||
py.test --timeout=10;
|
||||
fi
|
||||
|
||||
after_success:
|
||||
- codecov
|
||||
- if [$RUN_COVERAGE = true]; then
|
||||
codecov;
|
||||
fi
|
|
@ -2,6 +2,7 @@
|
|||
flake8-max-line-length = 180
|
||||
flake8-ignore =
|
||||
*.py E402
|
||||
tests/tools.py E128
|
||||
xonsh/ast.py F401
|
||||
xonsh/built_ins.py F821
|
||||
xonsh/commands_cache.py F841
|
||||
|
|
|
@ -5,6 +5,10 @@ import stat
|
|||
import os
|
||||
from xontrib.voxapi import Vox
|
||||
|
||||
from tools import skip_if_on_conda
|
||||
|
||||
|
||||
@skip_if_on_conda
|
||||
def test_crud(xonsh_builtins, tmpdir):
|
||||
"""
|
||||
Creates a virtual environment, gets it, enumerates it, and then deletes it.
|
||||
|
@ -24,6 +28,8 @@ def test_crud(xonsh_builtins, tmpdir):
|
|||
|
||||
assert not tmpdir.join('spam').check()
|
||||
|
||||
|
||||
@skip_if_on_conda
|
||||
def test_activate(xonsh_builtins, tmpdir):
|
||||
"""
|
||||
Creates a virtual environment, gets it, enumerates it, and then deletes it.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
"""Tests the xonsh lexer."""
|
||||
from __future__ import unicode_literals, print_function
|
||||
import os
|
||||
import sys
|
||||
import builtins
|
||||
import platform
|
||||
|
@ -19,11 +20,15 @@ VER_MAJOR_MINOR = sys.version_info[:2]
|
|||
VER_FULL = sys.version_info[:3]
|
||||
ON_DARWIN = (platform.system() == 'Darwin')
|
||||
ON_WINDOWS = (platform.system() == 'Windows')
|
||||
|
||||
ON_CONDA = True in [conda in pytest.__file__ for conda
|
||||
in ['anaconda', 'miniconda']]
|
||||
|
||||
# pytest skip decorators
|
||||
skip_if_py34 = pytest.mark.skipif(VER_MAJOR_MINOR < VER_3_5, reason="Py3.5+ only test")
|
||||
|
||||
skip_if_on_conda = pytest.mark.skipif(ON_CONDA,
|
||||
reason="Conda and virtualenv _really_ hate each other")
|
||||
|
||||
skip_if_on_windows = pytest.mark.skipif(ON_WINDOWS, reason='Unix stuff')
|
||||
|
||||
skip_if_on_unix = pytest.mark.skipif(not ON_WINDOWS, reason='Windows stuff')
|
||||
|
|
Loading…
Add table
Reference in a new issue