Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 68f0974

Browse files
authored
Merge pull request python#54 from python/fix-CI
Fix CI
2 parents 47b4aef + ed3affb commit 68f0974

File tree

8 files changed

+82
-46
lines changed

8 files changed

+82
-46
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,26 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- name: Check out ${{ github.repository }}
35-
uses: actions/checkout@v2
35+
uses: actions/checkout@v3
3636
with:
3737
persist-credentials: false
3838
- run: echo ${{ inputs.was-called }}
3939
- if: ${{ inputs.was-called }} == 'yes'
4040
run: |
4141
git pull --rebase
4242
- name: Check out CPython
43-
uses: actions/checkout@v2
43+
uses: actions/checkout@v3
4444
with:
4545
repository: python/cpython
4646
persist-credentials: false
4747
ref: ${{ env.CPYTHON_BRANCH }}
4848
path: cpython
4949
- name: Set up Python 3.9
50-
uses: actions/setup-python@v2
50+
uses: actions/setup-python@v4
5151
with:
5252
python-version: '3.9'
53+
cache: 'pip'
54+
cache-dependency-path: '**/requirements*.txt'
5355
- name: Install dependencies
5456
run: |
5557
sudo apt update -y && sudo apt install gettext -y
@@ -87,7 +89,7 @@ jobs:
8789
path: cpython/Doc/build/html
8890
- name: Upload artifact - logs
8991
if: always()
90-
uses: actions/upload-artifact@v2
92+
uses: actions/upload-artifact@v3
9193
with:
9294
name: build-logs
9395
path: logs/

.github/workflows/compendium.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Check out ${{ github.repository }}
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818
with:
1919
persist-credentials: false
2020
- if: github.event_name == 'workflow_call'
2121
run: |
2222
git pull --rebase
23-
- name: Set up Python 3.9
24-
uses: actions/setup-python@v2
23+
- name: Set up Python 3.10
24+
uses: actions/setup-python@v4
2525
with:
26-
python-version: '3.9'
26+
python-version: '3.10'
2727
- name: Install dependencies
2828
run: |
2929
sudo apt update -y && sudo apt install gettext -y
@@ -33,7 +33,7 @@ jobs:
3333
run: |
3434
pocompendium --correct compendium.po *.po **/*.po
3535
- name: Upload artifact
36-
uses: actions/upload-artifact@v2
36+
uses: actions/upload-artifact@v3
3737
with:
3838
name: compendium
3939
path: compendium.po

.github/workflows/update.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,24 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Check out ${{ github.repository }}
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
2929
- name: Check out CPython
30-
uses: actions/checkout@v2
30+
uses: actions/checkout@v3
3131
with:
3232
repository: python/cpython
3333
persist-credentials: false
3434
ref: ${{ env.CPYTHON_BRANCH }}
3535
path: cpython
3636
- name: Set up Python 3.9
37-
uses: actions/setup-python@v2
37+
uses: actions/setup-python@v4
3838
with:
3939
python-version: '3.9'
40+
cache: 'pip'
41+
cache-dependency-path: '**/requirements*.txt'
4042
- name: Install Transifex CLI
4143
run: |
4244
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
43-
mv tx /usr/local/bin/tx
45+
working-directory: /usr/local/bin
4446
- name: Install dependencies
4547
run: |
4648
sudo apt update -y && sudo apt install gettext -y
@@ -56,7 +58,9 @@ jobs:
5658
run: |
5759
powrap --modified
5860
- name: Commit and push changes
59-
if: github.repository == 'python/python-docs-pt-br'
61+
if: |
62+
github.repository == 'python/python-docs-pt-br' &&
63+
! github.event_name == 'pull_request'
6064
run: |
6165
git config user.name github-actions
6266
git config user.email [email protected]
@@ -85,15 +89,19 @@ jobs:
8589
run:
8690
echo "CURRENT_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
8791
- name: Check out source branch (${{ env.CURRENT_BRANCH }})
88-
uses: actions/checkout@v2
92+
uses: actions/checkout@v3
8993
with:
9094
path: ${{ env.CURRENT_BRANCH }}
9195
persist-credentials: false
9296
- name: Check out target branch (${{ matrix.branch }})
93-
uses: actions/checkout@v2
97+
uses: actions/checkout@v3
9498
with:
9599
ref: ${{ matrix.branch }}
96100
path: ${{ matrix.branch }}
101+
- name: Set up Python 3.10
102+
uses: actions/setup-python@v4
103+
with:
104+
python-version: '3.10'
97105
- name: Install dependencies
98106
run: |
99107
sudo apt update -y && sudo apt install gettext -y
@@ -110,7 +118,9 @@ jobs:
110118
run: |
111119
powrap --modified -C ${{ matrix.branch }}
112120
- name: Commit and push changes
113-
if: github.repository == 'python/python-docs-pt-br'
121+
if: |
122+
github.repository == 'python/python-docs-pt-br' &&
123+
! github.event_name == 'pull_request'
114124
run: |
115125
cd ${{ matrix.branch }}
116126
git config user.name github-actions
@@ -123,7 +133,7 @@ jobs:
123133
# Call the build workflow after updating
124134
name: call
125135
needs: [update]
126-
uses: python/python-docs-pt-br/.github/workflows/build.yml@3.10
136+
uses: ./.github/workflows/build.yml
127137
with:
128138
was-called: yes
129139
secrets:
@@ -134,4 +144,4 @@ jobs:
134144
# Call the compendium workflow after updating
135145
name: call
136146
needs: [update]
137-
uses: python/python-docs-pt-br/.github/workflows/compendium.yml@3.10
147+
uses: ./.github/workflows/compendium.yml

