Skip to content

Remove powrap checks #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 50 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
038f6ff
Remove line-length from checks, new pre-commit checks instead
egeakman Feb 9, 2023
a1cbac2
Cross platform gettext installation, some wiki
egeakman Feb 10, 2023
f0136d7
revert pre-commit ci's commit
egeakman Feb 10, 2023
f44091f
try pre-commit on multiple platforms
egeakman Feb 10, 2023
e64d07a
try pre-commit on multiple platforms
egeakman Feb 10, 2023
1eafaaf
try pre-commit on multiple platforms
egeakman Feb 10, 2023
80c4cc7
try pre-commit on multiple platforms
egeakman Feb 10, 2023
49e0c50
try pre-commit on multiple platforms
egeakman Feb 10, 2023
b20ee69
uyku önemli
egeakman Feb 10, 2023
ed3390b
try pre-commit on multiple platforms
egeakman Feb 10, 2023
4133dfc
try pre-commit on multiple platforms
egeakman Feb 10, 2023
744a4a2
try pre-commit on multiple platforms
egeakman Feb 10, 2023
cd9b83f
try pre-commit on multiple platforms
egeakman Feb 10, 2023
cd3c398
let's try this
egeakman Feb 11, 2023
d63633c
try pre-commit on multiple platforms
egeakman Feb 11, 2023
7c51999
Merge branch '3.11' into line-length
egeakman Feb 11, 2023
1aaec6b
update
egeakman Feb 11, 2023
889c277
Merge branch 'line-length' of https://github.com/python/python-docs-t…
egeakman Feb 11, 2023
2e5ed72
macos
egeakman Feb 11, 2023
e92562e
trigger
egeakman Feb 11, 2023
800879d
force
egeakman Feb 11, 2023
77230f3
Merge branch '3.11' into line-length
egeakman Feb 11, 2023
0c2409d
switch to ubuntu
egeakman Feb 11, 2023
45ffeff
Merge branch 'line-length' of https://github.com/python/python-docs-t…
egeakman Feb 11, 2023
b4bbd5b
this seems better
egeakman Feb 11, 2023
6b4f752
update
egeakman Feb 11, 2023
08b99e0
update
egeakman Feb 11, 2023
989bebd
How did I miss that
egeakman Feb 11, 2023
ba0ea41
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 11, 2023
5542660
style-print notice
egeakman Feb 11, 2023
0361365
test on different OSs
egeakman Feb 11, 2023
0e72cd6
Everything looks fine, let's test it.
egeakman Feb 11, 2023
6cb2121
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 11, 2023
b551bbc
Update gettext.md
egeakman Feb 11, 2023
2b2d37e
Update README.md
egeakman Feb 11, 2023
69f8756
update
egeakman Feb 17, 2023
31c6beb
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 17, 2023
50dde37
Let's see how this'll do
egeakman Feb 19, 2023
a51316e
update
egeakman Feb 19, 2023
9ce2eea
test
egeakman Feb 19, 2023
4a01035
revert to 9ce2eea626b429680b72feb4e2fb24e9b04f25ce and make changes
egeakman Feb 21, 2023
f7d22a4
test
egeakman Feb 22, 2023
59d46d2
test
egeakman Feb 22, 2023
52c8bf3
Will be good to go after tests
egeakman Feb 22, 2023
8470e94
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 22, 2023
add8291
Merge branch '3.11' into line-length
egeakman Feb 22, 2023
272c577
ok
egeakman Feb 22, 2023
6bb9143
Update README.md
egeakman Mar 1, 2023
30ddb75
remove powrap from pre-commit since it is very problematic
egeakman Mar 1, 2023
d534571
Merge branch '3.11' into line-length
egeakman Mar 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.po diff=podiff
*.pot diff=podiff
*.po text eol=lf
*.pot diff=podiff
*.pot text eol=lf
16 changes: 7 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
name: Tests

on:
workflow_dispatch:
push:
branches:
- '**'
- "**"
pull_request:
branches:
- '**'
- "**"

