* update Travis
* add Appveyor
This commit is contained in:
Jiri BOROVEC 2019-08-05 21:22:18 +02:00
parent a79de1ec8e
commit 5d307e0838
3 changed files with 157 additions and 11 deletions

View File

@ -1,17 +1,48 @@
# vim ft=yaml
# After changing this file, check it on:
# http://yaml-online-parser.appspot.com/
# See doc/travis_notes.txt for some guidelines
# this file is *not* meant to cover or endorse the use of travis, but rather to
# help confirm pull requests to this project.
dist: xenial # Ubuntu 16.04
env:
global:
- DISPLAY=""
language: python
python:
- "3.7"
# command to install dependencies
matrix:
include:
- python: 3.5
env: TOXENV=py35
- python: 3.6
env: TOXENV=py36
- python: 3.7
env: TOXENV=py37
# See http://docs.travis-ci.com/user/caching/#pip-cache
cache: pip
install:
- pip install -e .
- sudo apt-get install python-opencv openslide-tools
- pip install -r requirements.txt
- pip install -r tests/requirements.txt
- pip install -U numpy
- pip install -r ./tests/requirements.txt
- pip install tox
- pip --version ; pip list
# keep build from timing out
dist: xenial
# command to run tests
script:
- py.test -v # or py.test for Python versions 3.5 and below
# integration
- tox --sitepackages
- python setup.py install --user --dry-run
after_success:
- coverage report
- codecov
notifications:
email: false

65
appveyor.yml Normal file
View File

@ -0,0 +1,65 @@
# https://www.appveyor.com/docs/appveyor-yml/
environment:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script interpreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd"
matrix:
# Pre-installed Python versions, which Appveyor may upgrade to
# a later point release.
# See: http://www.appveyor.com/docs/installed-software#python
- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.x"
PYTHON_ARCH: "64"
TOXENV: "py35"
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"
TOXENV: "py36"
- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "64"
TOXENV: "py37"
build: off
# https://www.appveyor.com/docs/build-cache/
cache:
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
- '%LOCALAPPDATA%\pip\Cache -> appveyor.yml'
# scripts that run after cloning repository
install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
# purpose but it is problematic because it tends to cancel builds pushed
# directly to master instead of just PR builds (or the converse).
- choco upgrade chocolatey
- choco install -y opencv
- SET PATH=%PYTHON%;%PYTHON%\\Scripts;%path%
- pip install -U --user pip
- pip install -r requirements.txt
- pip install -r ./tests/requirements.txt
- pip install tox
# scripts to run before tests (working directory and environment changes are persisted from the previous steps such as "before_build")
before_test:
- python --version
- pip --version
- pip list
- dir
# to run your custom scripts instead of automatic tests
test_script:
- tox --sitepackages --parallel auto
on_success:
- coverage report
- codecov

50
tox.ini Normal file
View File

@ -0,0 +1,50 @@
# this file is *not* meant to cover or endorse the use of tox or pytest or testing in general,
#
# It's meant to show the use of:
#
# - check-manifest
# confirm items checked into vcs are in your segdist
# - python setup.py check
# confirm required package meta-data in setup.py
# - readme_renderer (when using a ReStructuredText README)
# confirms your long_description will render correctly on PyPI.
#
# and also to help confirm pull requests to this project.
[tox]
envlist = py{35,36,37}
[pytest]
log_cli = 0
log_cli_level = CRITICAL
log_cli_format = %(message)s
log_file = pytest.log
log_file_level = DEBUG
log_file_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)
log_file_date_format=%Y-%m-%d %H:%M:%S
[testenv]
basepython =
py35: python3.5
py36: python3.6
py37: python3.7
deps =
-r requirements.txt
-r ./tests/requirements.txt
commands =
check-manifest --ignore tox.ini
python setup.py check -m -s
coverage run --source pytorch_lightning -m py.test pytorch_lightning tests examples -v --doctest-modules
flake8 .
[flake8]
exclude = .tox,*.egg,build,temp
select = E,W,F
doctests = True
verbose = 2
# https://pep8.readthedocs.io/en/latest/intro.html#error-codes
ignore =
E402
E501
format = pylint
max-line-length = 100