<commit_before>language: python
python:
  - "2.7"
install:
  - if [ -e requirements.txt ]; then pip install -r requirements.txt; fi
  - if [ -z "$DOVIS" -o "$PKG_COVERAGE" ]; then pip install coverage; fi
  ## getting test deps
  - python setup.py develop easy_install "$(./autogen.sh --get-name)[test]"

script:
  - nosetests -sx $(if [ -z "$DOVIS" -o "$PKG_COVERAGE" ]; then echo "--with-coverage"; fi) .
after_success:
  - "bash <(curl -s https://codecov.io/bash)  #dovis: ignore"
  - |
    if [ "$DOVIS" -a -d "$ARTIFACT_DIR" ]; then
        cp ".coverage" "$ARTIFACT_DIR"
        echo "$PWD" > "$ARTIFACT_DIR/cover_path"
    fi

## Ignored by Travis, but used internally to check packaging
dist_check:
  options:
    exclude:
      - ["v:3.6", "pkg:old"]  ## old version is breaking python 3.6 pkg_resources
  tests:
  - label: install
    matrix:
      'yes':
        - label: venv
          matrix:
            'on': |
              pip install virtualenv
              virtualenv /tmp/virtualenv
              . /tmp/virtualenv/bin/activate
            'off': |
              true
        - label: pkg
          matrix:
            old: |
              ## version 10 introduce a bug with d2to1
              pip install setuptools==9.1
              ## some ``python setup.py`` black magic do not work with d2to1 and pip ``6.0.7``
              pip install pip==1.5.6
            docker: |
              ## Using the versions of python docker images
              true
            latest: |
              ## Using the last version of pip and setuptools
              pip install pip --upgrade
              pip install setuptools --upgrade
        - label: method
          matrix:
            setup: python setup.py install
            pip+git: pip install "git+file://$PWD"
            dist:
              dist_files:
                pip install "$DIST_FILE"
        - |
          pip show -f  $(./autogen.sh --get-name)
          pip list
      'no':
      - |
        export PYTHONPATH=/tmp/lib
        mkdir /tmp/lib
        ln -sf $PWD/$(./autogen.sh --get-name).py /tmp/lib/
        touch /tmp/not-installed

  - |
    name=$(./autogen.sh --get-name)
    cd /tmp
    python -c "import $name"
  - |
    [ -e /tmp/not-installed ] || {
        cd "$OLDPWD" &&
        pip uninstall -y $(./autogen.sh --get-name) &&
        cd /tmp &&
        ! python -c "import $name"
    }<commit_msg>chg: pkg: updated ``.travis.yml``<commit_after>language: python
python:
  - "2.7"
install:
  - if [ -e requirements.txt ]; then pip install -r requirements.txt; fi
  - if [ -z "$DOVIS" -o "$PKG_COVERAGE" ]; then pip install coverage; fi
  ## getting test deps
  - python setup.py develop easy_install "$(./autogen.sh --get-name)[test]"

script:
  - nosetests -sx $(if [ -z "$DOVIS" -o "$PKG_COVERAGE" ]; then echo "--with-coverage"; fi) .
after_success:
  - "bash <(curl -s https://codecov.io/bash)  #dovis: ignore"
  - |
    if [ "$DOVIS" -a -d "$ARTIFACT_DIR" ]; then
        cp ".coverage" "$ARTIFACT_DIR"
        echo "$PWD" > "$ARTIFACT_DIR/cover_path"
    fi

## Ignored by Travis, but used internally to check packaging
dist_check:
  options:
    exclude:
      - ["v:3.6", "pkg:old"]  ## old version is breaking python 3.6 pkg_resources
  tests:
  - label: install
    matrix:
      'yes':
        - label: venv
          matrix:
            'on': |
              pip install virtualenv
              virtualenv /tmp/virtualenv
              . /tmp/virtualenv/bin/activate
            'off': |
              true
        - label: pkg
          matrix:
            old: |
              ## version 10 introduce a bug with d2to1
              pip install setuptools==9.1
              ## some ``python setup.py`` black magic do not work with d2to1 and pip ``6.0.7``
              pip install pip==1.5.6
            docker: |
              ## Using the versions of python docker images
              true
            latest: |
              ## Using the last version of pip and setuptools
              pip install pip --upgrade
              pip install setuptools --upgrade
        - label: method
          matrix:
            setup: python setup.py install
            pip+git: pip install "git+file://$PWD"
            dist:
              dist_files:
                pip install "$DIST_FILE"
        - |
          pip show -f  $(./autogen.sh --get-name)
          pip list
      'no':
      - |
        pip install configparser
        pip install $(python -c "import configparser; config = configparser.ConfigParser(); config.read('setup.cfg'); print config['metadata']['requires-dist']")
        export PYTHONPATH=/tmp/lib
        mkdir /tmp/lib
        name=$(./autogen.sh --get-name)
        ln -sf $PWD/src/$name /tmp/lib/
        touch /tmp/not-installed

  - |
    name=$(./autogen.sh --get-name)
    cd /tmp
    python -c "import $name"
  - |
    [ -e /tmp/not-installed ] || {
        cd "$OLDPWD" &&
        pip uninstall -y $(./autogen.sh --get-name) &&
        cd /tmp &&
        ! python -c "import $name"
    }
{'fraction_non_alphanumeric': 0.13198171337706222, 'fraction_numerical': 0.007950705625124229, 'mean_word_length': 1.5898095728255275, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '283127', 'n_tokens_mistral': 1605, 'n_tokens_neox': 1552, 'n_words': 452}