Skip to content

Commit 6e7a5e8

Browse files
lysnikolaoupre-commit-ci-lite[bot]gmargaritis
authored
Enable Read-The-Docs // Add pre-commit // Fix any issues with existing translations (python#536)
* Enable Read-The-Docs and fix any issues with existing translations * Do not check cpython dir for changed files in CI * Update pre-commit version * [pre-commit.ci lite] apply automatic fixes * Use commit hashes everywhere Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: George Margaritis <[email protected]>
1 parent ffeccd2 commit 6e7a5e8

File tree

174 files changed

+1451
-2342
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+1451
-2342
lines changed

.github/workflows/main.yaml

-69
This file was deleted.

.github/workflows/precommit.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Run pre-commit
2+
3+
on:
4+
push:
5+
branches:
6+
- 3.*
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
test:
12+
name: Run pre-commit.ci
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
16+
with:
17+
submodules: "true"
18+
fetch-depth: 2
19+
- name: Setup python
20+
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
21+
with:
22+
python-version: "3.x"
23+
- name: Install system deps
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y hunspell hunspell-el gettext language-pack-el locales-all
27+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
28+
- uses: pre-commit-ci/lite-action@9d882e7a565f7008d4faf128f27d1cb6503d4ebf # v1.0.2
29+
if: always()

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,9 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161+
162+
locales/
163+
.potodo/
164+
165+
# VS Code
166+
.vscode/

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "cpython"]
2+
path = cpython
3+
url = https://github.com/python/cpython

.pre-commit-config.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # v4.6.0
4+
hooks:
5+
- id: file-contents-sorter
6+
files: "dictionaries/main.txt"
7+
args: ["--unique"]
8+
- id: trailing-whitespace
9+
- id: check-yaml
10+
- id: end-of-file-fixer
11+
12+
- repo: https://git.afpy.org/AFPy/powrap
13+
rev: df2a0a54804a6146cc9fbffb77464d4b5fe24f41 # v1.0.1
14+
hooks:
15+
- id: powrap
16+
17+
- repo: https://git.afpy.org/AFPy/pospell
18+
rev: 8b753bde26fe612ba397a4b4aafa7a0560402805 # v1.3
19+
hooks:
20+
- id: pospell
21+
args:
22+
- "--language=el_GR"
23+
- "--personal-dict=dictionaries/main.txt"
24+
25+
- repo: https://github.com/sphinx-contrib/sphinx-lint
26+
rev: ce6d7aeab24d60b6119dbad180540bf3c9ff31da # v0.9.1
27+
hooks:
28+
- id: sphinx-lint

.readthedocs.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# .readthedocs.yml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3"
12+
13+
commands:
14+
- python -m pip install -r requirements.txt
15+
- make
16+
- mkdir -p _readthedocs/html/
17+
- cp -r cpython/Doc/build/html/* _readthedocs/html/
18+
19+
python:
20+
install:
21+
- requirements: requirements.txt
22+
23+
submodules:
24+
include: all

Makefile

+9-13
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
# .po files.
2424
CPYTHON_CURRENT_COMMIT := 9cbde7c6ce6f7b93301a37f03dfa0c0d45e00a39
2525

26-
CPYTHON_PATH := /home/tpetkos/github.com/python/cpython/
26+
CPYTHON_PATH := ./cpython
2727

28-
LANGUAGE := gr
28+
LANGUAGE := el
29+
TRANSLATION_BRANCH := main
2930
BRANCH := 3.12
3031

3132
EXCLUDED := whatsnew/ c-api/
@@ -36,7 +37,7 @@ UPSTREAM := https://github.com/python/cpython
3637

3738
PYTHON := $(shell which python3)
3839
MODE := html
39-
POSPELL_TMP_DIR := .pospell/
40+
POSPELL_TMP_DIR := .pospell
4041
JOBS := auto
4142

4243
# Detect OS
@@ -58,7 +59,6 @@ endif
5859

5960
.PHONY: all
6061
all: ensure_prerequisites
61-
git -C $(CPYTHON_PATH) checkout $(CPYTHON_CURRENT_COMMIT)
6262
mkdir -p locales/$(LANGUAGE)/LC_MESSAGES/
6363
$(CP_CMD) -u --parents *.po */*.po locales/$(LANGUAGE)/LC_MESSAGES/
6464
$(MAKE) -C $(CPYTHON_PATH)/Doc/ \
@@ -70,7 +70,6 @@ all: ensure_prerequisites
7070
-D latex_elements.inputenc= \
7171
-D latex_elements.fontenc=' \
7272
$(MODE)
73-
git -C $(CPYTHON_PATH) checkout -
7473
@echo "Build success, open file://$(abspath $(CPYTHON_PATH))/Doc/build/html/index.html or run 'make serve' to see them."
7574

