Skip to content

Commit 5392675

Browse files
authored
Passage de Make à just (#244)
* Add rust-just as a dev dependency * Move the commands from the makefile to the justfile * Fix the way coverage is called * Update messages and search * Update json export script to include a newline * Update CI * Update publish-package script
1 parent 5f6827e commit 5392675

File tree

13 files changed

+270
-106
lines changed

13 files changed

+270
-106
lines changed

.github/workflows/deploy-doc.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ jobs:
1313
strategy:
1414
max-parallel: 4
1515
matrix:
16-
python-version: ["3.11"]
16+
python-version: ["3.13"]
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
20+
- name: 📔 Install just
21+
uses: extractions/setup-just@v2
2022
- name: 🐍 Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v4
2224
with:
2325
python-version: ${{ matrix.python-version }}
2426
- name: 👷 Install Dependencies
@@ -28,7 +30,7 @@ jobs:
2830
poetry install
2931
- name: 📄 Build docs
3032
run: |
31-
make export_static
33+
just export_static
3234
touch docs/django-dsfr/.nojekyll
3335
- name: 🚀 Deploy Github Pages
3436
uses: JamesIves/github-pages-deploy-action@3.7.1

.github/workflows/publish-package.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ jobs:
99
publish:
1010
name: Publish
1111
runs-on: ubuntu-latest
12+
strategy:
13+
max-parallel: 4
14+
matrix:
15+
python-version: ["3.10"]
1216

1317
steps:
14-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1519
- name: 🐍 Set up Python ${{ matrix.python-version }}
16-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v4
1721
with:
18-
python-version: "3.10"
22+
python-version: ${{ matrix.python-version }}
1923
- name: 👷 Install Dependencies
2024
run: |
2125
python -m pip install --upgrade pip

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ L’installation a été testée sur Ubuntu 22.04 avec Python 3.10 et poetry ins
77

88
- Installer l’environnement virtuel, les dépendances, les *pre-commit hooks* et initialiser le site d’exemple :
99
```{ .bash }
10-
make init
10+
just init
1111
```
1212

1313
## Tests
1414

1515
Pour faire tourner les tests :
1616

1717
```{ .bash }
18-
make test
18+
just test
1919
```
2020

2121
## Gestion des dépendances avec Poetry
@@ -60,10 +60,10 @@ Concernant les langues :
6060
Pour vérifier son code, on peut intégrer le linter adapté à son IDE et aussi faire ceci :
6161

6262
```{ .bash }
63-
make quality
63+
just quality
6464
```
6565

66-
Une vérification automatique est faite via des *pre-commit hooks*, qui ont normalement été installés via le `make init`.
66+
Une vérification automatique est faite via des *pre-commit hooks*, qui ont normalement été installés via le `just init`.
6767

6868
Il est possible de les mettre à jour avec la commande :
6969

@@ -76,14 +76,14 @@ pre-commit update
7676
Quand une nouvelle version du système de design de l’État est publiée, il est possible de le mettre à jour automatiquement via la commande :
7777

7878
```{ .bash }
79-
make update_dsfr
79+
just update_dsfr
8080
```
8181

8282
La commande télécharge la dernière version depuis le dépôt Github, la met dans le répertoire `dsfr/static/dsfr/dist/`, retire des fichiers pour réduire la taille du paquet Python et met à jour les sommes de contrôle d’intégrité dans le fichier `dsfr/checksums`.
8383

8484
Une fois la mise à jour faite, il reste à :
8585

86-
- lancer les tests unitaires avec `make test` ;
86+
- lancer les tests unitaires avec `just test` ;
8787
- ouvrir le site de test et vérifier que tous les composants s’affichent toujours bien ;
8888
- mettre à jour la liste des composants en vérifiant depuis le site du système de design de l’État ;
8989
- mettre à jour le fichier README.md pour indiquer la nouvelle version du DSFR ;

Makefile

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,28 @@ else
1111
local_port := 8000
1212
endif
1313

14+
# Warnings
15+
MAKEFLAGS += --no-print-directory
16+
NO_FORMAT=\033[0m
17+
C_ORANGERED1=\033[38;5;202m
18+
19+
.PHONY: deprecation-warning
20+
deprecation-warning:
21+
@echo "${C_ORANGERED1}WARNING: this project now uses just instead of make. \
22+
This recipe is obsolete and will be removed in a future major version. \
23+
Please use the equivalent recipe through just.${NO_FORMAT}"
24+
25+
.PHONY: deletion-warning
26+
deletion-warning:
27+
@echo "${C_ORANGERED1}WARNING: this recipe is obsolete \
28+
and will be removed in a future major version.${NO_FORMAT}"
29+
1430
# Commands
1531

1632
.PHONY: collectstatic
1733
collectstatic:
1834
poetry run python manage.py collectstatic --noinput
35+
@make deprecation-warning
1936

2037
.PHONY: init
2138
init:
@@ -24,27 +41,32 @@ init:
2441
poetry run python manage.py migrate
2542
make collectstatic
2643
poetry run python manage.py import_sample_data
27-
poetry shell
44+
@make deprecation-warning
2845

2946
.PHONY: messages
3047
messages:
3148
poetry run django-admin makemessages -l fr --ignore=manage.py,docs/*
49+
@make deprecation-warning
3250

3351
.PHONY: compilemessages
3452
compilemessages:
3553
poetry run django-admin compilemessages
54+
@make deprecation-warning
3655

3756
.PHONY: quality
3857
quality:
3958
poetry run pre-commit run --all-files
59+
@make deprecation-warning
4060

4161
.PHONY: runserver
4262
runserver:
4363
poetry run python manage.py runserver $(local_port)
64+
@make deprecation-warning
4465

4566
.PHONY: test
4667
test:
4768
poetry run python manage.py test
69+
@make deprecation-warning
4870

4971
.PHONY: update_dsfr
5072
update_dsfr:
@@ -53,19 +75,23 @@ update_dsfr:
5375
poetry run python manage.py integrity_checksums
5476
poetry run python manage.py make_icon_picker_files
5577
make collectstatic
78+
@make deprecation-warning
5679

5780
.PHONY: upgrade
5881
upgrade:
5982
poetry update
6083
poetry run pre-commit autoupdate
84+
@make deprecation-warning
6185

6286
.PHONY: static_server
6387
static_server:
6488
python -m http.server 1$(local_port) -d docs/
89+
@make deprecation-warning
6590

6691
.PHONY: export_static
6792
export_static:
6893
poetry run python manage.py migrate
6994
poetry run python manage.py import_sample_data
7095
poetry run python manage.py distill-local docs --force --collectstatic
7196
poetry run python manage.py export_json
97+
@make deprecation-warning
0 Bytes
Binary file not shown.

dsfr/locale/fr/LC_MESSAGES/django.po

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2025-04-22 18:50+0200\n"
11-
"PO-Revision-Date: 2025-04-22 18:51+0200\n"
10+
"POT-Creation-Date: 2025-07-03 19:15+0200\n"
11+
"PO-Revision-Date: 2025-07-03 19:15+0200\n"
1212
"Last-Translator: \n"
1313
"Language-Team: \n"
1414
"Language: fr\n"
@@ -326,7 +326,7 @@ msgstr "vous êtes ici :"
326326
msgid "See breadcrumb"
327327
msgstr "Voir le fil d’Ariane"
328328

329-
#: dsfr/templates/dsfr/breadcrumb.html:15 dsfr/templates/dsfr/header.html:10
329+
#: dsfr/templates/dsfr/breadcrumb.html:15
330330
msgid "Home page"
331331
msgstr "Accueil"
332332

@@ -436,16 +436,16 @@ msgstr "Qu’est-ce que FranceConnect+ ?"
436436
msgid "What is FranceConnect?"
437437
msgstr "Qu’est-ce que FranceConnect ?"
438438

439-
#: dsfr/templates/dsfr/header.html:29
439+
#: dsfr/templates/dsfr/header.html:26
440440
msgid "Menu"
441441
msgstr "Menu"
442442

443-
#: dsfr/templates/dsfr/header.html:91 dsfr/templates/dsfr/theme_modale.html:13
443+
#: dsfr/templates/dsfr/header.html:88 dsfr/templates/dsfr/theme_modale.html:13
444444
#: dsfr/templates/dsfr/transcription.html:30
445445
msgid "Close"
446446
msgstr "Fermer"
447447

448-
#: dsfr/templates/dsfr/header.html:95
448+
#: dsfr/templates/dsfr/header.html:92
449449
msgid "Main menu"
450450
msgstr "Menu principal"
451451

@@ -523,11 +523,11 @@ msgstr "Thème clair"
523523
msgid "Dark theme"
524524
msgstr "Thème sombre"
525525

526-
#: dsfr/templates/dsfr/theme_modale.html:59
526+
#: dsfr/templates/dsfr/theme_modale.html:60
527527
msgid "System"
528528
msgstr "Système"
529529

530-
#: dsfr/templates/dsfr/theme_modale.html:60
530+
#: dsfr/templates/dsfr/theme_modale.html:61
531531
msgid "Uses system settings."
532532
msgstr "Utilise les paramètres système."
533533

@@ -539,7 +539,7 @@ msgstr "Activé"
539539
msgid "Unchecked"
540540
msgstr "Désactivé"
541541

542-
#: dsfr/templates/dsfr/tooltip.html:6
542+
#: dsfr/templates/dsfr/tooltip.html:7
543543
msgid "Contextual information"
544544
msgstr "Information contextuelle"
545545

42 Bytes
Binary file not shown.

example_app/locale/fr/LC_MESSAGES/django.po

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: \n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2025-03-03 16:55+0100\n"
11-
"PO-Revision-Date: 2025-03-03 16:55+0100\n"
10+
"POT-Creation-Date: 2025-07-03 19:15+0200\n"
11+
"PO-Revision-Date: 2025-07-03 19:16+0200\n"
1212
"Last-Translator: \n"
1313
"Language-Team: \n"
1414
"Language: fr\n"
@@ -79,29 +79,24 @@ msgid "Book"
7979
msgstr "Livre"
8080

8181
#: example_app/templates/example_app/blocks/footer.html:12
82-
#: example_app/templates/example_app/blocks/header.html:31
82+
#: example_app/templates/example_app/blocks/header.html:27
8383
msgid "Display settings"
8484
msgstr "Paramètres d’affichage"
8585

8686
#: example_app/templates/example_app/blocks/footer.html:18
8787
msgid "Back to home page"
8888
msgstr "Retour à l’accueil du site"
8989

90-
#: example_app/templates/example_app/blocks/header.html:6
91-
#: example_app/views.py:91
92-
msgid "Home page"
93-
msgstr "Accueil"
94-
95-
#: example_app/templates/example_app/blocks/header.html:43
96-
#: example_app/templates/example_app/blocks/header.html:68
90+
#: example_app/templates/example_app/blocks/header.html:39
91+
#: example_app/templates/example_app/blocks/header.html:64
9792
msgid "Search"
9893
msgstr "Rechercher"
9994

100-
#: example_app/templates/example_app/blocks/header.html:52
95+
#: example_app/templates/example_app/blocks/header.html:48
10196
msgid "Menu"
10297
msgstr "Menu"
10398

104-
#: example_app/templates/example_app/blocks/header.html:73
99+
#: example_app/templates/example_app/blocks/header.html:67
105100
msgid "Close"
106101
msgstr "Fermer"
107102

@@ -112,3 +107,11 @@ msgstr "Sélectionner une langue"
112107
#: example_app/templates/example_app/blocks/main_menu.html:13
113108
msgid "Main menu"
114109
msgstr "Menu principal"
110+
111+
#: example_app/templates/example_app/page_templatetags.html:70
112+
msgid "First page"
113+
msgstr "Première page"
114+
115+
#: example_app/views.py:91
116+
msgid "Home page"
117+
msgstr "Accueil"

example_app/management/commands/export_json.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ def handle(self, *args, **options):
2020
)
2121

2222
for file in self.STATIC_ROOT.rglob("*.html"):
23-
result = self.get_page_content(file)
23+
result = self.get_page_content(file) # type: ignore
2424
if result:
2525
output.append(result)
2626

2727
# Export to both the static dump and the regular app
2828
with open(self.STATIC_ROOT / "static/json/search_data.json", "w") as data_file:
2929
json.dump(output, data_file, indent=4, sort_keys=True)
30+
data_file.write("\n")
3031

3132
with open("example_app/static/json/search_data.json", "w") as data_file:
3233
json.dump(output, data_file, indent=4, sort_keys=True)
34+
data_file.write("\n")
3335

3436
def get_page_content(self, file: str):
3537
filename = str(file).split("/")[-2]

example_app/static/json/search_data.json

Lines changed: 15 additions & 9 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)