Skip to content

Commit 6e1c94e

Browse files
Remove powrap checks (python#120)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent e7d2b3f commit 6e1c94e

13 files changed

+178
-75
lines changed

.gitattributes

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
*.po diff=podiff
2-
*.pot diff=podiff
2+
*.po text eol=lf
3+
*.pot diff=podiff
4+
*.pot text eol=lf

.github/workflows/build.yml

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
name: Tests
2-
32
on:
43
workflow_dispatch:
54
push:
65
branches:
7-
- '**'
6+
- "**"
87
pull_request:
98
branches:
10-
- '**'
9+
- "**"
1110

1211
jobs:
1312
checks:
13+
# Using matrix-tool strategy in case we want to add more tools in the future
1414
strategy:
1515
matrix:
1616
tool:
1717
- name: sphinx-lint
1818
package: sphinx-lint
19-
command: 'sphinx-lint --enable default-role --ignore .git'
20-
- name: Line length
21-
command: 'awk ''{if (length($0) > 80 && length(gensub(/[^ ]/, "", "g")) > 1) {print FILENAME ":" FNR, "line too long:", $0; ERRORS+=1}} END {if (ERRORS>0) {exit 1}}'' $CHANGED_PO_FILES'
19+
command: "sphinx-lint --enable default-role --ignore .git"
2220

2321
name: ${{ matrix.tool.name }} (${{ matrix.tool.package }})
2422
runs-on: ubuntu-latest
@@ -30,7 +28,7 @@ jobs:
3028
token: ${{ secrets.GITHUB_TOKEN }}
3129
- uses: actions/setup-python@v4
3230
with:
33-
python-version: '3.11'
31+
python-version: "3.11"
3432
- name: Install ${{ matrix.tool.package }}
3533
run: |
3634
if [ -n "${{ matrix.tool.apt_dependencies }}" ]; then
@@ -57,14 +55,14 @@ jobs:
5755
fi
5856
5957
sphinx:
60-
name: 'Generate docs (sphinx)'
58+
name: "Generate docs (sphinx)"
6159
runs-on: ubuntu-latest
6260
timeout-minutes: 30
6361
steps:
6462
- uses: actions/checkout@v3
6563
- uses: actions/setup-python@v4
6664
with:
67-
python-version: '3.11'
65+
python-version: "3.11"
6866
- name: Prepare environment
6967
run: |
7068
pwd

.github/workflows/gh-pages.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: Build and Deploy to GitHub Pages
2-
32
on:
43
push:
54
branches:
6-
- '3.11'
5+
- "3.11"
76

87
jobs:
98
sphinx-lint:
@@ -15,22 +14,22 @@ jobs:
1514
token: ${{ secrets.GITHUB_TOKEN }}
1615
- uses: actions/setup-python@v4
1716
with:
18-
python-version: '3.11'
17+
python-version: "3.11"
1918
- name: Install sphinx-lint
2019
run: python -m pip install --upgrade sphinx-lint
2120
- name: Run sphinx-lint
22-
run: 'sphinx-lint --enable default-role --ignore .git'
21+
run: "sphinx-lint --enable default-role --ignore .git"
2322

2423
deploy:
25-
name: 'Generate docs and deploy to GitHub Pages'
24+
name: "Generate docs and deploy to GitHub Pages"
2625
runs-on: ubuntu-latest
2726
needs: sphinx-lint
2827
timeout-minutes: 30
2928
steps:
3029
- uses: actions/checkout@v3
3130
- uses: actions/setup-python@v4
3231
with:
33-
python-version: '3.11'
32+
python-version: "3.11"
3433
- name: Prepare environment
3534
run: |
3635
git clone https://github.com/python/cpython.git venv/cpython/
@@ -45,5 +44,5 @@ jobs:
4544
publish_dir: ./venv/cpython/Doc/build/html
4645
publish_branch: gh-pages
4746
allow_empty_commit: true
48-
user_name: 'github-actions[bot]'
49-
user_email: 'github-actions[bot]@users.noreply.github.com'
47+
user_name: "github-actions[bot]"
48+
user_email: "github-actions[bot]@users.noreply.github.com"

.github/workflows/pre-commit-ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: pre-commit-ci
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
branches:
9+
- "**"
10+
11+
jobs:
12+
pre-commit:
13+
name: "Pre-commit checks"
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
id: setup_python
19+
with:
20+
python-version: "3.11"
21+
cache: pip
22+
23+
- name: Install pre-commit
24+
run: pip install --upgrade -r requirements.txt
25+
26+
- name: Cache pre-commit tools
27+
uses: actions/cache@v3
28+
with:
29+
key: pre-commit-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('.pre-commit-config.yaml') }}
30+
path: ~/.cache/pre-commit
31+
32+
- name: Run pre-commit
33+
run: pre-commit run --all-files --show-diff-on-failure
34+
35+
- name: Run pre-commit-ci-lite
36+
uses: pre-commit-ci/lite-action@v1.0.1
37+
if: always()

