8000 Add main workflow (#19) · python/python-docs-gr@1d9ed30 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1d9ed30

Browse files
thepetklysnikolaou
andauthored
Add main workflow (#19)
* Translate about.po as test * Update requirements.txt * Update check_spelling * Add about.txt dictionary * add main workflow * Rewrap about.po * fix workflow step * Update requirements.txt Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> * Update .github/workflows/main.yaml Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> * Update about.po Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> * Update about.po Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> * Update about.po Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> * Update workflow * Update about.po --------- Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
1 parent d59ca7d commit 1d9ed30

File tree

5 files changed

+102
-12
lines changed

5 files changed

+102
-12
lines changed

.github/workflows/main.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- 3.*
7+
- main
8+
pull_request:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
test:
15+
name: Test
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
19+
with:
20+
submodules: "true"
21+
fetch-depth: 2
22+
- name: Setup python
23+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
24+
with:
25+
python-version: "3.12"
26+
cache: "pip"
27+
- name: Configure dpkg/apt
28+
uses: abbbi/github-actions-tune@81fb919e588c20b7ab52b2cac097d2efd765c714 # v1
29+
- name: Disable triggers from postgresql-common
30+
run: sudo sed -i '/postgresql-common/d' /var/lib/dpkg/triggers/File
31+
- name: Install system deps
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y hunspell hunspell-el gettext language-pack-el locales-all
35+
- name: Install python deps
36+
run: |
37+
python -m pip install -r requirements.txt
38+
- name: List packages and versions
39+
run: |
40+
pip list
41+
pospell --version
42+
powrap --version
43+
- name: Get list with updated .po archives (PR-only)
44+
if: github.event_name == 'pull_request'
45+
id: changed-po-files
46+
uses: tj-actions/changed-files@2d756ea4c53f7f6b397767d8723b3a10a9f35bf2 # v44
47+
with:
48+
files: |
49+
**/*.po
50+
- name: Create list with .po files to check
51+
id: po-files-to-check
52+
env:
53+
PO_FILES_TO_CHECK: ${{ steps.changed-po-files.conclusion == 'skipped' && '**/*.po' || steps.changed-po-files.outputs.all_changed_files }}
54+
run: |
55+
echo "po_files_to_check=$PO_FILES_TO_CHECK" >> $GITHUB_OUTPUT
56+
echo "any_po_files_to_check=`test -n \"$PO_FILES_TO_CHECK\" && echo true || echo false`" >> $GITHUB_OUTPUT
57+
- name: Show outputs of the previous steps for debuging purposes
58+
env:
59+
CHANGED_PO_FILES: ${{ toJson(steps.changed-po-files) }}
60+
PO_FILES_TO_CHECK: ${{ toJson(steps.po-files-to-check) }}
61+
run: |
62+
echo "steps.changed-po-files=$PO_FILES_TO_CHECK"
63+
echo "steps.po-files-to-change.$CHANGED_PO_FILES"
64+
- name: Powrap
65+
if: steps.po-files-to-check.outputs.any_po_files_to_check == 'true'
66+
run: powrap --check --quiet ${{ steps.po-files-to-check.outputs.po_files_to_check }}
67+
- name: Pospell
68+
if: steps.po-files-to-check.outputs.any_po_files_to_check == 'true'
69+
run: python scripts/check_spelling.py ${{ steps.po-files-to-check.outputs.po_files_to_check }}

about.po

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,25 @@ msgstr ""
99
"Project-Id-Version: Python 3.12\n"
1010
"Report-Msgid-Bugs-To: \n"
1111
"POT-Creation-Date: 2024-03-14 12:51+0000\n"
12-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14-
"Language-Team: LANGUAGE <LL@li.org>\n"
12+
"PO-Revision-Date: 2024-03-31 19:50+0000\n"
13+
"Last-Translator: Theofanis Petkos <thepetk@gmail.com>\n"
14+
"Language-Team: PyGreece <pygreece@gmail.com>\n"
1515
"MIME-Version: 1.0\n"
1616
"Content-Type: text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818

1919
#: about.rst:3
2020
msgid "About these documents"
21-
msgstr ""
21+
msgstr "Σχετικά με τα έγγραφα"
2222

2323
#: about.rst:6
2424
msgid ""
2525
"These documents are generated from `reStructuredText`_ sources by `Sphinx`_, "
2626
"a document processor specifically written for the Python documentation."
2727
msgstr ""
28+
"Αυτά τα έγραφα έχουν δημιουργηθεί από τα `reStructuredText`_ sources του "
29+
"`Sphinx`_, έναν επεξεργαστή εγγράφων που έχει δημιουργηθεί ειδικά για τα "
30+
"έγγραφα της Python."
2831

2932
#: about.rst:15
3033
msgid ""
@@ -33,42 +36,57 @@ msgid ""
3336
"look at the :ref:`reporting-bugs` page for information on how to do so. New "
3437
"volunteers are always welcome!"
3538
msgstr ""
39+
"Η ανάπτυξη των εγγράφων και των εργαλείων τους είναι εξ' ολοκλήρου "
40+
"εθελοντική προσπάθεια, όπως και η ίδια η Python. Εάν θέλετε να συνεισφέρετε, "
41+
"ρίξτε μια ματιά στη σελίδα :ref:`reporting-bugs` για πληροφορίες σχετικές με "
42+
"το πως να το κάνετε. Καινούριοι εθελοντές είναι πάντα ευπρόσδεκτοι!"
3643

3744
#: about.rst:20
3845
msgid "Many thanks go to:"
39-
msgstr ""
46+
msgstr "Πολλές ευχαριστίες πηγαίνουν στους:"
4047

4148
#: about.rst:22
4249
msgid ""
4350
"Fred L. Drake, Jr., the creator of the original Python documentation toolset "
4451
"and writer of much of the content;"
4552
msgstr ""
53+
"Fred L. Drake, Jr., τον δημιουργό των αρχικών εργαλείων των εγγράφων της "
54+
"Python και συντάκτη αρκετού περιεχομένου'"
4655

4756
#: about.rst:24
4857
msgid ""
4958
"the `Docutils <https://docutils.sourceforge.io/>`_ project for creating "
5059
"reStructuredText and the Docutils suite;"
5160
msgstr ""
61+
"το `Docutils <https://docutils.sourceforge.io/>`_ πρότζεκτ για την "
62+
"δημιουργία των εφαρμογών reStructuredText και Docutils'"
5263

5364
#: about.rst:26
5465
msgid ""
5566
"Fredrik Lundh for his Alternative Python Reference project from which Sphinx "
5667
"got many good ideas."
5768
msgstr ""
69+
"Fredrik Lundh για το δικό του Alternative Python Reference πρότζεκτ από το "
70+
"οποίο το Sphinx πήρε πολύ καλές ιδέες."
5871

5972
#: about.rst:31
6073
msgid "Contributors to the Python Documentation"
61-
msgstr ""
74+
msgstr "Συντελεστές στα έγγραφα της Python"
6275

6376
#: about.rst:33
6477
msgid ""
6578
"Many people have contributed to the Python language, the Python standard "
6679
"library, and the Python documentation. See :source:`Misc/ACKS` in the "
6780
"Python source distribution for a partial list of contributors."
6881
msgstr ""
82+
"Πολλοί άνθρωποι έχουν συνεισφέρει στη γλώσσα Python, την βιβλιοθήκη της "
83+
"Python, και τα έγγραφα της Python. Δείτε :source:`Misc/ACKS` στις πηγές "
84+
"διανομής της Python για μια λίστα των συντελεστών."
6985

7086
#: about.rst:37
7187
msgid ""
7288
"It is only with the input and contributions of the Python community that "
7389
"Python has such wonderful documentation -- Thank You!"
7490
msgstr ""
91+
"Μόνο με τη συμβολή και τις συνεισφορές της κοινότητας της Python, η Python "
92+
"έχει τέτοια υπέροχα έγγραφα -- Σας ευχαριστούμε!"

dictionaries/about.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
L

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
poutils==0.13.0
1+
poutils==0.15.4
2+
pospell==1.3

scripts/check_spelling.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@ def check_spell(po_files=None):
3434
)
3535

3636
# Write merged dictionary file
37-
with tempfile.NamedTemporaryFile(suffix="_merged_dict.txt") as output_filename:
38-
with open(output_filename, "w") as f:
39-
for e in entries:
40-
f.write(f"{e}\n")
37+
with tempfile.NamedTemporaryFile(suffix="_merged_dict.txt") as named_tmp_file:
38+
for e in entries:
39+
named_tmp_file.write(f"{e}\n".encode())
40+
named_tmp_file.flush()
41+
named_tmp_file.seek(0)
4142

4243
# Run pospell either against all files or the file given on the command line
4344
if not po_files:
4445
po_files = Path(".").glob("*/*.po")
4546

4647
detected_errors = pospell.spell_check(
47-
po_files, personal_dict=output_filename, language="el_EL"
48+
po_files, personal_dict=named_tmp_file.name, language="el_GR"
4849
)
4950
return detected_errors
5051

0 commit comments

Comments
 (0)
0