jobs:
checks:
# Using matrix-tool strategy in case we want to add more tools in the future
strategy:
matrix:
tool:
- name: sphinx-lint
package: sphinx-lint
command: 'sphinx-lint --enable default-role --ignore .git'
- name: Line length
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'
command: "sphinx-lint --enable default-role --ignore .git"

name: ${{ matrix.tool.name }} (${{ matrix.tool.package }})
runs-on: ubuntu-latest
Expand All @@ -30,7 +28,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: "3.11"
- name: Install ${{ matrix.tool.package }}
run: |
if [ -n "${{ matrix.tool.apt_dependencies }}" ]; then
Expand All @@ -57,14 +55,14 @@ jobs:
fi

sphinx:
name: 'Generate docs (sphinx)'
name: "Generate docs (sphinx)"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: "3.11"
- name: Prepare environment
run: |
pwd
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Build and Deploy to GitHub Pages

on:
push:
branches:
- '3.11'
- "3.11"

jobs:
sphinx-lint:
Expand All @@ -15,22 +14,22 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: "3.11"
- name: Install sphinx-lint
run: python -m pip install --upgrade sphinx-lint
- name: Run sphinx-lint
run: 'sphinx-lint --enable default-role --ignore .git'
run: "sphinx-lint --enable default-role --ignore .git"

deploy:
name: 'Generate docs and deploy to GitHub Pages'
name: "Generate docs and deploy to GitHub Pages"
runs-on: ubuntu-latest
needs: sphinx-lint
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: "3.11"
- name: Prepare environment
run: |
git clone https://github.com/python/cpython.git venv/cpython/
Expand All @@ -45,5 +44,5 @@ jobs:
publish_dir: ./venv/cpython/Doc/build/html
publish_branch: gh-pages
allow_empty_commit: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
37 changes: 37 additions & 0 deletions .github/workflows/pre-commit-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: pre-commit-ci
on:
workflow_dispatch:
push:
branches:
- "**"
pull_request:
branches:
- "**"

jobs:
pre-commit:
name: "Pre-commit checks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup_python
with:
python-version: "3.11"
cache: pip

- name: Install pre-commit
run: pip install --upgrade -r requirements.txt

- name: Cache pre-commit tools
uses: actions/cache@v3
with:
key: pre-commit-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('.pre-commit-config.yaml') }}
path: ~/.cache/pre-commit

- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure

- name: Run pre-commit-ci-lite
uses: pre-commit-ci/lite-action@v1.0.1
if: always()
76 changes: 38 additions & 38 deletions .github/workflows/update_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,47 @@ name: Update Doc
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *'
- cron: "0 0 1 * *"

jobs:
create_pr:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Clone CPython Repo
run: git clone https://github.com/python/cpython venv/cpython
- name: Set Up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: pip install -r requirements.txt && sudo apt install gettext -y