7675

@@ -83,10 +82,7 @@ ensure_prerequisites:
8382
@if ! [ -d $(CPYTHON_PATH) ]; then \
8483
echo "Building the translation requires a cpython clone."; \
8584
echo "Please provide the path to a clone using the CPYTHON_PATH variable."; \
86-
echo "(Currently CPYTHON_PATH is $(CPYTHON_PATH)."; \
87-
echo "So you may want to run:"; \
88-
echo ""; \
89-
echo " git clone $(UPSTREAM) $(CPYTHON_PATH)"; \
85+
echo "(Currently CPYTHON_PATH is $(CPYTHON_PATH).)"; \
9086
exit 1; \
9187
fi
9288
@if [ -n "$$(git -C $(CPYTHON_PATH) status --porcelain)" ]; then \
@@ -95,16 +91,16 @@ ensure_prerequisites:
9591
exit 1; \
9692
fi
9793
@if ! (blurb help >/dev/null 2>&1 && sphinx-build --version >/dev/null 2>&1); then \
98-
git -C $(CPYTHON_PATH) checkout $(BRANCH); \
9994
echo "You're missing dependencies, please enable a venv and install:"; \
10095
echo ""; \
101-
echo " python -m pip install -r requirements.txt -r $(CPYTHON_PATH)/Doc/requirements.txt"; \
96+
echo " python -m pip install -r requirements.txt"; \
10297
exit 1; \
10398
fi
10499

100+
105101
.PHONY: serve
106102
serve:
107-
$(MAKE) -C $(CPYTHON_PATH)/Doc/ serve
103+
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('cpython/Doc/build/html/index.html'))"
108104

109105

