Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1287986?usp=email )
Change subject: yaml: update yaml files fix yamlfix and add yamlfix to
pre-commit
......................................................................
yaml: update yaml files fix yamlfix and add yamlfix to pre-commit
Change-Id: I5d6b42e82dc615af6edfd07f9849c61870a39623
---
M .codecov.yml
M .github/workflows/doctest.yml
M .github/workflows/graalpy_tests.yml
M .github/workflows/login_tests-ci.yml
M .github/workflows/oauth_tests-ci.yml
M .github/workflows/pre-commit.yml
M .github/workflows/pywikibot-ci.yml
M .github/workflows/windows_tests.yml
M .pre-commit-config.yaml
M pyproject.toml
10 files changed, 59 insertions(+), 44 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
jenkins-bot: Verified
diff --git a/.codecov.yml b/.codecov.yml
index 42e91eb..6ea8293 100644
--- a/.codecov.yml
+++ b/.codecov.yml
@@ -32,11 +32,8 @@
component_management:
individual_components:
- component_id: Framework
- paths:
- - pywikibot/**
+ paths: [pywikibot/**]
- component_id: Tests
- paths:
- - tests/**
+ paths: [tests/**]
- component_id: Scripts
- paths:
- - scripts/**
+ paths: [scripts/**]
diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml
index 0987132..e4c1a4d 100644
--- a/.github/workflows/doctest.yml
+++ b/.github/workflows/doctest.yml
@@ -22,7 +22,7 @@
fail-fast: false
matrix:
python-version: [pypy3.11, '3.10', '3.11', '3.12', '3.13', '3.14']
- os: ['windows-latest', 'macOS-latest', 'ubuntu-latest']
+ os: [windows-latest, macOS-latest, ubuntu-latest]
include:
- python-version: 3.15-dev
exclude: # Test already made on Jenkins
diff --git a/.github/workflows/graalpy_tests.yml
b/.github/workflows/graalpy_tests.yml
index 94207d6..d6095a8 100644
--- a/.github/workflows/graalpy_tests.yml
+++ b/.github/workflows/graalpy_tests.yml
@@ -24,8 +24,8 @@
matrix:
python-version: [graalpy-24.1, graalpy-25.0]
site: ['wikipedia:test']
- os: ['macOS-latest', 'ubuntu-latest']
- experimental: [True]
+ os: [macOS-latest, ubuntu-latest]
+ experimental: [true]
steps:
- name: Checkout Repository
uses: actions/checkout@v6
@@ -76,7 +76,7 @@
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Check on failure
if: steps.ci_test.outcome == 'failure'
- run: |
+ run: |-
# Print public IP of runner
curl -s https://api.ipify.org
exit 1
diff --git a/.github/workflows/login_tests-ci.yml
b/.github/workflows/login_tests-ci.yml
index 36dcdd9..1ab83e8 100644
--- a/.github/workflows/login_tests-ci.yml
+++ b/.github/workflows/login_tests-ci.yml
@@ -32,7 +32,6 @@
]
warmup-delay: PT1M
minimum-interval: PT5M
-
run_tests:
name: Run Login/Logout Tests
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
@@ -42,7 +41,16 @@
fail-fast: false
max-parallel: 1
matrix:
- python-version: [pypy3.9, pypy3.11, '3.9', '3.10', '3.11', '3.12',
'3.13', '3.14', 3.15-dev]
+ python-version:
+ - pypy3.9
+ - pypy3.11
+ - '3.9'
+ - '3.10'
+ - '3.11'
+ - '3.12'
+ - '3.13'
+ - '3.14'
+ - 3.15-dev
site: ['wikipedia:en', 'wikisource:zh', 'wikipedia:test']
include:
- python-version: '3.9'
diff --git a/.github/workflows/oauth_tests-ci.yml
b/.github/workflows/oauth_tests-ci.yml
index d0297e8..ff797eb 100644
--- a/.github/workflows/oauth_tests-ci.yml
+++ b/.github/workflows/oauth_tests-ci.yml
@@ -22,7 +22,16 @@
strategy:
fail-fast: false
matrix:
- python-version: [pypy3.9, pypy3.11, '3.9', '3.10', '3.11', '3.12',
'3.13', '3.14', 3.15-dev]
+ python-version:
+ - pypy3.9
+ - pypy3.11
+ - '3.9'
+ - '3.10'
+ - '3.11'
+ - '3.12'
+ - '3.13'
+ - '3.14'
+ - 3.15-dev
family: [wikipedia]
code: [test]
domain: [test.wikipedia.org]
@@ -77,7 +86,6 @@
if: ${{ matrix.family == 'wpbeta' }}
run: |
python pwb.py generate_family_file
http://${{matrix.code}}.wikipedia.beta.wmcloud.org/ wpbeta y
-
- name: Generate user files
run: |
python -Werror::UserWarning -m pwb generate_user_files \
@@ -101,7 +109,6 @@
CS: ${{ steps.split.outputs._1 }}
AK: ${{ steps.split.outputs._2 }}
AS: ${{ steps.split.outputs._3 }}
-
- name: Oauth tests with unittest
timeout-minutes: 8
env:
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
index ab51f86..6235209 100644
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -3,9 +3,7 @@
on:
push:
- branches:
- - master
- - stable
+ branches: [master, stable]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -23,13 +21,8 @@
strategy:
fail-fast: false
matrix:
- python-version:
- - '3.10'
- - '3.13'
- - '3.14'
- os:
- - windows-latest
- - macOS-latest
+ python-version: ['3.10', '3.13', '3.14']
+ os: [windows-latest, macOS-latest]
include:
- python-version: '3.13'
os: ubuntu-latest
diff --git a/.github/workflows/pywikibot-ci.yml
b/.github/workflows/pywikibot-ci.yml
index 1198be0..b69816b 100644
--- a/.github/workflows/pywikibot-ci.yml
+++ b/.github/workflows/pywikibot-ci.yml
@@ -24,7 +24,16 @@
strategy:
fail-fast: false
matrix:
- python-version: [pypy3.9, pypy3.10, pypy3.11, '3.9', '3.10', '3.11',
'3.12', '3.13', '3.14']
+ python-version:
+ - pypy3.9
+ - pypy3.10
+ - pypy3.11
+ - '3.9'
+ - '3.10'
+ - '3.11'
+ - '3.12'
+ - '3.13'
+ - '3.14'
site: ['wikipedia:en', 'wikisource:zh']
include:
- python-version: '3.9'
@@ -146,7 +155,7 @@
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Check on failure
if: steps.ci_test.outcome == 'failure'
- run: |
+ run: |-
# Print public IP of runner
curl -s https://api.ipify.org
exit 1
diff --git a/.github/workflows/windows_tests.yml
b/.github/workflows/windows_tests.yml
index feb8652..1858a45 100644
--- a/.github/workflows/windows_tests.yml
+++ b/.github/workflows/windows_tests.yml
@@ -84,7 +84,7 @@
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Check on failure
if: steps.ci_test.outcome == 'failure'
- run: |
+ run: |-
# Print public IP of runner
curl -s https://api.ipify.org
exit 1
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a56f9e4..6f52916 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,7 +1,5 @@
---
-default_install_hook_types:
- - commit-msg
- - pre-commit
+default_install_hook_types: [commit-msg, pre-commit]
repos:
- repo: meta
@@ -16,8 +14,7 @@
rev: v6.0.0
hooks:
- id: check-added-large-files
- args:
- - --maxkb=200
+ args: [--maxkb=200]
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
@@ -62,19 +59,21 @@
files: .+\.py$
language: python
require_serial: true
+ - repo: https://github.com/lyz-code/yamlfix/
+ rev: 1.19.1
+ hooks:
+ - id: yamlfix
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.13
hooks:
- id: ruff-check
alias: ruff
- args:
- - --fix
+ args: [--fix]
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
- args:
- - --py39-plus
+ args: [--py39-plus]
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.3
hooks:
@@ -91,8 +90,7 @@
hooks:
- id: isort
name: isort
- args:
- - -a from __future__ import annotations
+ args: [-a from __future__ import annotations]
exclude: ^(pwb|pywikibot/families/__init__)\.py$
- id: isort
name: isort (skip future annotations)
@@ -109,8 +107,8 @@
args:
- --doctests
- --config=tox.ini
+ # Due to incompatibilities between packages the order matters.
additional_dependencies:
- # Due to incompatibilities between packages the order matters.
- flake8-bugbear>=25.11.29
- flake8-print>=5.0.0
- pep8-naming>=0.15.1
@@ -118,15 +116,13 @@
rev: v2.1.0
hooks:
- id: mypy
- args:
- - --config-file=pyproject.toml
- - --follow-imports=silent
+ args: [--config-file=pyproject.toml, --follow-imports=silent]
additional_dependencies:
- types-PyMySQL
- types-requests
# Test for files which already passed in past.
# They should be also used in conftest.py to exclude them from
non-voting mypy test.
- files: |
+ files: |-
(?x)^pywikibot/(
(__metadata__|backports|config|cosmetic_changes|daemonize|diff|echo|exceptions|fixes|logging|plural|time|titletranslate)|
(comms|data|families|specialbots)/__init__|
diff --git a/pyproject.toml b/pyproject.toml
index 4883c3b..288f7cc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -208,3 +208,8 @@
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
+
+[tool.yamlfix]
+section_whitelines = 1
+line_length = 100
+preserve_quotes = true
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1287986?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: I5d6b42e82dc615af6edfd07f9849c61870a39623
Gerrit-Change-Number: 1287986
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]