Xqt has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1050709?usp=email )

Change subject: [tests] Move Pywikibot tests from Appveyor to Github action
......................................................................

[tests] Move Pywikibot tests from Appveyor to Github action

Solely Python 3.7.0 tests are tested on Appveyor because
they aren't avaliable at GitHub

Bug: T368192
Change-Id: If84db61a00aa2f57b0898b38d4afe69870206246
---
M .appveyor.yml
M .github/workflows/windows_tests.yml
2 files changed, 12 insertions(+), 48 deletions(-)

Approvals:
  Xqt: Verified; Looks good to me, approved




diff --git a/.appveyor.yml b/.appveyor.yml
index 32f9c65..8598385 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -22,32 +22,12 @@
       PYTHON_VERSION: "3.7.0"
       PYTHON_ARCH: "32"

-
-    # AppVeyor pre-installs these versions onto build machines
-
-    - PYTHON: "C:\\Python37-x64"
-      PYTHON_VERSION: "3.7.x"
+    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
+      PYTHON: "C:\\Python37"
+      PYTHON_VERSION: "3.7.0"
       PYTHON_ARCH: "64"

-    - PYTHON: "C:\\Python38"
-      PYTHON_VERSION: "3.8.x"
-      PYTHON_ARCH: "32"
-
-    - PYTHON: "C:\\Python39-x64"
-      PYTHON_VERSION: "3.9.x"
-      PYTHON_ARCH: "64"
-
-    - PYTHON: "C:\\Python310"
-      PYTHON_VERSION: "3.10.x"
-      PYTHON_ARCH: "32"
-
-    - PYTHON: "C:\\Python311-x64"
-      PYTHON_VERSION: "3.11.x"
-      PYTHON_ARCH: "64"
-
-    - PYTHON: "C:\\Python312"
-      PYTHON_VERSION: "3.12.x"
-      PYTHON_ARCH: "32"
+    # Other versions are tested with GutHub actions

 matrix:
   fast_finish: false
@@ -66,9 +46,10 @@
   - 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
-  - if [%PYTHON_VERSION%]==[3.12.x] pip install -U setuptools
+  # other requirements
   - pip install -r requirements.txt
   - pip install -r dev-requirements.txt
   - pip install wikitextparser
@@ -76,9 +57,6 @@
 build: off

 test_script:
-  - chcp 65001
-  - set PYTHONIOENCODING=utf8
-
   - "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;')"
diff --git a/.github/workflows/windows_tests.yml 
b/.github/workflows/windows_tests.yml
index 9c2fea2..12a560b 100644
--- a/.github/workflows/windows_tests.yml
+++ b/.github/workflows/windows_tests.yml
@@ -3,8 +3,6 @@

 on:
   push:
-    branches: [ master, stable ]
-  pull_request:
     branches: [ master ]

 concurrency:
@@ -17,7 +15,7 @@

 jobs:
   build:
-    runs-on: ${{ matrix.os || 'windows-latest' }}
+    runs-on: "windows-latest"
     continue-on-error: ${{ matrix.experimental || false }}
     timeout-minutes: 100

@@ -26,7 +24,7 @@
       max-parallel: 10

       matrix:
-        python-version: [ "3.7.0", "3.7", "3.8", "3.9", "3.10", "3.11", 
"3.12", "3.13.0-alpha - 3.13.0" ]
+        python-version: [ "3.7.1", "3.7", "3.8", "3.9", "3.10", "3.11", 
"3.12", "3.13.0-alpha - 3.13.0" ]
         python-arch: [ x64, x86 ]
         site: [ "wikipedia:en" ]
         experimental: [ true ]
@@ -39,15 +37,6 @@

     - name: Set up Python ${{ matrix.python-version }}
       uses: actions/setup-python@v5
-      if: "!endsWith(matrix.python-version, '-dev')"
-      with:
-        python-version: ${{ matrix.python-version }}
-        architecture: ${{ matrix.python-arch }}
-
-    # use deadsnakes/action for development releases
-    - name: Set up development Python ${{ matrix.python-version }}
-      uses: deadsnakes/[email protected]
-      if: "endsWith(matrix.python-version, '-dev')"
       with:
         python-version: ${{ matrix.python-version }}
         architecture: ${{ matrix.python-arch }}
@@ -59,17 +48,13 @@
         python -c "import struct; print('PYTHON_ARCH:', struct.calcsize('P') 
<< 3)"
         python -m pip install --upgrade pip
         pip --version
-        if [ ${{matrix.python-version}} == '3.7.0' ]; then pip install 
"urllib3<2.0"; fi
-        if [ ${{matrix.python-version}} == '3.7.0' ]; then pip install -U 
setuptools; fi
-        if [ ${{matrix.python-version}} >= '3.12' ]; then pip install -U 
setuptools; fi
-        if [ -f dev-requirements.txt ]; then pip install -r 
dev-requirements.txt; fi
-        if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+        pip install -r dev-requirements.txt
+        pip install -r requirements.txt
         pip install wikitextparser

     - name: Generate user files
       run: |
         python -Werror::UserWarning -m pwb generate_user_files 
-site:${{matrix.site}} -user:${{ env.PYWIKIBOT_USERNAME }} -v -debug;
-        echo "usernames['wikipedia']['en'] = '${{ env.PYWIKIBOT_USERNAME }}'" 
>> user-config.py
         echo "usernames['wikisource']['zh'] = '${{ env.PYWIKIBOT_USERNAME }}'" 
>> user-config.py
         echo "usernames['wikipedia']['test'] = '${{ env.PYWIKIBOT_USERNAME 
}}'" >> user-config.py
         echo "usernames['wikidata']['test'] = '${{ env.PYWIKIBOT_USERNAME }}'" 
>> user-config.py
@@ -77,12 +62,13 @@
         echo "usernames['meta']['meta'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> 
user-config.py
         echo "noisysleep = float('inf')" >> user-config.py
         echo "maximum_GET_length = 5000" >> user-config.py
+        echo "transliteration_target = None"  >> user-config.py
         echo "console_encoding = 'utf8'" >> user-config.py
         echo "import os" >> user-config.py
         echo "password_file = os.path.expanduser('passwordfile')" >> 
user-config.py
         echo "('${{ env.PYWIKIBOT_USERNAME }}', '${{ secrets.PYWIKIBOT_USERPWD 
}}')" > passwordfile

-    - name: Test with unittest or pytest
+    - name: Test with unittest
       id: ci_test
       continue-on-error: true
       timeout-minutes: 90

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1050709?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: If84db61a00aa2f57b0898b38d4afe69870206246
Gerrit-Change-Number: 1050709
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to