language: python
python:
  - "3.6"
  - "3.7"
dist: bionic

before_install:
  - echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
  - sudo apt-get update
  - sudo DEBIAN_FRONTEND=noninteractive apt-get install -y libhunspell-dev hunspell-en-us ttf-mscorefonts-installer poppler-utils libdb++-dev
  - sudo fc-cache

install:
  - pip install -r requirements.txt
  - python3 -m nltk.downloader stopwords
  - python3 -m nltk.downloader punkt
  - python3 -m spacy download en_core_web_sm
  - python3 -m nltk.downloader averaged_perceptron_tagger
  - pip install coverage

script:
  - coverage run --source generativepoetry setup.py test --verbose

after_success:
  - pip install coveralls; fi
  - coveralls  # send coverage to coveralls.io

after_script:
  - coverage report                     # display coverage report on command line
  - pip install pycodestyle pyflakes
  - pyflakes . | tee >(wc -l)           # static analysis
  - pycodestyle --max-line-length=120 --statistics --count .  # static analysis