Skip to content

Commit 9cefcfa

Browse files
authored
Merge branch '3.9' into extending-newtypes
2 parents 0164ef9 + b4ab6e1 commit 9cefcfa

File tree

164 files changed

+51969
-7269
lines changed

Some content is hidden

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

164 files changed

+51969
-7269
lines changed

.github/pr-title-checker-config.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "pospell",
5+
"pattern": [
6+
{
7+
"regexp": "^(.*):(\\d+):(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"message": 3
11+
}
12+
]
13+
}
14+
]
15+
}

.github/workflows/pr-title-cheker.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 47 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,58 @@ on:
1111
- '*.*'
1212

1313
jobs:
14-
pospell:
15-
name: 'Orthographe'
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v2
19-
- name: Install pospell
20-
run: |
21-
sudo apt-get update
22-
sudo apt-get install -y hunspell hunspell-fr-comprehensive
23-
sudo python3 -m pip install pospell
24-
- name: Run pospell
25-
run: pospell -p dict -l fr_FR *.po */*.po
26-
27-
powrap:
28-
name: 'Ensure wrapping consistency'
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@v2
32-
- name: Install powrap
33-
run: |
34-
sudo apt-get update
35-
sudo apt-get install gettext
36-
sudo python3 -m pip install powrap
37-
- name: Run powrap
38-
run: powrap --check --quiet *.po */*.po
14+
checks:
15+
strategy:
16+
matrix:
17+
tool:
18+
- name: Orthographe
19+
package: pospell
20+
apt_dependencies: hunspell hunspell-fr-comprehensive
21+
command: 'pospell -p dict -l fr_FR $CHANGED_PO_FILES'
22+
- name: Longueur des lignes
23+
package: powrap
24+
apt_dependencies: gettext
25+
command: 'powrap --check --quiet --diff $CHANGED_PO_FILES'
26+
- name: Grammaire
27+
package: padpo
28+
command: 'padpo -i $CHANGED_PO_FILES 2>&1 | grep -v -Ff padpo.ignore'
3929

40-
padpo:
41-
name: 'Grammaire'
30+
name: ${{ matrix.tool.name }} (${{ matrix.tool.package }})
4231
runs-on: ubuntu-latest
4332
steps:
4433
- uses: actions/checkout@v2
34+
- name: Register problem matchers
35+
run: echo "::add-matcher::.github/problem-matchers/pospell.json"
36+
- uses: lots0logs/gh-action-get-changed-files@2.1.4
37+
id: changed_files
38+
with:
39+
token: ${{ secrets.GITHUB_TOKEN }}
4540
- uses: actions/setup-python@v2
4641
with:
4742
python-version: '3.9'
48-
- name: Install padpo
43+
- name: Install ${{ matrix.tool.package }}
44+
run: |
45+
[ -n "${{ matrix.tool.apt_dependencies }}" ] && sudo apt-get update && sudo apt-get install -y ${{ matrix.tool.apt_dependencies }}
46+
python -m pip install --upgrade pip setuptools wheel
47+
python -m pip install ${{ matrix.tool.package }}
48+
- name: Run ${{ matrix.tool.package }}
49+
env:
50+
ADDED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.added), ' ') }}
51+
MODIFIED_FILES: ${{ join(fromJSON(steps.changed_files.outputs.modified), ' ') }}
4952
run: |
50-
python3.9 -m venv .venv
51-
.venv/bin/python -m pip install --upgrade pip setuptools wheel
52-
.venv/bin/python -m pip install padpo
53-
- name: Run padpo
54-
run: PATH=$PATH:$PWD/.venv/bin/ padpo -i *.po */*.po 2>&1 | grep -v -Ff padpo.ignore
53+
CHANGED_PO_FILES=$(printf "%s %s\n" "$ADDED_FILES" "$MODIFIED_FILES" | tr ' ' '\n' | grep '.po$'; true)
54+
if [ -n "$CHANGED_PO_FILES" ]
55+
then
56+
echo "Running on:" $CHANGED_PO_FILES
57+
${{ matrix.tool.command }}
58+
else
59+
echo "No changed po files, nothing to check."
60+
fi
5561
5662
sphinx:
57-
name: 'Build the doc'
63+
name: 'Génération de la doc (sphinx)'
5864
runs-on: ubuntu-latest
65+
timeout-minutes: 30
5966
steps:
6067
- uses: actions/checkout@v2
6168
- uses: actions/cache@v2
@@ -76,8 +83,12 @@ jobs:
7683
run: |
7784
mkdir -p ~/locales/fr/LC_MESSAGES/
7885
cp -uv --parents *.po */*.po ~/locales/fr/LC_MESSAGES/
79-
git -C ~/cpython checkout b30934e9afb0af3f8e2e5f0992445be775b3c630
86+
git -C ~/cpython checkout 895591c1f0bdec5ad357fe6a5fd0875990061357
8087
- name: Prepare venv
81-
run: make -C $HOME/cpython/Doc venv
88+
run: |
89+
# If the venv exists but is broken, drop it (happens on Python upgrades):
90+
# see https://github.com/actions/setup-python/issues/170
91+
[ -d $HOME/cpython/Doc/venv/bin/ -a ! -e $HOME/cpython/Doc/venv/bin/python ] && rm -fr $HOME/cpython/Doc/venv
92+
make -C $HOME/cpython/Doc venv
8293
- name: sphinx-build
8394
run: make -C $HOME/cpython/Doc SPHINXOPTS="-qW -j4 -D locale_dirs=$HOME/locales -D language=fr -D gettext_compact=0" autobuild-dev-html

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ venv/
55
.DS_Store
66
.pospell/
77
.potodo/
8+
locales/

