diff --git a/.travis.yml b/.travis.yml index ddae5ce9..f006af3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,10 @@ language: python python: - "2.7" - "3.6" -sudo: enabled -script: make test +sudo: false +script: + - make init + - make test env: PYTHONPATH=$PYTHONPATH:$TRAVIS_BUILD_DIR/tests:$TRAVIS_BUILD_DIR/matchzoo +install: + - python setup.py install diff --git a/Makefile b/Makefile index fabdec51..c4d8a412 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ init: - pip install -r requirements.txt --user + pip install -r requirements.txt test: pytest tests/ --ignore=tests/inte_tests/ --cov matchzoo/ --cov-report term-missing --cov-config .coveragerc diff --git a/matchzoo/models/matchsrnn.py b/matchzoo/models/matchsrnn.py index b56cc949..94710e33 100644 --- a/matchzoo/models/matchsrnn.py +++ b/matchzoo/models/matchsrnn.py @@ -23,11 +23,11 @@ def __init__(self, config): 'embed', 'embed_size', 'vocab_size', 'channal', 'dropout_rate'] self.embed_trainable = config['train_embed'] self.channel = config['channel'] - print self.channel + print(self.channel) self.setup(config) if not self.check(): raise TypeError('[MatchSRNN] parameter check wrong') - print '[MatchSRNN] init done' + print('[MatchSRNN] init done') def setup(self, config): if not isinstance(config, dict): diff --git a/requirements.txt b/requirements.txt index 07da10f8..318cb895 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,9 @@ numpy >= 1.12.1 six >= 1.10.0 h5py >= 2.7.0 tqdm >= 4.19.4 +scipy >= 1.0.0 +matplotlib >= 2.2.0 +jieba >= 0.39 coverage >= 4.3.4 codecov >= 2.0.15 pytest >= 3.0.3 diff --git a/setup.py b/setup.py index 0f10e45b..6b96f360 100644 --- a/setup.py +++ b/setup.py @@ -1,40 +1,56 @@ -import os -from setuptools import setup, find_packages - -def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname), encoding= 'utf').read() - -setup( - name = "MatchZoo", - version = "0.2.0", - author = "Yixing Fan, Liang Pang, Jianpeng Hou, Jiafeng Guo, Yanyan Lan, Xueqi Cheng", - author_email = "fanyixing@software.ict.ac.cn", - description = ("MatchZoo is a toolkit for text matching. It was developed with a focus on facilitating the designing, comparing and sharing of deep text matching models."), - license = "BSD", - keywords = "text matching models", - url = "https://github.com/faneshion/MatchZoo", - packages=find_packages(),#['data', 'docs', 'examples', 'matchzoo', 'tests'], - #long_description=read('README.md'), - classifiers=[ - # How mature is this project? Common values are - "Development Status :: 3 - Alpha", - 'Environment :: Console', - 'Operating System :: POSIX :: Linux', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - "License :: OSI Approved :: Apache License", - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6' - ], - install_requires=[ - 'keras >= 2.0.5', - 'tensorflow >= 1.1.0', - 'nltk >= 3.2.3', - 'numpy >= 1.12.1', - 'six >= 1.10.0', - 'h5py >= 2.7.0', - 'tqdm >= 4.19.4' - ] -) +import os +from setuptools import setup, find_packages + + +def read(fname): + return open(os.path.join(os.path.dirname(__file__), fname), encoding='utf').read() + + +setup( + name="MatchZoo", + version="0.2.0", + author="Yixing Fan, Liang Pang, Jianpeng Hou, Jiafeng Guo, Yanyan Lan, Xueqi Cheng", + author_email="fanyixing@software.ict.ac.cn", + description=("MatchZoo is a toolkit for text matching. It was developed with a focus on facilitating the designing, comparing and sharing of deep text matching models."), + license="BSD", + keywords="text matching models", + url="https://github.com/faneshion/MatchZoo", + # ['data', 'docs', 'examples', 'matchzoo', 'tests'], + packages=find_packages(), + # long_description=read('README.md'), + classifiers=[ + # How mature is this project? Common values are + "Development Status :: 3 - Alpha", + 'Environment :: Console', + 'Operating System :: POSIX :: Linux', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + "License :: OSI Approved :: Apache License", + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6' + ], + install_requires=[ + 'keras >= 2.0.5', + 'tensorflow >= 1.1.0', + 'nltk >= 3.2.3', + 'numpy >= 1.12.1', + 'six >= 1.10.0', + 'h5py >= 2.7.0', + 'tqdm >= 4.19.4', + 'scipy >= 1.0.0', + 'jieba >= 0.39' + ], + extras_require={ + 'visualize': ['matplotlib >= 2.2.0'], + 'tests': [ + 'coverage >= 4.3.4', + 'codecov >= 2.0.15', + 'pytest >= 3.0.3', + 'pytest-cov >= 2.4.0', + 'mock >= 2.0.0', + 'flake8 >= 3.2.1', + 'flake8_docstrings >= 1.0.2'], + } +)