<commit_before># NOTE: Please validate this file after editing it using
#       Travis WebLint https://lint.travis-ci.org/
#       or travis-lint https://github.com/travis-ci/travis-lint

language: cpp
compiler:
  - gcc
os:
  - linux
  - osx
dist:
  - bionic
osx_image: xcode11.2
sudo: false
cache:
  apt: true

env:
  global:
      # List of required boost libraries to build
    - BOOST_LIBS="date_time,filesystem,iostreams,python,regex,system,test"
      # Encrypted COVERITY_SCAN_TOKEN
    - secure: "<KEY>
  jobs:
    - PY_MAJOR=2
    - PY_MAJOR=3

addons:
  coverity_scan:
    project:
      name: "ledger/ledger"
      description: "Build submitted via Travis CI"
    build_command_prepend: "cmake . -DUSE_PYTHON=ON -DBUILD_DEBUG=ON -DCLANG_GCOV=ON -DPython_FIND_VERSION_MAJOR=${PY_MAJOR}"
    build_command: "make"
    branch_pattern: coverity
  apt:
    packages:
      - libgmp-dev
      - libmpfr-dev
      - libedit-dev
      - libboost-dev
      - libboost-test-dev
      - libboost-regex-dev
      - libboost-python-dev
      - libboost-system-dev
      - libboost-date-time-dev
      - libboost-iostreams-dev
      - libboost-filesystem-dev
      - libboost-serialization-dev
  homebrew:
    update: true
    packages:
      - boost
      - boost-python
      - boost-python3
      - gmp
      - mpfr

before_script:
  # On macOS, precompiling system.hh does not work, and boost-python packaging is broken
  - if [ "$TRAVIS_OS_NAME" = osx ]; then EXTRA_CMAKE_ARGS="-DPRECOMPILE_SYSTEM_HH=OFF -DBoost_NO_BOOST_CMAKE=ON"; fi
  - cmake . -DUSE_PYTHON=ON -DPython_FIND_VERSION_MAJOR=${PY_MAJOR} -DBUILD_DEBUG=ON $EXTRA_CMAKE_ARGS
  - make VERBOSE=1

script:
  - ctest --output-on-failure
  - PYTHONPATH=. python${PY_MAJOR} python/demo.py

notifications:
  email:
    on_success: change
    on_failure: change
  irc:
    channels: [ "chat.freenode.net#ledger" ]
    on_success: change
    on_failure: change
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/0050d91909a8cde39e35
    on_success: change  # options: [always|never|change] default: always
    on_failure: always  # options: [always|never|change] default: always
    on_start: never     # options: [always|never|change] default: always
<commit_msg>travis: use the same python executable, as found by cmake<commit_after># NOTE: Please validate this file after editing it using
#       Travis WebLint https://lint.travis-ci.org/
#       or travis-lint https://github.com/travis-ci/travis-lint

language: cpp
compiler:
  - gcc
os:
  - linux
  - osx
dist:
  - bionic
osx_image: xcode11.2
sudo: false
cache:
  apt: true

env:
  global:
      # List of required boost libraries to build
    - BOOST_LIBS="date_time,filesystem,iostreams,python,regex,system,test"
      # Encrypted COVERITY_SCAN_TOKEN
    - secure: "<KEY>
  jobs:
    - PY_MAJOR=2
    - PY_MAJOR=3

addons:
  coverity_scan:
    project:
      name: "ledger/ledger"
      description: "Build submitted via Travis CI"
    build_command_prepend: "cmake . -DUSE_PYTHON=ON -DBUILD_DEBUG=ON -DCLANG_GCOV=ON -DPython_FIND_VERSION_MAJOR=${PY_MAJOR}"
    build_command: "make"
    branch_pattern: coverity
  apt:
    packages:
      - libgmp-dev
      - libmpfr-dev
      - libedit-dev
      - libboost-dev
      - libboost-test-dev
      - libboost-regex-dev
      - libboost-python-dev
      - libboost-system-dev
      - libboost-date-time-dev
      - libboost-iostreams-dev
      - libboost-filesystem-dev
      - libboost-serialization-dev
  homebrew:
    update: true
    packages:
      - boost
      - boost-python
      - boost-python3
      - gmp
      - mpfr

before_script:
  # On macOS, precompiling system.hh does not work, and boost-python packaging is broken
  - if [ "$TRAVIS_OS_NAME" = osx ]; then EXTRA_CMAKE_ARGS="-DPRECOMPILE_SYSTEM_HH=OFF -DBoost_NO_BOOST_CMAKE=ON"; fi
  - cmake . -DUSE_PYTHON=ON -DPython_FIND_VERSION_MAJOR=${PY_MAJOR} -DBUILD_DEBUG=ON $EXTRA_CMAKE_ARGS
  - make VERBOSE=1

script:
  - ctest --output-on-failure
  - PYTHONPATH=. `cmake -LA . | sed -n 's/Python_EXECUTABLE:FILEPATH=//p'` python/demo.py

notifications:
  email:
    on_success: change
    on_failure: change
  irc:
    channels: [ "chat.freenode.net#ledger" ]
    on_success: change
    on_failure: change
  webhooks:
    urls:
      - https://webhooks.gitter.im/e/0050d91909a8cde39e35
    on_success: change  # options: [always|never|change] default: always
    on_failure: always  # options: [always|never|change] default: always
    on_start: never     # options: [always|never|change] default: always

{'fraction_non_alphanumeric': 0.10523998238661382, 'fraction_numerical': 0.009247027741083224, 'mean_word_length': 2.8565365025466893, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2580604', 'n_tokens_mistral': 1710, 'n_tokens_neox': 1682, 'n_words': 333}