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

Skip to content

Commit 0402921

Browse files
authored
Merge branch '3.8' into readme-contributing-typos
2 parents 08de1bb + 0537777 commit 0402921

File tree

276 files changed

+18164
-6379
lines changed

Some content is hidden

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

276 files changed

+18164
-6379
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
venv/
44
.idea/
55
.DS_Store
6+
.pospell/

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ before_install:
55
- sudo apt-get update
66
- sudo apt-get install -y hunspell hunspell-fr-comprehensive
77
install:
8-
- pip install pospell "powrap>=0.3.0"
8+
- pip install poutils
99
- pospell --version
1010
- powrap --version
11+
- padpo --version
1112
script:
1213
- 'printf "%s\n" "$TRAVIS_COMMIT_RANGE"'
1314
- 'CHANGED_FILES="$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep "\.po$")" ;:'
1415
- 'printf "%s files changed.\n" "$(printf "%s" "$CHANGED_FILES" | grep -c "po$")" ;:'
15-
- '[ -n "$CHANGED_FILES" ] && printf -- "- %s\n" $CHANGED_FILES ;:'
16-
- '[ -n "$CHANGED_FILES" ] && powrap --check --quiet $CHANGED_FILES || :'
17-
- '[ -n "$CHANGED_FILES" ] && pospell -p dict -l fr_FR $CHANGED_FILES || :'
18-
- '[ -n "$CHANGED_FILES" ] && make CPYTHON_CLONE=/tmp/cpython/ COMMIT=e21aa61e96f8343200e765d119ebe778873a6bf1 || :'
16+
- 'if [ -n "$CHANGED_FILES" ]; then printf -- "- %s\n" $CHANGED_FILES; fi'
17+
- 'if [ -n "$CHANGED_FILES" ]; then powrap --check --quiet $CHANGED_FILES; fi'
18+
- 'if [ -n "$CHANGED_FILES" ]; then pospell -p dict -l fr_FR $CHANGED_FILES; fi'
19+
- 'if [ -n "$CHANGED_FILES" ]; then make CPYTHON_PATH=/tmp/cpython/; fi'
20+
- 'if [ -n "$CHANGED_FILES" ]; then padpo -i $CHANGED_FILES 2>&1 | grep -v -Ff padpo.ignore || true; fi'

CONTRIBUTING.rst

Lines changed: 137 additions & 111 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 111 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,103 +4,145 @@
44
#
55
# - make # Automatically build an html local version
66
# - make todo # To list remaining tasks
7-
# - make verifs # To check for correctness: wrapping, spelling
8-
# - make wrap # To check for wrapping
9-
# - make spell # To check for spelling
7+
# - make verifs # To check for correctness: wrapping, spelling
8+
# - make wrap # To check for wrapping
9+
# - make spell # To check for spelling
1010
# - make merge # To merge pot from upstream
1111
# - make fuzzy # To find fuzzy strings
1212
# - make progress # To compute current progression
13-
# - make upgrade_venv # To upgrade the venv that compiles the doc
1413
#
1514
# Modes are: autobuild-stable, autobuild-dev, and autobuild-html,
1615
# documented in gen/src/3.6/Doc/Makefile as we're only delegating the
1716
# real work to the Python Doc Makefile.
1817