- name: Run merge.py
run: python merge.py ${GITHUB_REF##*/}

- name: Commit changes
run: |
git config --local user.email "python.docs.tr@gmail.com"
git config --local user.name "python-docs-turkish"
git commit -m "Get changes from CPython Doc for ${{ github.ref_name }}"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4.2.3
with:
token: ${{ secrets.BOT_PAT }}
commit-message: Get changes from CPython Doc for ${{ github.ref_name }}
author: python-docs-turkish <python.docs.tr@gmail.com>
committer: python-docs-turkish <python.docs.tr@gmail.com>
branch: translation-update-${{ github.ref_name }}
delete-branch: true
title: Translation Update ${{ github.ref_name }}
body: There are some changes, don't forget to translate them!
labels: update
reviewers: |
egeakman
ardasak
- uses: actions/checkout@v3

- name: Clone CPython Repo
run: git clone https://github.com/python/cpython venv/cpython

- name: Set Up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
run: pip install -r requirements.txt && sudo apt install gettext -y

- name: Run merge.py
run: python merge.py ${GITHUB_REF##*/}

- name: Commit changes
run: |
git config --local user.email "python.docs.tr@gmail.com"
git config --local user.name "python-docs-turkish"
git commit -m "Get changes from CPython Doc for ${{ github.ref_name }}"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4.2.3
with:
token: ${{ secrets.BOT_PAT }}
commit-message: Get changes from CPython Doc for ${{ github.ref_name }}
author: python-docs-turkish <python.docs.tr@gmail.com>
committer: python-docs-turkish <python.docs.tr@gmail.com>
branch: translation-update-${{ github.ref_name }}
delete-branch: true
title: Translation Update ${{ github.ref_name }}
body: There are some changes, don't forget to translate them!
labels: update
reviewers: |
egeakman
ardasak
11 changes: 5 additions & 6 deletions .github/workflows/wrap_branch.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: "Wrap All"

on:
workflow_dispatch:
schedule:
- cron: '0 0 15 * *'
- cron: "0 0 15 * *"

jobs:
jobs:
wrap:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -34,13 +33,13 @@ jobs:
uses: peter-evans/create-pull-request@v4.2.3
with:
token: ${{ secrets.BOT_PAT }}
commit-message: 'Wrap all files on: ${{ github.ref_name }}'
commit-message: "Wrap all files on: ${{ github.ref_name }}"
branch: ${{ github.ref_name }}-wrapped
delete-branch: true
committer: python-docs-turkish <python.docs.tr@gmail.com>
author: python-docs-turkish <python.docs.tr@gmail.com>
title: 'Wrap branch: ${{ github.ref_name }}'
body: 'Wrapped all files on branch: ${{ github.ref_name }}.'
title: "Wrap branch: ${{ github.ref_name }}"
body: "Wrapped all files on branch: ${{ github.ref_name }}."
labels: wrap
reviewers: |
egeakman
Expand Down
45 changes: 40 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@
repos:
- repo: local
- repo: local
hooks:
- id: lint
name: Run sphinx linting
- id: style-print
name: ""
entry: "style-print 'Please report any issues at: https://github.com/python/python-docs-tr/issues' 'rUBI{y}'"
language: python
additional_dependencies: ["style-print"]
pass_filenames: false
verbose: true

- id: lint
name: Run sphinx-lint on .po files
entry: sphinx-lint
language: python
additional_dependencies: ['sphinx-lint==0.6.7']
files: \.po$
additional_dependencies: ["sphinx-lint"]
files: \.po$

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)

- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
name: Run black on Python files
args: ["--line-length=140", "--target-version=py311"]
files: \.py$

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
name: Run prettier on .yml and .yaml files
types: [yaml]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ clean:
rm -rf $(POSPELL_TMP_DIR) locales/$(LANGUAGE)/LC_MESSAGES/
find -name '*.mo' -delete
@echo "Cleaning build directory"
$(MAKE) -C venv/cpython/Doc/ clean
$(MAKE) -C venv/cpython/Doc/ clean
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Bu proje gönüllü çevirmenler ve python-docs-tr ekibi iş birliğinde sürdü
#### Rezervasyon

Çeviri yapmak istediğiniz bir dosyaya rezervasyon oluşturmak için şu adımları izleyin:

1. `Issues > New Issue > Get started` düğmelerini takip ederek rezervasyon formunu açın.
2. foo/bar.po taslağını, çalışmak istediğiniz dosyanın yolu ile değiştirin.
- Örnegin, "library/functions.po üzerinde çalışmak istiyorum".
Expand Down
3 changes: 2 additions & 1 deletion merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
This script is run automatically by the GitHub Actions workflow every first day of the month.
"""

import argparse
import re
import shutil
import argparse
import subprocess
from pathlib import Path
from subprocess import PIPE

from tqdm import tqdm


Expand Down
6 changes: 3 additions & 3 deletions scripts/format_check.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import collections
import os
import argparse
import collections
import contextlib
import glob
import polib
import os
from pprint import pprint

import polib

parser = argparse.ArgumentParser()
parser.add_argument("subject", nargs="?", default=None, help="Subject to check (file or directory)")
Expand Down
5 changes: 3 additions & 2 deletions scripts/translate.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os
import re
import sys
from argparse import ArgumentParser
from typing import Dict, Tuple

import polib
from deep_translator import DeeplTranslator, GoogleTranslator
from typing import Dict, Tuple
from argparse import ArgumentParser

parser = ArgumentParser()
parser.add_argument("filename", help="File to translate")
Expand Down
Loading