.github/workflows/update_doc.yml

+38-38
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,47 @@ name: Update Doc
22
on:
33
workflow_dispatch:
44
schedule:
5-
- cron: '0 0 1 * *'
5+
- cron: "0 0 1 * *"
66

77
jobs:
88
create_pr:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v3
13-
14-
- name: Clone CPython Repo
15-
run: git clone https://github.com/python/cpython venv/cpython
16-
17-
- name: Set Up Python 3.11
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: "3.11"
21-
22-
- name: Install dependencies
23-
run: pip install -r requirements.txt && sudo apt install gettext -y
24-
25-
- name: Run merge.py
26-
run: python merge.py ${GITHUB_REF##*/}
27-
28-
- name: Commit changes
29-
run: |
30-
git config --local user.email "python.docs.tr@gmail.com"
31-
git config --local user.name "python-docs-turkish"
32-
git commit -m "Get changes from CPython Doc for ${{ github.ref_name }}"
33-
34-
- name: Create Pull Request
35-
uses: peter-evans/create-pull-request@v4.2.3
36-
with:
37-
token: ${{ secrets.BOT_PAT }}
38-
commit-message: Get changes from CPython Doc for ${{ github.ref_name }}
39-
author: python-docs-turkish <python.docs.tr@gmail.com>
40-
committer: python-docs-turkish <python.docs.tr@gmail.com>
41-
branch: translation-update-${{ github.ref_name }}
42-
delete-branch: true
43-
title: Translation Update ${{ github.ref_name }}
44-
body: There are some changes, don't forget to translate them!
45-
labels: update
46-
reviewers: |
47-
egeakman
48-
ardasak
12+
- uses: actions/checkout@v3
13+
14+
- name: Clone CPython Repo
15+
run: git clone https://github.com/python/cpython venv/cpython
16+
17+
- name: Set Up Python 3.11
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Install dependencies
23+
run: pip install -r requirements.txt && sudo apt install gettext -y
24+
25+
- name: Run merge.py
26+
run: python merge.py ${GITHUB_REF##*/}
27+
28+
- name: Commit changes
29+
run: |
30+
git config --local user.email "python.docs.tr@gmail.com"
31+
git config --local user.name "python-docs-turkish"
32+
git commit -m "Get changes from CPython Doc for ${{ github.ref_name }}"
33+
34+
- name: Create Pull Request
35+
uses: peter-evans/create-pull-request@v4.2.3
36+
with:
37+
token: ${{ secrets.BOT_PAT }}
38+
commit-message: Get changes from CPython Doc for ${{ github.ref_name }}
39+
author: python-docs-turkish <python.docs.tr@gmail.com>
40+
committer: python-docs-turkish <python.docs.tr@gmail.com>
41+
branch: translation-update-${{ github.ref_name }}
42+
delete-branch: true
43+
title: Translation Update ${{ github.ref_name }}
44+
body: There are some changes, don't forget to translate them!
45+
labels: update
46+
reviewers: |
47+
egeakman
48+
ardasak

.github/workflows/wrap_branch.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
name: "Wrap All"
2-
32
on:
43
workflow_dispatch:
54
schedule:
6-
- cron: '0 0 15 * *'
5+
- cron: "0 0 15 * *"
76

8-
jobs:
7+
jobs:
98
wrap:
109
runs-on: ubuntu-latest
1110
steps:
@@ -34,13 +33,13 @@ jobs:
3433
uses: peter-evans/create-pull-request@v4.2.3
3534
with:
3635
token: ${{ secrets.BOT_PAT }}
37-
commit-message: 'Wrap all files on: ${{ github.ref_name }}'
36+
commit-message: "Wrap all files on: ${{ github.ref_name }}"
3837
branch: ${{ github.ref_name }}-wrapped
3938
delete-branch: true
4039
committer: python-docs-turkish <python.docs.tr@gmail.com>
4140
author: python-docs-turkish <python.docs.tr@gmail.com>
42-
title: 'Wrap branch: ${{ github.ref_name }}'
43-
body: 'Wrapped all files on branch: ${{ github.ref_name }}.'
41+
title: "Wrap branch: ${{ github.ref_name }}"
42+
body: "Wrapped all files on branch: ${{ github.ref_name }}."
4443
labels: wrap
4544
reviewers: |
4645
egeakman

.pre-commit-config.yaml

+40-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,44 @@
11
repos:
2-
- repo: local
2+
- repo: local
33
hooks:
4-
- id: lint
5-
name: Run sphinx linting
4+
- id: style-print
5+
name: ""
6+
entry: "style-print 'Please report any issues at: https://github.com/python/python-docs-tr/issues' 'rUBI{y}'"
7+
language: python
8+
additional_dependencies: ["style-print"]
9+
pass_filenames: false
10+
verbose: true
11+
12+
- id: lint
13+
name: Run sphinx-lint on .po files
614
entry: sphinx-lint
715
language: python
8-
additional_dependencies: ['sphinx-lint==0.6.7']
9-
files: \.po$
16+
additional_dependencies: ["sphinx-lint"]
17+
files: \.po$
18+
19+
- repo: https://github.com/pycqa/isort
20+
rev: 5.12.0
21+
hooks:
22+
- id: isort
23+
name: isort (python)
24+
25+
- repo: https://github.com/psf/black
26+
rev: 23.1.0
27+
hooks:
28+
- id: black
29+
name: Run black on Python files
30+
args: ["--line-length=140", "--target-version=py311"]
31+
files: \.py$
32+
33+
- repo: https://github.com/pre-commit/pre-commit-hooks
34+
rev: v4.4.0
35+
hooks:
36+
- id: end-of-file-fixer
37+
- id: trailing-whitespace
38+
39+
- repo: https://github.com/pre-commit/mirrors-prettier
40+
rev: v2.7.1
41+
hooks:
42+
- id: prettier
43+
name: Run prettier on .yml and .yaml files
44+
types: [yaml]

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,4 @@ clean:
169169
rm -rf $(POSPELL_TMP_DIR) locales/$(LANGUAGE)/LC_MESSAGES/
170170
find -name '*.mo' -delete
171171
@echo "Cleaning build directory"
172-
$(MAKE) -C venv/cpython/Doc/ clean
172+
$(MAKE) -C venv/cpython/Doc/ clean

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Bu proje gönüllü çevirmenler ve python-docs-tr ekibi iş birliğinde sürdü
2020
#### Rezervasyon
2121

2222
Çeviri yapmak istediğiniz bir dosyaya rezervasyon oluşturmak için şu adımları izleyin:
23-
23+
2424
1. `Issues > New Issue > Get started` düğmelerini takip ederek rezervasyon formunu açın.
2525
2. foo/bar.po taslağını, çalışmak istediğiniz dosyanın yolu ile değiştirin.
2626
- Örnegin, "library/functions.po üzerinde çalışmak istiyorum".

merge.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
This script is run automatically by the GitHub Actions workflow every first day of the month.
77
"""
88

9+
import argparse
910
import re
1011
import shutil
11-
import argparse
1212
import subprocess
1313
from pathlib import Path
1414
from subprocess import PIPE
15+
1516
from tqdm import tqdm
1617

1718

scripts/format_check.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import collections
2-
import os
31
import argparse
2+
import collections
43
import contextlib
54
import glob
6-
import polib
5+
import os
76
from pprint import pprint
87

8+
import polib
99

1010
parser = argparse.ArgumentParser()
1111
parser.add_argument("subject", nargs="?", default=None, help="Subject to check (file or directory)")

scripts/translate.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import os
22
import re
33
import sys
4+
from argparse import ArgumentParser
5+
from typing import Dict, Tuple
6+
47
import polib
58
from deep_translator import DeeplTranslator, GoogleTranslator
6-
from typing import Dict, Tuple
7-
from argparse import ArgumentParser
89

910
parser = ArgumentParser()
1011
parser.add_argument("filename", help="File to translate")

0 commit comments

Comments
 (0)