110106
.PHONY: progress
@@ -123,7 +119,7 @@ wrap: ensure_prerequisites
123119
@echo "Verify wrapping"
124120
powrap --check --quiet *.po **/*.po
125121

126-
SRCS = $(shell git diff --name-only $(BRANCH) | grep '.po$$')
122+
SRCS = $(shell git diff --name-only $(TRANSLATION_BRANCH) | grep '.po$$')
127123
# foo/bar.po => $(POSPELL_TMP_DIR)/foo/bar.po.out
128124
DESTS = $(addprefix $(POSPELL_TMP_DIR)/,$(addsuffix .out,$(SRCS)))
129125

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
ΣΗΜΕΙΩΣΗ ΓΙΑ ΤΗΝ ΑΔΕΙΑ ΧΡΗΣΗΣ ΤΩΝ ΜΕΤΑΦΡΑΣΕΩΝ
77

88
Ο οδηγός χρήσης της Python συντηρείται από ένα παγκόσμιο δίκτυο
9-
εθελοντών.
9+
εθελοντών.
1010

1111
Αυτό το έργο πρότζεκτ αποτελεί μια συνεργασία ανάμεσα σε εθελοντές μεταφραστές και
1212
της ομάδας python-docs-gr. Το παρόν έγγραφο καθορίζει τα δικαιώματα και τις ευθύνες

TRANSLATORS

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Georgios Zisopoulos
22
Lysandros Nikolaou
33
Theofanis Petkos
44
Panagiotis Skias
5-
Dimitrios Papadopoulos
5+
Dimitrios Papadopoulos

c-api/buffer.po

+14-33
Original file line numberDiff line numberDiff line change
@@ -382,48 +382,34 @@ msgid ""
382382
"flags below it."
383383
msgstr ""
384384

385-
#: c-api/buffer.rst:306
386-
#: c-api/buffer.rst:331
385+
#: c-api/buffer.rst:306 c-api/buffer.rst:331
387386
msgid "Request"
388387
msgstr ""
389388

390-
#: c-api/buffer.rst:306
391-
#: c-api/buffer.rst:331
389+
#: c-api/buffer.rst:306 c-api/buffer.rst:331
392390
msgid "shape"
393391
msgstr ""
394392

395-
#: c-api/buffer.rst:306
396-
#: c-api/buffer.rst:331
393+
#: c-api/buffer.rst:306 c-api/buffer.rst:331
397394
msgid "strides"
398395
msgstr ""
399396

400-
#: c-api/buffer.rst:306
401-
#: c-api/buffer.rst:331
397+
#: c-api/buffer.rst:306 c-api/buffer.rst:331
402398
msgid "suboffsets"
403399
msgstr ""
404400

405-
#: c-api/buffer.rst:286
406-
#: c-api/buffer.rst:308
407-
#: c-api/buffer.rst:312
408-
#: c-api/buffer.rst:333
409-
#: c-api/buffer.rst:337
410-
#: c-api/buffer.rst:341
411-
#: c-api/buffer.rst:345
412-
#: c-api/buffer.rst:347
401+
#: c-api/buffer.rst:286 c-api/buffer.rst:308 c-api/buffer.rst:312
402+
#: c-api/buffer.rst:333 c-api/buffer.rst:337 c-api/buffer.rst:341
403+
#: c-api/buffer.rst:345 c-api/buffer.rst:347
413404
msgid "yes"
414405
msgstr ""
415406

416-
#: c-api/buffer.rst:333
417-
#: c-api/buffer.rst:335
407+
#: c-api/buffer.rst:333 c-api/buffer.rst:335
418408
msgid "if needed"
419409
msgstr ""
420410

421-
#: c-api/buffer.rst:288
422-
#: c-api/buffer.rst:308
423-
#: c-api/buffer.rst:312
424-
#: c-api/buffer.rst:337
425-
#: c-api/buffer.rst:341
426-
#: c-api/buffer.rst:345
411+
#: c-api/buffer.rst:288 c-api/buffer.rst:308 c-api/buffer.rst:312
412+
#: c-api/buffer.rst:337 c-api/buffer.rst:341 c-api/buffer.rst:345
427413
#: c-api/buffer.rst:347
428414
msgid "NULL"
429415
msgstr ""
@@ -443,8 +429,7 @@ msgstr ""
443429
msgid "contig"
444430
msgstr ""
445431

446-
#: c-api/buffer.rst:314
447-
#: c-api/buffer.rst:347
432+
#: c-api/buffer.rst:314 c-api/buffer.rst:347
448433
msgid "C"
449434
msgstr ""
450435

@@ -485,19 +470,15 @@ msgstr ""
485470
msgid "format"
486471
msgstr ""
487472

488-
#: c-api/buffer.rst:335
489-
#: c-api/buffer.rst:339
490-
#: c-api/buffer.rst:343
473+
#: c-api/buffer.rst:335 c-api/buffer.rst:339 c-api/buffer.rst:343
491474
msgid "U"
492475
msgstr ""
493476

494-
#: c-api/buffer.rst:337
495-
#: c-api/buffer.rst:345
477+
#: c-api/buffer.rst:337 c-api/buffer.rst:345
496478
msgid "0"
497479
msgstr ""
498480

499-
#: c-api/buffer.rst:339
500-
#: c-api/buffer.rst:347
481+
#: c-api/buffer.rst:339 c-api/buffer.rst:347
501482
msgid "1 or 0"
502483
msgstr ""
503484

c-api/bytes.po

+1-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ msgstr ""
100100
msgid "``%c``"
101101
msgstr ""
102102

103-
#: c-api/bytes.rst:72
104-
#: c-api/bytes.rst:93
103+
#: c-api/bytes.rst:72 c-api/bytes.rst:93
105104
msgid "int"
106105
msgstr ""
107106

0 commit comments

Comments
 (0)