library/2to3.po

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# Sheila Gomes <[email protected]>, 2021
99
# Claudio Rogerio Carvalho Filho <[email protected]>, 2021
1010
# Octavio von Sydow <[email protected]>, 2021
11+
# Loyanne Cristine <[email protected]>, 2022
1112
#
1213
#, fuzzy
1314
msgid ""
@@ -16,7 +17,7 @@ msgstr ""
1617
"Report-Msgid-Bugs-To: \n"
1718
"POT-Creation-Date: 2022-06-16 06:28+0000\n"
1819
"PO-Revision-Date: 2021-06-28 00:54+0000\n"
19-
"Last-Translator: Octavio von Sydow <ocvs00@gmail.com>, 2021\n"
20+
"Last-Translator: Loyanne Cristine <loyanne.cristine@gmail.com>, 2022\n"
2021
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/python-doc/"
2122
"teams/5390/pt_BR/)\n"
2223
"MIME-Version: 1.0\n"
@@ -572,6 +573,8 @@ msgid ""
572573
"Renames definitions of methods called :meth:`__nonzero__` to :meth:`~object."
573574
"__bool__`."
574575
msgstr ""
576+
"Renomeia as definições de métodos chamados :meth:`__nonzero__` para :meth:"
577+
"`~object.__bool__`."
575578

576579
#: ../../library/2to3.rst:341
577580
msgid "Converts octal literals into the new syntax."
@@ -788,6 +791,15 @@ msgid ""
788791
"library in Python 3.13. Consider third-party alternatives such as `LibCST`_ "
789792
"or `parso`_."
790793
msgstr ""
794+
"Python 3.9 mudou para um analisador GASE (veja :pep:`617`) enquanto lib2to3 "
795+
"está usando um analisador LL(1) menos flexível. Python 3.10 inclui uma nova "
796+
"sintaxe de linguagem não analisável pelo analisador LL(1) da lib2to3 (veja :"
797+
"pep:`634`). O módulo ``lib2to3``foi marcado como pendente para "
798+
"descontinuação na versão Python 3.9 (aumentando :exc:"
799+
"`PendingDeprecationWarning` na importação) e totalmente obsoleto na versão "
800+
"Python 3.11 (aumentando :exc:`DeprecationWarning`). Ele será removido da "
801+
"biblioteca padrão na versão Python 3.13. Considere alternativas de terceiros "
802+
"como `LibCST`_ ou `parso`_."
791803

