From c5c13d69d64815b5f1bff997588fd945f91061a6 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 5 Feb 2019 20:03:33 +0100 Subject: [PATCH] ci: Travis: Ubuntu Xenial, and pynvim (#908) --- .travis.yml | 28 +++++++++++++++------------- Makefile | 26 ++++++++++++++------------ 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index dbc79c5..09a0524 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ -sudo: false +dist: xenial language: python -python: 3.6 +python: 3.7 env: matrix: - ENV=test @@ -13,20 +13,22 @@ matrix: install: - | if [ "$ENV" = "test" ]; then - python3.6 -m pip install pytest - fi - - | - # https://github.com/neovim/bot-ci#generated-builds - if [ "$ENV" = "test_coverage" ]; then - eval "$(curl -Ss https://raw.githubusercontent.com/neovim/bot-ci/master/scripts/travis-setup.sh) nightly-x64" - pip --version - pip install neovim pytest-cov + pip install pytest + elif [ "$ENV" = "test_coverage" ]; then + sudo add-apt-repository ppa:neovim-ppa/stable -y + sudo apt-get update -q + sudo apt-get install neovim -y + + pip install pynvim pytest-cov else vim --version fi script: - - make --keep-going "$ENV" + - make --keep-going "$ENV" BUILD_VIRTUAL_ENV=$VIRTUAL_ENV after_success: - - coverage xml - - bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -X fix -X search -X xcode -f coverage.xml -F py${TRAVIS_PYTHON_VERSION//./} + - | + if [ "$ENV" = "test_coverage" ]; then + coverage xml + bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -X fix -X search -X xcode -f coverage.xml -F py${TRAVIS_PYTHON_VERSION//./} + fi diff --git a/Makefile b/Makefile index 6896dfd..6b794c2 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +BUILD_VIRTUAL_ENV:=build/venv + test: pytest @@ -7,23 +9,23 @@ test_nvim: test_coverage: export PYTEST_ADDOPTS:=--cov pythonx --cov test --cov-report=term-missing:skip-covered test_coverage: test_nvim -build: - mkdir $@ +$(dir $(BUILD_VIRTUAL_ENV)): + mkdir -p $@ -build/venv: | build - virtualenv -p python3.6 $@ +$(BUILD_VIRTUAL_ENV): | $(dir $(BUILD_VIRTUAL_ENV)) + python -m venv $@ -build/venv/bin/vint: | build/venv - $|/bin/pip install -q vim-vint==0.3.19 +$(BUILD_VIRTUAL_ENV)/bin/vint: | $(BUILD_VIRTUAL_ENV) + $|/bin/python -m pip install vim-vint==0.3.19 -build/venv/bin/flake8: | build/venv - $|/bin/pip install -q flake8==3.5.0 +$(BUILD_VIRTUAL_ENV)/bin/flake8: | $(BUILD_VIRTUAL_ENV) + $|/bin/python -m pip install -q flake8==3.5.0 -vint: build/venv/bin/vint - build/venv/bin/vint after autoload ftplugin plugin +vint: $(BUILD_VIRTUAL_ENV)/bin/vint + $(BUILD_VIRTUAL_ENV)/bin/vint after autoload ftplugin plugin -flake8: build/venv/bin/flake8 - build/venv/bin/flake8 pythonx/jedi_*.py +flake8: $(BUILD_VIRTUAL_ENV)/bin/flake8 + $(BUILD_VIRTUAL_ENV)/bin/flake8 pythonx/jedi_*.py check: vint flake8