<commit_before># See tests/README.rst for instructions for using travis with developer builds.

language: python

sudo: false

python:
  - '2.7'
  - '3.3'
  - '3.4'
  - '2.6'

# OSX builds do not yet support Python
os:
  - linux

addons:
  apt:
    packages:
      - djvulibre-bin
      - graphviz
      - liblua5.1-0-dev
      - python-ipaddr

before_install:
  # When PYSETUP_TEST_EXTRAS is not enabled, do not allow the
  # default 'install' step to install all dependencies listed in
  # requirements.txt to verify that a minimal install works as expected.
  # Instead install requests in the before_script step below.
  - if [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then rm requirements.txt ; fi

  - if [[ "$SITE_ONLY" == '1' ]]; then export USE_NOSE=1; fi
  - export GITHUB_USER=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 1`
  - mkdir ~/.python-eggs
  - chmod 700 ~/.python-eggs

  - if [[ "$GITHUB_USER" != "wikimedia" ]]; then
      export PYWIKIBOT2_TEST_WRITE_FAIL=1 ;
    fi

before_script:
  - pip install -r dev-requirements.txt

script:
  # Install security packages for requests to support HTTPS in site_detect
  - if [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then
      pip install mwoauth -r requests-requirements.txt ;
    fi

  - mkdir ~/.pywikibot

  - if [[ "$FAMILY" == 'oraintest' ]]; then python pwb.py generate_family_file 'https://test.orain.org/' oraintest ; fi
  - python pwb.py generate_family_file 'https://wiki.musicbrainz.org/' musicbrainz
  - if [[ $FAMILY == 'wpbeta' ]]; then
      python -m generate_family_file 'http://'$LANGUAGE'.wikipedia.beta.wmflabs.org/' 'wpbeta' 'y' ;
    fi
  - if [[ $FAMILY == 'wsbeta' ]]; then
      python -m generate_family_file 'http://'$LANGUAGE'.wikisource.beta.wmflabs.org/' 'wsbeta' 'y' ;
    fi

  - python -W error::UserWarning -m generate_user_files -dir:~/.pywikibot/ -family:$FAMILY -lang:$LANGUAGE -v -user:"$PYWIKIBOT2_USERNAME"

  - if [[ -n "$USER_PASSWORD" && -n "$PYWIKIBOT2_USERNAME" ]]; then
      printf "usernames['wikipedia']['en'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      printf "usernames['wikipedia']['test'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      printf "usernames['wikidata']['test'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      printf "usernames['commons']['commons'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      printf "('%q', '%q')\n" "$PYWIKIBOT2_USERNAME" "$USER_PASSWORD" > ~/.pywikibot/passwordfile ;
      echo "import os" >> ~/.pywikibot/user-config.py ;
      echo "password_file = os.path.expanduser('~/.pywikibot/passwordfile')" >> ~/.pywikibot/user-config.py ;
    fi

  - if [[ -n "$OAUTH_DOMAIN" ]]; then
      if [[ -n "$OAUTH_PYWIKIBOT2_USERNAME" ]]; then
        printf "usernames['${FAMILY}']['${LANGUAGE}'] = '%q'\n" "$OAUTH_PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      fi ;
      oauth_token_var="OAUTH_TOKENS_${FAMILY^^}_${LANGUAGE^^}" ;
      if [[ -n "${!oauth_token_var}" ]]; then
        printf "authenticate['${OAUTH_DOMAIN}'] = ('%s')\n" "${!oauth_token_var//:/', '}" >> ~/.pywikibot/user-config.py ;
      fi ;
    fi
  - echo "authenticate['wiki.musicbrainz.org'] = ('NOTSPAM', 'NOTSPAM')" >> ~/.pywikibot/user-config.py ;

  - echo "max_retries = 2" >> ~/.pywikibot/user-config.py
  - echo "maximum_GET_length = 5000" >> ~/.pywikibot/user-config.py
  - echo "console_encoding = 'utf8'" >> ~/.pywikibot/user-config.py
<commit_msg>Disable multi-site on betawp and betaws<commit_after># See tests/README.rst for instructions for using travis with developer builds.

language: python

sudo: false

python:
  - '2.7'
  - '3.3'
  - '3.4'
  - '2.6'

# OSX builds do not yet support Python
os:
  - linux

addons:
  apt:
    packages:
      - djvulibre-bin
      - graphviz
      - liblua5.1-0-dev
      - python-ipaddr

before_install:
  # When PYSETUP_TEST_EXTRAS is not enabled, do not allow the
  # default 'install' step to install all dependencies listed in
  # requirements.txt to verify that a minimal install works as expected.
  # Instead install requests in the before_script step below.
  - if [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then rm requirements.txt ; fi

  - if [[ "$SITE_ONLY" == '1' ]]; then export USE_NOSE=1; fi
  - export GITHUB_USER=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 1`
  - mkdir ~/.python-eggs
  - chmod 700 ~/.python-eggs

  - if [[ "$GITHUB_USER" != "wikimedia" ]]; then
      export PYWIKIBOT2_TEST_WRITE_FAIL=1 ;
    fi

before_script:
  - pip install -r dev-requirements.txt

script:
  # Install security packages for requests to support HTTPS in site_detect
  - if [[ "$PYSETUP_TEST_EXTRAS" != '1' ]]; then
      pip install mwoauth -r requests-requirements.txt ;
    fi

  - mkdir ~/.pywikibot

  - if [[ "$FAMILY" == 'oraintest' ]]; then python pwb.py generate_family_file 'https://test.orain.org/' oraintest ; fi
  - python pwb.py generate_family_file 'https://wiki.musicbrainz.org/' musicbrainz
  - if [[ $FAMILY == 'wpbeta' ]]; then
      python -m generate_family_file 'http://'$LANGUAGE'.wikipedia.beta.wmflabs.org/' 'wpbeta' 'n' ;
    fi
  - if [[ $FAMILY == 'wsbeta' ]]; then
      python -m generate_family_file 'http://'$LANGUAGE'.wikisource.beta.wmflabs.org/' 'wsbeta' 'n' ;
    fi

  - python -W error::UserWarning -m generate_user_files -dir:~/.pywikibot/ -family:$FAMILY -lang:$LANGUAGE -v -user:"$PYWIKIBOT2_USERNAME"

  - if [[ -n "$USER_PASSWORD" && -n "$PYWIKIBOT2_USERNAME" ]]; then
      printf "usernames['wikipedia']['en'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      printf "usernames['wikipedia']['test'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      printf "usernames['wikidata']['test'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      printf "usernames['commons']['commons'] = '%q'\n" "$PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      printf "('%q', '%q')\n" "$PYWIKIBOT2_USERNAME" "$USER_PASSWORD" > ~/.pywikibot/passwordfile ;
      echo "import os" >> ~/.pywikibot/user-config.py ;
      echo "password_file = os.path.expanduser('~/.pywikibot/passwordfile')" >> ~/.pywikibot/user-config.py ;
    fi

  - if [[ -n "$OAUTH_DOMAIN" ]]; then
      if [[ -n "$OAUTH_PYWIKIBOT2_USERNAME" ]]; then
        printf "usernames['${FAMILY}']['${LANGUAGE}'] = '%q'\n" "$OAUTH_PYWIKIBOT2_USERNAME" >> ~/.pywikibot/user-config.py ;
      fi ;
      oauth_token_var="OAUTH_TOKENS_${FAMILY^^}_${LANGUAGE^^}" ;
      if [[ -n "${!oauth_token_var}" ]]; then
        printf "authenticate['${OAUTH_DOMAIN}'] = ('%s')\n" "${!oauth_token_var//:/', '}" >> ~/.pywikibot/user-config.py ;
      fi ;
    fi
  - echo "authenticate['wiki.musicbrainz.org'] = ('NOTSPAM', 'NOTSPAM')" >> ~/.pywikibot/user-config.py ;

  - echo "max_retries = 2" >> ~/.pywikibot/user-config.py
  - echo "maximum_GET_length = 5000" >> ~/.pywikibot/user-config.py
  - echo "console_encoding = 'utf8'" >> ~/.pywikibot/user-config.py

{'fraction_non_alphanumeric': 0.17938055635216518, 'fraction_numerical': 0.010324060797246917, 'mean_word_length': 3.324240545567266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 53, 'https://': 4, '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': '6757844', 'n_tokens_mistral': 2741, 'n_tokens_neox': 2664, 'n_words': 535}