Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis tweaks #225

Merged
merged 10 commits into from
Dec 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 'travis@nowhere.edu'
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