wikimedia/pywikibot

View on GitHub
.appveyor.yml

Summary

Maintainability
Test Coverage
image: Visual Studio 2022
clone_depth: 50
skip_tags: true
version: 9.3.{build}
environment:

  PYWIKIBOT_DIR: "%appdata%\\Pywikibot"
  PYWIKIBOT_USER_CONFIG: "%appdata%\\Pywikibot\\user-config.py"
  PYWIKIBOT_PASSWD_FILE: "%appdata%\\Pywikibot\\passwordfile"

  PYSETUP_TEST_EXTRAS: "1"
  PYWIKIBOT_TEST_GUI: "1"
  PYWIKIBOT_TEST_RUNNING: "1"

  matrix:

    # Test the lowest supported release
    # Python 3.7.0 is provided by VS 2013

    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
      PYTHON: "C:\\Python37"
      PYTHON_VERSION: "3.7.0"
      PYTHON_ARCH: "32"

    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
      PYTHON: "C:\\Python37"
      PYTHON_VERSION: "3.7.0"
      PYTHON_ARCH: "64"

    # Other versions are tested with GutHub actions

matrix:
  fast_finish: false

init:
  - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
  - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"

install:
  # ignore SSL error for old image
  - if [%PYTHON_VERSION%]==[3.7.0] set GIT_SSL_NO_VERIFY=true
  - git submodule update --init
  # Download the AppVeyor Python build accessories into subdirectory .\appveyor
  - mkdir appveyor
  - python --version
  - python -c "import struct; print('PYTHON_ARCH:', struct.calcsize('P') << 3)"
  - python -m pip install --upgrade pip
  - pip --version
  # required for Python 3.7.0
  - if [%PYTHON_VERSION%]==[3.7.0] pip install "urllib3<2.0"
  - if [%PYTHON_VERSION%]==[3.7.0] pip install -U setuptools
  # other requirements
  - pip install -r requirements.txt
  - pip install -r dev-requirements.txt

build: off

test_script:
  - "mkdir %PYWIKIBOT_DIR%"
  - "python -Werror::UserWarning -m pwb generate_user_files -dir:%PYWIKIBOT_DIR% -family:wikipedia -lang:en -v -debug -user:%PYWIKIBOT_USERNAME%"
  - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'maximum_GET_length = 5000; transliteration_target = None;')"
  - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'noisysleep = float(''inf'');')"
  - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''wikipedia''][''test''] = ''{0}'';' -f $env:PYWIKIBOT_USERNAME)"
  - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''wikidata''][''test''] = ''{0}'';' -f $env:PYWIKIBOT_USERNAME)"
  - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''commons''][''commons''] = ''{0}'';' -f $env:PYWIKIBOT_USERNAME)"
  - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''meta''][''meta''] = ''{0}'';' -f $env:PYWIKIBOT_USERNAME)"
  - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'usernames[''wikisource''][''zh''] = ''{0}'';' -f $env:PYWIKIBOT_USERNAME)"
  - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_PASSWD_FILE, ('(''{0}'', ''{1}'')\n' -f $env:PYWIKIBOT_USERNAME, $env:USER_PASSWORD))"
  - ps: "[IO.File]::AppendAllText($env:PYWIKIBOT_USER_CONFIG, 'password_file = ''{0}'';' -f $env:PYWIKIBOT_PASSWD_FILE.replace('\\', '\\\\'))"

  - "%CMD_IN_ENV% coverage run -m unittest discover -vv -p \"*_tests.py\""