.travis.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

CONTRIBUTING-CORE.rst

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Maintenance
2+
-----------
3+
4+
Les commandes suivantes doivent être exécutées à partir de la racine d'un clone
5+
de ``python-docs-fr`` et certaines s'attendent à trouver un clone de CPython
6+
à jour à proximité :
7+
8+
.. code-block:: bash
9+
10+
~/
11+
├── python-docs-fr/
12+
└── cpython/
13+
14+
15+
Pour cloner CPython, vous pouvez utiliser :
16+
17+
.. code-block:: bash
18+
19+
git clone --depth 1 --no-single-branch https://github.com/python/cpython.git
20+
21+
22+
Ceci évite de télécharger tout l'historique (inutile pour générer la
23+
documentation) mais récupère néanmoins toutes les branches.
24+
25+
.. code-block:: bash
26+
27+
make merge
28+
29+
Dans certains cas on a besoin de propager des traductions d'une branche
30+
à l'autre :
31+
32+
- d'une ancienne branche vers une nouvelle branche : lors du passage
33+
d'une version à l'autre de CPython, lorsque quelqu'un a une PR sur une
34+
ancienne version (*forward porting*) ;
35+
- d'une nouvelle branche vers des anciennes branches : pour propager
36+
de temps en temps le travail sur d'anciennes versions (rétroportage
37+
ou *backporting*).
38+
39+
Pour forward-porter un ou plusieurs commits, il vaut mieux utiliser ``git
40+
cherry-pick -x LE_SHA``, ça garde l'auteur, le sha1 d'origine, et
41+
toutes les modifications.
42+
43+
Pour rétroporter « en gros » on utilise ``pomerge``\ : on le fait lire
44+
sur une branche, puis écrire sur une autre, par exemple pour copier de
45+
la 3.8 à la 3.7 :
46+
47+
.. code-block:: bash
48+
49+
git fetch
50+
git checkout 3.8
51+
git reset --hard upstream/3.8
52+
pomerge --from-files *.po */*.po
53+
git checkout --branch back-porting upstream/3.7
54+
pomerge --no-overwrite --to-files *.po */*.po
55+
powrap --modified
56+
git add --patch
57+
git commit --message="Backporting from 3.8"
58+
git push --set-upstream origin HEAD
59+
60+
61+
Notes :
62+
63+
- j'utilise ``git fetch`` au début pour avoir *upstream/3.7* et
64+
*upstream/3.8* à jour localement, ainsi je peux travailler sans
65+
toucher au réseau jusqu'au ``git push``, mais chacun fait comme il
66+
veut ;
67+
- j'utilise ``*.po */*.po`` et pas ``**/*.po``, car si vous avez un
68+
*venv* dans l'arborescence il va vous trouver des traductions de Sphinx
69+
et peut-être d'autres paquets dans ``.venv/lib/python*/`` (et mettre
70+
beaucoup plus de temps) ;
71+
- j'utilise ``pomerge --no-overwrite``, ça indique à ``pomerge`` de
72+
n'écrire que si le ``msgstr`` est vide, donc de ne pas modifier
73+
l'existant, ainsi il est impossible de casser quelque chose.
74+
On peut le tenter sans ``--no-overwrite``, attention, ça fait
75+
des bêtises, ça nécessite une relecture attentive :
76+
certaines traductions, comme *example:* sont en parfois traduites en
77+
français avec une majuscule, et parfois non, en
78+
fonction du contexte, ``pomerge`` uniformiserait ça, ce n'est pas bien ;
79+
- attention, si vous testez sans ``--no-overwrite``, il est peut-être
80+
bon de vider la mémoire de ``pomerge`` avant la lecture, pour éviter
81+
de lui faire écrire des choses lues lors des sessions précédentes,
82+
via un ``rm -f ~/.pomerge.json``\ ;
83+
- j'utilise ``git add --patch`` (ou ``-p``) car j'aime bien relire quand même,
84+
en général, je n'ajoute pas les différences d'ordre dans les entêtes,
85+
mais un ``git add --update`` irait très bien ;
86+
- attention au fichier *dict* auquel il peut manquer des lignes.
87+

0 commit comments

Comments
 (0)