792804
#: ../../library/2to3.rst:480
793805
msgid ""

library/_thread.po

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Marcos Jurach <[email protected]>, 2021
1111
# Fabio Aragao <[email protected]>, 2021
1212
# Rafael Fontenelle <[email protected]>, 2021
13+
# Loyanne Cristine <[email protected]>, 2022
1314
#
1415
#, fuzzy
1516
msgid ""
@@ -18,7 +19,7 @@ msgstr ""
1819
"Report-Msgid-Bugs-To: \n"
1920
"POT-Creation-Date: 2022-06-16 06:28+0000\n"
2021
"PO-Revision-Date: 2021-06-28 00:54+0000\n"
21-
"Last-Translator: Rafael Fontenelle <rffontenelle@gmail.com>, 2021\n"
22+
"Last-Translator: Loyanne Cristine <loyanne.cristine@gmail.com>, 2022\n"
2223
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/python-doc/"
2324
"teams/5390/pt_BR/)\n"
2425
"MIME-Version: 1.0\n"
@@ -114,29 +115,39 @@ msgid ""
114115
"use this function to interrupt the main thread, though there is no guarantee "
115116
"that the interruption will happen immediately."
116117
msgstr ""
118+
"Simule o efeito de um sinal chegando na thread principal. Uma thread pode "
119+
"usar esta função para interromper a thread principal, embora não haja "
120+
"garantia de que a interrupção ocorrerá imediatamente."
117121

118122
#: ../../library/_thread.rst:70
119123
msgid ""
120124
"If given, *signum* is the number of the signal to simulate. If *signum* is "
121125
"not given, :data:`signal.SIGINT` is simulated."
122126
msgstr ""
127+
"Se fornecido, *signum* é o número do sinal a ser simulado. Se *signum* não "
128+
"for fornecido, :data:`signal.SIGINT` será simulado."
123129

124130
#: ../../library/_thread.rst:73
125131
msgid ""
126132
"If the given signal isn't handled by Python (it was set to :data:`signal."
127133
"SIG_DFL` or :data:`signal.SIG_IGN`), this function does nothing."
128134
msgstr ""
135+
"Se o sinal fornecido não for tratado por Python (foi definido como :data:"
136+
"`signal.SIG_DFL` ou :data:`signal.SIG_IGN`), esta função não faz nada."
129137

130138
#: ../../library/_thread.rst:77
131139
msgid "The *signum* argument is added to customize the signal number."
132-
msgstr ""
140+
msgstr "O argumento *signum* é adicionado para personalizar o sinal de número."
133141

134142
#: ../../library/_thread.rst:81
135143
msgid ""
136144
"This does not emit the corresponding signal but schedules a call to the "
137145
"associated handler (if it exists). If you want to truly emit the signal, "
138146
"use :func:`signal.raise_signal`."
139147
msgstr ""
148+
"Isso não emite o sinal correspondente, mas agenda uma chamada para o "
149+
"tratador associado (se existir). Se você quer realmente emitir o sinal, use :"
150+
"func:`signal.raise_signal`."
140151

141152
#: ../../library/_thread.rst:88
142153
msgid ""

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
sphinx-intl
1+
git+https://github.com/sphinx-doc/sphinx-intl@6b3913fea5a8c9b819818b9b28b6d0d0b6f022b3
22
powrap
33
pomerge

scripts/build.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ LANGUAGE=${1:-pt_BR}
99

1010
ROOTDIR="$(dirname $0)/.."
1111

12-
cd ${ROOTDIR}
12+
cd "${ROOTDIR}"
1313

