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

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

# OSX builds are not yet available
os:
  - linux
  - osx

before_install:
  - if [[ "$PYSETUP_TEST_EXTRAS" == "1" ]]; then sudo apt-get update -qq; fi
  - if [[ "$PYSETUP_TEST_EXTRAS" == "1" ]]; then sudo apt-get install -y liblua5.1-dev; fi

install:
  - if [[ "$SITE_ONLY" == '1' ]]; then export USE_NOSE=1; fi
  - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2==0.8.0; fi
  - pip install six
  - export GITHUB_USER=`echo $TRAVIS_REPO_SLUG | cut -d '/' -f 1`
  - mkdir ~/.pywikibot
  - mkdir ~/.python-eggs
  - chmod 700 ~/.python-eggs

  - touch ~/.pywikibot/user-config.py
  - echo "import os" >> ~/.pywikibot/user-config.py
  - echo "mylang = '$LANGUAGE'" >> ~/.pywikibot/user-config.py
  - echo "family = '$FAMILY'" >> ~/.pywikibot/user-config.py

  - echo "password_file = os.path.expanduser('~/.pywikibot/passwordfile')" >> ~/.pywikibot/user-config.py
  - touch ~/.pywikibot/passwordfile

  - 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

  - if [[ "$GITHUB_USER" == "wikimedia" ]]; then
      PYWIKIBOT2_USERNAME="Pywikibot-test" ;
    else
      export PYWIKIBOT2_TEST_WRITE_FAIL=1 ;
    fi

  - if [[ -n "$USER_PASSWORD" && -n "$PYWIKIBOT2_USERNAME" ]]; then
      echo "usernames['$FAMILY']['$LANGUAGE'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
      echo "usernames['wikipedia']['en'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
      echo "usernames['wikipedia']['test'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
      echo "usernames['wikidata']['test'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
      echo "usernames['commons']['commons'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
      echo "('$PYWIKIBOT2_USERNAME', '$USER_PASSWORD')" > ~/.pywikibot/passwordfile ;
    fi

  - if [[ "$EXTERNALS_HTTPLIB2" == "1" ]]; then
      (cd externals/httplib2 && python setup.py install) ;
    else
      rm -rf externals/httplib2 ;
    fi

  - python -c "import setuptools; print(setuptools.__version__)"<commit_msg>Use generate-user-files in test builds<commit_after># See tests/README.rst for instructions for using travis with developer builds.
language: python

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

# OSX builds are not yet available
os:
  - linux
  - osx

before_install:
  - if [[ "$PYSETUP_TEST_EXTRAS" == "1" ]]; then sudo apt-get update -qq; fi
  - if [[ "$PYSETUP_TEST_EXTRAS" == "1" ]]; then sudo apt-get install -y liblua5.1-dev; fi

install:

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

  # httplib2 is needed to run generate_user_files
  - if [[ "$EXTERNALS_HTTPLIB2" == "1" ]]; then
      (cd externals/httplib2 && python setup.py install) ;
    else
      rm -rf externals/httplib2 ;
      pip install httplib2 ;
    fi


  - if [[ "$GITHUB_USER" == "wikimedia" ]]; then
      PYWIKIBOT2_USERNAME="Pywikibot-test" ;
    else
      export PYWIKIBOT2_TEST_WRITE_FAIL=1 ;
    fi

  - mkdir ~/.pywikibot
  - 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
      echo "usernames['wikipedia']['en'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
      echo "usernames['wikipedia']['test'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
      echo "usernames['wikidata']['test'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
      echo "usernames['commons']['commons'] = '$PYWIKIBOT2_USERNAME'" >> ~/.pywikibot/user-config.py ;
      echo "('$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

  - 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

  - python -c "import setuptools; print(setuptools.__version__)"
{'fraction_non_alphanumeric': 0.17937024972855592, 'fraction_numerical': 0.018675352877307275, 'mean_word_length': 3.3248826291079814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 47, 'https://': 0, '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': '591428', 'n_tokens_mistral': 1869, 'n_tokens_neox': 1823, 'n_words': 346}