-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I15774e6cd593d123d565babf40abab19dbcb72ab
- Loading branch information
Showing
140 changed files
with
3,144 additions
and
2,029 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Lint test | ||
# Run Pywikibot lint tests with a variety of Python versions | ||
|
||
on: | ||
push: | ||
branches: [ master, stable ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYWIKIBOT_TEST_RUNNING: 1 | ||
PYWIKIBOT_NO_USER_CONFIG: 2 | ||
|
||
jobs: | ||
build: | ||
runs-on: "ubuntu-latest" | ||
continue-on-error: ${{ matrix.experimental || false }} | ||
timeout-minutes: 100 | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
python-version: [ "pypy3.7", "pypy3.10", "3.10", "3.11", "3.12", "3.13.0-alpha - 3.13.0", "3.14-dev" ] | ||
deps: [ flake8, hacking ] | ||
exclude: | ||
- deps: hacking | ||
python-version: "pypy3.7" | ||
- deps: hacking | ||
python-version: "3.14-dev" | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
if: "!endsWith(matrix.python-version, '-dev')" | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# 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 }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip --version | ||
pip install .[${{matrix.deps}}] | ||
- name: Flake8 tests | ||
id: ci_test | ||
timeout-minutes: 10 | ||
run: | | ||
python --version | ||
flake8 --version | ||
flake8 --color always --doctests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ jobs: | |
|
||
strategy: | ||
fail-fast: false | ||
max-parallel: 2 | ||
|
||
matrix: | ||
python-version: [ "3.7" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Windows Tests | ||
# Successor for Appveyor Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYWIKIBOT_TEST_RUNNING: 1 | ||
PYWIKIBOT_USERNAME: Pywikibot-test | ||
|
||
jobs: | ||
build: | ||
runs-on: "windows-latest" | ||
continue-on-error: ${{ matrix.experimental || false }} | ||
timeout-minutes: 100 | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
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" ] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: ${{ matrix.python-arch }} | ||
|
||
- name: Install dependencies | ||
shell: powershell | ||
run: | | ||
git submodule update --init | ||
python --version | ||
python -c "import struct; print('PYTHON_ARCH:', struct.calcsize('P') << 3)" | ||
python -m pip install --upgrade pip | ||
pip --version | ||
if ('${{ matrix.python-version }}' -eq '3.7.1') { | ||
pip install -U setuptools; | ||
pip install "urllib3<2.0"; | ||
} | ||
if ('${{ matrix.python-version }}' -ge '3.12') { | ||
pip install -U setuptools; | ||
} | ||
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['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 | ||
echo "usernames['commons']['commons'] = '${{ env.PYWIKIBOT_USERNAME }}'" >> user-config.py | ||
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 | ||
id: ci_test | ||
continue-on-error: true | ||
timeout-minutes: 90 | ||
run: | | ||
python pwb.py version | ||
coverage run -m unittest discover -vv -p \"*_tests.py\"; | ||
- name: Show coverage statistics | ||
run: | | ||
coverage report | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Check on failure | ||
if: steps.ci_test.outcome == 'failure' | ||
run: exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.