14-
test -f cpython/Doc/conf.py || ( echo Unable to find proper CPython Doc folder; exit 1; )
15-
16-
pofiles=$(find . -maxdepth 2 -name '*.po' | sort -u)
14+
if ! test -f cpython/Doc/conf.py; then
15+
echo Unable to find proper CPython Doc folder
16+
exit 1
17+
fi
1718

18-
for po in ${pofiles}; do
19+
for po in $(find . -type f -name '*.po' | sort | sed 's|^\./||'); do
1920
install -Dm644 ${po} "cpython/Doc/locales/${LANGUAGE}/LC_MESSAGES/${po}"
2021
done
2122

22-
sphinx-build -b html -d build/doctrees -q --keep-going -jauto -D locale_dirs=locales -D language=pt_BR -D gettext_compact=0 -D latex_engine=xelatex -D latex_elements.inputenc= -D latex_elements.fontenc= -W cpython/Doc cpython/Doc/build/html
23+
sphinx-build -b html -d build/doctrees -a --keep-going -jauto -D locale_dirs=locales -D language=pt_BR -D gettext_compact=0 -D latex_engine=xelatex -D latex_elements.inputenc= -D latex_elements.fontenc= -W cpython/Doc cpython/Doc/build/html
2324

2425
if [ -z "$GITHUB_ACTIONS" ]; then
25-
echo "See file:/$(realpath ${ROOTDIR})/cpython/Doc/build/html/index.html"
26-
echo "or serve it in http://localhost:8080 by running:"
27-
echo "python3 cpython/Tools/scripts/serve.py cpython/Doc/build/html"
26+
echo 'See the built documentation by running the following command:'
27+
echo 'python3 -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('cpython/Doc/build/html/index.html'))""'
2828
fi

scripts/update.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ set -e
77
# Allow language being passed as 1st argument, defaults to pt_BR
88
LANGUAGE=${1:-pt_BR}
99

10-
ROOTDIR=$(dirname $0)/..
10+
ROOTDIR=$(realpath "$(dirname $0)/..")
1111

1212
cd ${ROOTDIR}
1313

14-
test -f cpython/Doc/conf.py || ( echo Unable to find proper CPython Doc folder; exit 1; )
14+
if ! test -f cpython/Doc/conf.py; then
15+
echo Unable to find proper CPython Doc folder
16+
exit 1
17+
fi
1518

1619
# Create POT Files
1720
cd cpython/Doc
@@ -20,15 +23,13 @@ sphinx-build -E -b gettext -D gettext_compact=0 -d build/.doctrees . locales/pot
2023
# Update CPython's .tx/config
2124
cd locales
2225
sphinx-intl create-txconfig
23-
sphinx-intl update-txconfig-resources -p pot -d . --transifex-project-name python-newest
24-
25-
# Update the translation project's .tx/config
26-
cd ../../.. # back to $ROOTDIR
27-
mkdir -p .tx
28-
sed cpython/Doc/locales/.tx/config \
29-
-e '/^source_file/d' \
30-
-e 's|<lang>/LC_MESSAGES/||' \
31-
-e "s|^file_filter|trans.${LANGUAGE}|" \
32-
> .tx/config
33-
34-
tx pull --languages ${LANGUAGE} --translations --use-git-timestamps --parallel
26+
sphinx-intl update-txconfig-resources -p pot -d . --transifex-organization-name python-doc --transifex-project-name python-newest
27+
28+
# Pull translations into cpython/Doc/locales/LANGUAGE/LC_MESSAGES/
29+
tx pull -l ${LANGUAGE} -t --use-git-timestamps -f
30+
31+
# Finally, move downloaded translation files to the language's repository
32+
cd "${LANGUAGE}/LC_MESSAGES/"
33+
for po in $(find . -type f -name '*.po' | sort | sed 's|^\./||'); do
34+
install -Dm644 ${po} "${ROOTDIR}/${po}"
35+
done

0 commit comments

Comments
 (0)