Skip to content

Commit

Permalink
Switch to tox for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nimne committed May 1, 2020
1 parent 897e113 commit 76a5fc6
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
# Ignoring W503, because it is difficult to make pretty equations
ignore = D203, W503
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,.tox
max-line-length = 120
38 changes: 28 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,53 @@ matrix:
- name: "Python 3.8.0 on Xenial Linux"
python: 3.8 # this works for Linux but is ignored on macOS or Windows
dist: xenial
env:
- TOXENV=py38
- RELEASE=yes
- name: "Python 3.7.1 on Xenial Linux"
python: 3.7 # this works for Linux but is ignored on macOS or Windows
dist: xenial # required for Python >= 3.7
env:
- TOXENV=py37
- RELEASE=yes
before_script:
- pip3 install flake8
- flake8 readlif
- name: "Python 3.6.7 on Xenial Linux"
python: 3.6 # this works for Linux but is ignored on macOS or Windows
dist: xenial # required for Python >= 3.7
env:
- TOXENV=py36
- RELEASE=yes
- name: "Pypy 3.5 on Xenial Linux"
python: "pypy3" # this works for Linux but is ignored on macOS or Windows
dist: xenial # required for Python >= 3.7
env: TOXENV=pypy3
- name: "Python 3.7.2 on macOS"
os: osx
osx_image: xcode10.2 # Python 3.7.2 running on macOS 10.14.3
language: shell # 'language: python' is an error on Travis CI macOS
env: TOXENV=py37
- name: "Python 3.7.2 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.7.2
- python -m pip install --upgrade pip
- python -m pip install --user unittest2
env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
env:
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
- TOXENV=py37
- name: "Python 3.8.0 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.8.0
env:
- PATH=/c/Python38:/c/Python38/Scripts:$PATH
- TOXENV=py38
install:
- pip3 install --upgrade pip # all three OSes agree about 'pip3'
- pip3 install unittest2
- pip3 install flake8
# 'python' points to Python 2.7 on macOS but points to Python 3.7 on Linux and Windows
# 'python3' is a 'command not found' error on Windows but 'py' works on Windows only
script: python3 setup.py test || python setup.py test
- pip3 install tox

script: tox

deploy:
provider: pypi
Expand All @@ -43,4 +60,5 @@ deploy:
distributions: "sdist bdist_wheel"
skip_existing: true
on:
tags: true
tags: true
condition: $RELEASE = yes
Empty file modified docs/conf.py
100644 → 100755
Empty file.
Empty file modified docs/make.bat
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion readlif/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.1"
__version__ = "0.2.1-dev"
Empty file modified readlif/reader.py
100644 → 100755
Empty file.
Empty file modified readlif/utilities.py
100644 → 100755
Empty file.
6 changes: 2 additions & 4 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# This call to setup() does all the work
setup(
name="readlif",
version="0.2.1",
version="0.2.1-dev",
description="Fast Leica LIF file reader written in python",
long_description=README,
long_description_content_type="text/markdown",
Expand All @@ -20,10 +20,8 @@
classifiers=[
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
],
packages=["readlif"],
include_package_data=True,
install_requires=["Pillow>=4.2.0"],
test_suite="unittest2.collector",
install_requires=["Pillow>=4.2.0"]
)
Empty file modified tests/__init__.py
100644 → 100755
Empty file.
Empty file modified tests/test.py
100644 → 100755
Empty file.
21 changes: 21 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tox]
envlist =
py{36,37,38,py3}

skip_missing_interpreters = {tty:True:False}

[testenv]

description = run tests

basepython =
py36: python3.6
py37: python3.7
py38: python3.8
pypy3: pypy3

deps =
-r requirements.txt
discover

commands = python -m discover

0 comments on commit 76a5fc6

Please sign in to comment.