19-
CPYTHON_CLONE := $(realpath ../cpython/)
20-
SPHINX_CONF := $(CPYTHON_CLONE)/Doc/conf.py
18+
# Configuration
19+
20+
# The CPYTHON_CURRENT_COMMIT is the commit, in the cpython repository,
21+
# from which we generated our po files. We use it here so when we
22+
# test build, we're building with the .rst files that generated our
23+
# .po files.
24+
CPYTHON_CURRENT_COMMIT := 83d3202b92fb4c2fc6df5b035d57f3a1cf715f20
25+
26+
CPYTHON_PATH := ../cpython/
27+
2128
LANGUAGE := fr
29+
BRANCH := 3.8
30+
31+
32+
# Internal variables
33+
34+
UPSTREAM := https://github.com/python/cpython
2235
VENV := $(shell pwd)/venv/
2336
PYTHON := $(shell which python3)
2437
MODE := html
25-
BRANCH = 3.8
26-
COMMIT =
27-
JOBS = auto
28-
38+
POSPELL_TMP_DIR := .pospell/
39+
WORKTREES := $(VENV)/worktrees/
40+
WORKTREE := $(WORKTREES)/$(CPYTHON_CURRENT_COMMIT)/
41+
JOBS := auto
2942

3043
.PHONY: all
31-
all: $(SPHINX_CONF) $(VENV)/bin/activate
32-
ifneq "$(shell cd $(CPYTHON_CLONE) 2>/dev/null && git describe --contains --all HEAD)" "$(BRANCH)"
33-
$(warning "Your ../cpython checkout may be on the wrong branch, got $(shell cd $(CPYTHON_CLONE) 2>/dev/null && git describe --contains --all HEAD) expected $(BRANCH)")
34-
endif
35-
mkdir -p $(CPYTHON_CLONE)/locales/$(LANGUAGE)/
36-
ln -nfs $(shell $(PYTHON) -c 'import os; print(os.path.realpath("."))') $(CPYTHON_CLONE)/locales/$(LANGUAGE)/LC_MESSAGES
37-
$(MAKE) -C $(CPYTHON_CLONE)/Doc/ VENVDIR=$(VENV) PYTHON=$(PYTHON) \
38-
SPHINXOPTS='-qW -j$(JOBS) -D locale_dirs=../locales -D language=$(LANGUAGE) -D gettext_compact=0 -D latex_engine=xelatex -D latex_elements.inputenc= -D latex_elements.fontenc=' \
39-
$(MODE) && echo "Build success, open file://$(CPYTHON_CLONE)/Doc/build/html/index.html or run 'make serve' to see them."
44+
all: setup
45+
mkdir -p $(WORKTREE)/locales/$(LANGUAGE)/LC_MESSAGES/
46+
cp --parents *.po */*.po $(WORKTREE)/locales/$(LANGUAGE)/LC_MESSAGES/
47+
$(MAKE) -C $(WORKTREE)/Doc/ VENVDIR=$(WORKTREE)/Doc/venv/ PYTHON=$(PYTHON) \
48+
SPHINXOPTS='-qW -j$(JOBS) \
49+
-D locale_dirs=../locales \
50+
-D language=$(LANGUAGE) \
51+
-D gettext_compact=0 \
52+
-D latex_engine=xelatex \
53+
-D latex_elements.inputenc= \
54+
-D latex_elements.fontenc=' \
55+
$(MODE) && echo "Build success, open file://$(WORKTREE)/Doc/build/html/index.html or run 'make serve' to see them."
56+
57+
58+
.PHONY: setup
59+
setup: venv
60+
# Setup the main clone
61+
if ! [ -d $(CPYTHON_PATH) ]; then \
62+
git clone --depth 16 --branch $(BRANCH) $(UPSTREAM) $(CPYTHON_PATH); \
63+
fi
64+
65+
# Setup the current worktree
66+
if ! [ -d $(WORKTREE) ]; then \
67+
rm -fr $(WORKTREES); \
68+
git -C $(CPYTHON_PATH) worktree prune; \
69+
mkdir -p $(WORKTREES); \
70+
if [ -n "$(CPYTHON_CURRENT_COMMIT)" ]; \
71+
then \
72+
depth=32; \
73+
while ! git -C $(CPYTHON_PATH) cat-file -e $(CPYTHON_CURRENT_COMMIT); \
74+
do \
75+
depth=$$((depth * 2)); \
76+
git -C $(CPYTHON_PATH) fetch --depth $$depth $(UPSTREAM) $(BRANCH); \
77+
done \
78+
else \
79+
git -C $(CPYTHON_PATH) fetch --depth 1 $(UPSTREAM); \
80+
fi; \
81+
git -C $(CPYTHON_PATH) worktree add $(WORKTREE)/ $(CPYTHON_CURRENT_COMMIT); \
82+
$(MAKE) -C $(WORKTREE)/Doc/ VENVDIR=$(WORKTREE)/Doc/venv/ PYTHON=$(PYTHON) venv; \
83+
fi
84+
85+
86+
.PHONY: venv
87+
venv:
88+
@if [ ! -d $(VENV) ]; then $(PYTHON) -m venv --prompt python-docs-fr $(VENV); fi
89+
@$(VENV)/bin/python -m pip install -q -r requirements.txt 2> $(VENV)/pip-install.log
90+
@if grep -q 'pip install --upgrade pip' $(VENV)/pip-install.log; then \
91+
$(VENV)/bin/pip install -q --upgrade pip; \
92+
fi
4093

4194

4295
.PHONY: serve
4396
serve:
44-
$(MAKE) -C $(CPYTHON_CLONE)/Doc/ serve
45-
46-
47-
$(SPHINX_CONF):
48-
git clone --depth 1 --branch $(BRANCH) https://github.com/python/cpython.git $(CPYTHON_CLONE)
49-
[ -n "$(COMMIT)" ] && (i=1; while ! $$(git -C $(CPYTHON_CLONE) checkout $(COMMIT)); do i=$$((i * 2)); git -C $(CPYTHON_CLONE) fetch --depth $$i; done) || true
50-
51-
52-
.PHONY: upgrade_venv
53-
upgrade_venv:
54-
$(MAKE) -C $(CPYTHON_CLONE)/Doc/ VENVDIR=$(VENV) PYTHON=$(PYTHON) venv
55-
$(VENV)/bin/pip install -U pip potodo powrap pospell
56-
57-
58-
$(VENV)/bin/activate: $(SPHINX_CONF)
59-
$(MAKE) -C $(CPYTHON_CLONE)/Doc/ VENVDIR=$(VENV) PYTHON=$(PYTHON) venv
97+
$(MAKE) -C $(WORKTREE)/Doc/ serve
6098

6199

62100
.PHONY: progress
63101
progress:
64-
@python3 -c 'import sys; print("{:.1%}".format(int(sys.argv[1]) / int(sys.argv[2])))' \
102+
@$(PYTHON) -c 'import sys; print("{:.1%}".format(int(sys.argv[1]) / int(sys.argv[2])))' \
65103
$(shell msgcat *.po */*.po | msgattrib --translated | grep -c '^msgid') \
66104
$(shell msgcat *.po */*.po | grep -c '^msgid')
67105

68106

69-
$(VENV)/bin/potodo: $(VENV)/bin/activate
70-
$(VENV)/bin/pip install potodo
71-
72-
$(VENV)/bin/powrap: $(VENV)/bin/activate
73-
$(VENV)/bin/pip install powrap
74-
75-
$(VENV)/bin/pospell: $(VENV)/bin/activate
76-
$(VENV)/bin/pip install pospell
77-
78107
.PHONY: todo
79-
todo: $(VENV)/bin/potodo
108+
todo: venv
80109
$(VENV)/bin/potodo
81110

82-
.PHONY: verifs
83-
verifs: wrap spell
84-
85111
.PHONY: wrap
86-
wrap: $(VENV)/bin/powrap
112+
wrap: venv
87113
$(VENV)/bin/powrap --check --quiet *.po **/*.po
88114

115+
SRCS = $(shell git diff --name-only $(BRANCH) | grep '.po$$')
116+
# foo/bar.po => $(POSPELL_TMP_DIR)/foo/bar.po.out
117+
DESTS = $(addprefix $(POSPELL_TMP_DIR)/,$(addsuffix .out,$(SRCS)))
118+
89119
.PHONY: spell
90-
spell: $(VENV)/bin/pospell
91-
$(VENV)/bin/pospell -p dict -l fr_FR *.po **/*.po
120+
spell: venv $(DESTS)
121+
122+
$(POSPELL_TMP_DIR)/%.po.out: %.po dict
123+
@echo "Checking $<..."
124+
@mkdir -p $(@D)
125+
@$(VENV)/bin/pospell -p dict -l fr_FR $< && touch $@
126+
127+
.PHONY: fuzzy
128+
fuzzy: venv
129+
$(VENV)/bin/potodo -f
130+
131+
.PHONY: verifs
132+
verifs: wrap spell
92133

93134
.PHONY: merge
94-
merge: upgrade_venv
95-
ifneq "$(shell cd $(CPYTHON_CLONE) 2>/dev/null && git describe --contains --all HEAD)" "$(BRANCH)"
96-
$(error "You're merging from a different branch:" "$(shell cd $(CPYTHON_CLONE) 2>/dev/null && git describe --contains --all HEAD)" vs "$(BRANCH)")
97-
endif
98-
(cd $(CPYTHON_CLONE)/Doc; rm -f build/NEWS)
99-
(cd $(CPYTHON_CLONE); $(VENV)/bin/sphinx-build -Q -b gettext -D gettext_compact=0 Doc pot/)
100-
find $(CPYTHON_CLONE)/pot/ -name '*.pot' |\
135+
merge: setup
136+
git -C $(CPYTHON_PATH) fetch $(UPSTREAM)
137+
rm -fr $(WORKTREES)/$(BRANCH)
138+
git -C $(CPYTHON_PATH) worktree prune
139+
git -C $(CPYTHON_PATH) worktree add $(WORKTREES)/$(BRANCH) $(word 1,$(shell git -C $(CPYTHON_PATH) remote -v | grep python/cpython))/$(BRANCH)
140+
$(MAKE) -C $(WORKTREES)/$(BRANCH)/Doc/ VENVDIR=$(WORKTREES)/$(BRANCH)/Doc/venv/ PYTHON=$(PYTHON) venv;
141+
(cd $(WORKTREES)/$(BRANCH); $(WORKTREES)/$(BRANCH)/Doc/venv/bin/sphinx-build -Q -b gettext -D gettext_compact=0 Doc pot/)
142+
find $(WORKTREES)/$(BRANCH) -name '*.pot' |\
101143
while read -r POT;\
102144
do\
103-
PO="./$$(echo "$$POT" | sed "s#$(CPYTHON_CLONE)/pot/##; s#\.pot\$$#.po#")";\
145+
PO="./$$(echo "$$POT" | sed "s#$(WORKTREES)/$(BRANCH)/pot/##; s#\.pot\$$#.po#")";\
104146
mkdir -p "$$(dirname "$$PO")";\
105147
if [ -f "$$PO" ];\
106148
then\
@@ -112,8 +154,12 @@ endif
112154
msgcat -o "$$PO" "$$POT";\
113155
fi\
114156
done
115-
116-
117-
.PHONY: fuzzy
118-
fuzzy: $(VENV)/bin/potodo
119-
$(VENV)/bin/potodo -f
157+
sed -i 's/^CPYTHON_CURRENT_COMMIT :=.*/CPYTHON_CURRENT_COMMIT := $(shell git -C $(WORKTREES)/$(BRANCH) rev-parse HEAD)/' Makefile
158+
rm -fr $(WORKTREES)/$(BRANCH)
159+
git -C $(CPYTHON_PATH) worktree prune
160+
echo 'To add, you can use git status -s | grep "^ M .*\.po" | cut -d" " -f3 | while read -r file; do if [ $$(git diff "$$file" | wc -l) -gt 13 ]; then git add "$$file"; fi ; done'
161+
162+
.PHONY: clean
163+
clean:
164+
rm -fr venv $(POSPELL_TMP_DIR)
165+
find -name '*.mo' -delete

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Comment contribuer
4242

4343
Vous pouvez contribuer :
4444

45-
- en proposant des *pull requests* Github (solution recommandée),
46-
- ou en envoyant un patch à la liste `traductions <https://lists.afpy.org/mailman/listinfo/traductions>`_.
45+
- en proposant des *pull requests* Github (solution recommandée) ;
46+
- en envoyant un patch à la liste `traductions <https://lists.afpy.org/mailman/listinfo/traductions>`_.
4747

4848
Un guide pour contribuer au projet via Github se trouve dans
4949
`CONTRIBUTING.rst
@@ -70,4 +70,4 @@ l'`AFPy <https://www.afpy.org/>`_. En 2017 ce projet est devenu la
7070
traduction officielle de la documentation Python en français grâce à
7171
la `PEP 545 <https://www.python.org/dev/peps/pep-0545/>`_. `Jules Lasne
7272
<https://github.com/Seluj78>`_ à publié fin 2019 une `vidéo de
73-
l'histoire du repo <https://youtu.be/azXmvpEJMhU>`_.
73+
l'histoire du dépôt <https://youtu.be/azXmvpEJMhU>`_.

bugs.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgstr ""
66
"Project-Id-Version: Python 3\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2019-09-04 11:33+0200\n"
9-
"PO-Revision-Date: 2019-10-30 00:05+0100\n"
9+
"PO-Revision-Date: 2019-12-10 16:04+0100\n"
1010
"Last-Translator: Antoine Wecxsteen\n"
1111
"Language-Team: FRENCH <[email protected]>\n"
1212
"Language: fr\n"
@@ -67,7 +67,7 @@ msgid ""
6767
msgstr ""
6868
"Si vous êtes limité par le temps, vous pouvez aussi envoyer un courriel à "
6969
"[email protected] (les bogues de comportement peuvent être envoyés à python-"
70-
"[email protected]). 'docs@' est une liste de diffusion gérée par des "
70+
"[email protected]). « docs@ » est une liste de diffusion gérée par des "
7171
"volontaires, votre requête sera vue, mais elle peut prendre un moment pour "
7272
"être traitée."
7373

c-api/arg.po

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,18 +584,22 @@ msgid "``L`` (:class:`int`) [long long]"
584584
msgstr "``L`` (:class:`int`) [``long long``]"
585585

586586
#: ../Doc/c-api/arg.rst:285
587+
#, fuzzy
587588
msgid "Convert a Python integer to a C :c:type:`long long`."
588-
msgstr ""
589+
msgstr "Convertit un entier Python en un :c:type:`long int`."
589590

590591
#: ../Doc/c-api/arg.rst:289 ../Doc/c-api/arg.rst:615
591592
msgid "``K`` (:class:`int`) [unsigned long long]"
592593
msgstr "``K`` (:class:`int`) [``unsigned long long``]"
593594

594595
#: ../Doc/c-api/arg.rst:288
596+
#, fuzzy
595597
msgid ""
596598
"Convert a Python integer to a C :c:type:`unsigned long long` without "
597599
"overflow checking."
598600
msgstr ""
601+
"Convertit un entier Python en un :c:type:`unsigned long` C sans en vérifier "
602+
"le débordement."
599603

600604
#: ../Doc/c-api/arg.rst:292 ../Doc/c-api/arg.rst:618
601605
msgid "``n`` (:class:`int`) [Py_ssize_t]"
@@ -1076,8 +1080,9 @@ msgid "``U#`` (:class:`str` or ``None``) [const char \\*, int]"
10761080
msgstr "``U#`` (:class:`str` ou ``None``) [``const char *``, ``int``]"
10771081

10781082
#: ../Doc/c-api/arg.rst:588
1083+
#, fuzzy
10791084
msgid "Convert a plain C :c:type:`int` to a Python integer object."
1080-
msgstr ""
1085+
msgstr "Convertit un :c:type:`long int` en un *int* Python."
10811086

10821087
#: ../Doc/c-api/arg.rst:591
10831088
msgid "``b`` (:class:`int`) [char]"
@@ -1104,16 +1109,18 @@ msgid "Convert a C :c:type:`unsigned short int` to a Python integer object."
11041109
msgstr ""
11051110

11061111
#: ../Doc/c-api/arg.rst:606
1112+
#, fuzzy
11071113
msgid "Convert a C :c:type:`unsigned int` to a Python integer object."
1108-
msgstr ""
1114+
msgstr "Convertit un :c:type:`long int` en un *int* Python."
11091115

11101116
#: ../Doc/c-api/arg.rst:609
11111117
msgid "Convert a C :c:type:`unsigned long` to a Python integer object."
11121118
msgstr ""
11131119

11141120
#: ../Doc/c-api/arg.rst:612
1121+
#, fuzzy
11151122
msgid "Convert a C :c:type:`long long` to a Python integer object."
1116-
msgstr ""
1123+
msgstr "Convertit un :c:type:`long int` en un *int* Python."
11171124

11181125
#: ../Doc/c-api/arg.rst:615
11191126
msgid "Convert a C :c:type:`unsigned long long` to a Python integer object."

c-api/bytes.po

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,37 @@ msgid ""
2525
msgstr ""
2626

2727
#: ../Doc/c-api/bytes.rst:16
28+
#, fuzzy
2829
msgid "This subtype of :c:type:`PyObject` represents a Python bytes object."
2930
msgstr ""
31+
"Ce sous-type de :c:type:`PyObject` représente un objet ``bytearray`` Python."
3032

3133
#: ../Doc/c-api/bytes.rst:21
34+
#, fuzzy
3235
msgid ""
3336
"This instance of :c:type:`PyTypeObject` represents the Python bytes type; it "
3437
"is the same object as :class:`bytes` in the Python layer."
3538
msgstr ""
39+
"Cette instance de :c:type:`PyTypeObject` représente le type Python "
40+
"*bytearray*, c'est le même que :class:`bytearray` côté Python."
3641

3742
#: ../Doc/c-api/bytes.rst:27
43+
#, fuzzy
3844
msgid ""
3945
"Return true if the object *o* is a bytes object or an instance of a subtype "
4046
"of the bytes type."
4147
msgstr ""
48+
"Renvoie vrai si l'objet *o* est un ``bytearray`` ou une instance d'un sous-"
49+
"type du type ``bytearray``."
4250

4351
#: ../Doc/c-api/bytes.rst:33
52+
#, fuzzy
4453
msgid ""
4554
"Return true if the object *o* is a bytes object, but not an instance of a "
4655
"subtype of the bytes type."
4756
msgstr ""
57+
"Renvoie vrai si l'objet *o* est un ``bytearray``, mais pas une instance d'un "
58+
"sous-type du type ``bytearray``."
4859

4960
#: ../Doc/c-api/bytes.rst:39
5061
msgid ""
@@ -72,15 +83,16 @@ msgstr ""
7283

7384
#: ../Doc/c-api/bytes.rst:68
7485
msgid "Format Characters"
75-
msgstr ""
86+
msgstr "Caractères de format"
7687

7788
#: ../Doc/c-api/bytes.rst:68
7889
msgid "Type"
7990
msgstr "Type"
8091

8192
#: ../Doc/c-api/bytes.rst:68
93+
#, fuzzy
8294
msgid "Comment"
83-
msgstr ""
95+
msgstr "Commentaires"
8496

8597
#: ../Doc/c-api/bytes.rst:70
8698
msgid ":attr:`%%`"

0 commit comments

Comments
 (0)