Skip to content

Commit

Permalink
Simplify travis CI, update pytest / cov, add caching for pip (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony authored Dec 24, 2019
2 parents 142e307 + e9ef2cd commit 54a6a98
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 29 deletions.
16 changes: 5 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
language: python
sudo: false
dist: bionic # 18.04
if: (type = push AND branch IN (master)) OR (type = pull_request)
python:
- 2.7
- 3.6
- 3.7
- pypy
- pypy3
before_install:
- export PIP_USE_MIRRORS=true
- pip install -U pip setuptools
- pip install -U pytest mock # https://github.com/travis-ci/travis-ci/issues/4873
- pip install coveralls
- git config --global user.name 'travis-ci'
- git config --global user.email '[email protected]'
cache: pip
install:
- "pip install -e ."
script: coverage run --source=unihan_db setup.py test
- pip install -e .
- pip install -r requirements/test.txt
script: py.test --cov=unihan_db
after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ flake8 = "*"
pytest = "*"
unihan-db = {path = ".",editable = true}
sphinx-issues = "*"
pytest-cov = "*"
coverage = "*"

[packages]
appdirs = "*"
Expand Down
96 changes: 95 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pytest<=5.1
pytest<6
pytest-cov
coverage
16 changes: 0 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import sys

from setuptools import setup
from setuptools.command.test import test as TestCommand

about = {}
with open("unihan_db/__about__.py") as fp:
Expand All @@ -25,20 +24,6 @@
history = open('CHANGES').read().replace('.. :changelog:', '')


class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []

def run_tests(self):
import pytest

errno = pytest.main(self.pytest_args)
sys.exit(errno)


setup(
name=about['__title__'],
version=about['__version__'],
Expand All @@ -57,7 +42,6 @@ def run_tests(self):
include_package_data=True,
install_requires=install_reqs,
tests_require=tests_reqs,
cmdclass={'test': PyTest},
zip_safe=False,
keywords=about['__title__'],
packages=['unihan_db'],
Expand Down

0 comments on commit 54a6a98

Please sign in to comment.