Proofreading initiation and test in the github workflow..

This commit is contained in:
Julien Palard 2021-10-24 19:07:53 +02:00
parent 5a86693744
commit 7cebe6bb78
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
5 changed files with 62 additions and 32 deletions

View File

@ -1,29 +1,45 @@
---
name: Publish name: Publish
on: [push] on: [push]
jobs: jobs:
build: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: publish - name: test
env: run: |
deploy_key: ${{secrets.deploy_key}} python -m pip install pytest hypothesis django
known_hosts: ${{secrets.known_hosts}} make -C python-initiation test
run: | make -C python-avance test
mkdir -p ${HOME}/.ssh # TODO: The following needs a configured Django:
printf "%s\n" "$known_hosts" > ${HOME}/.ssh/known_hosts # make -C drf-initiation test
printf "%s\n" "$deploy_key" > ${HOME}/.ssh/id_ed25519 # make -C django-initiation test
chmod 600 ${HOME}/.ssh/id_ed25519
eval $(ssh-agent) build:
ssh-add needs: test
rm ${HOME}/.ssh/id_ed25519 runs-on: ubuntu-latest
export deploy_key="" steps:
python3 -m pip install --user --upgrade pip - uses: actions/checkout@v1
python3 -m pip install --user mdtoreveal - name: publish
export PATH="$HOME/.local/bin/:$PATH" env:
make -C python-initiation rsync deploy_key: ${{secrets.deploy_key}}
make -C python-avance rsync known_hosts: ${{secrets.known_hosts}}
make -C drf-initiation rsync run: |
make -C django-initiation rsync mkdir -p ${HOME}/.ssh
printf "%s\n" "$known_hosts" > ${HOME}/.ssh/known_hosts
printf "%s\n" "$deploy_key" > ${HOME}/.ssh/id_ed25519
chmod 600 ${HOME}/.ssh/id_ed25519
eval $(ssh-agent)
ssh-add
rm ${HOME}/.ssh/id_ed25519
export deploy_key=""
python3 -m pip install --user --upgrade pip
python3 -m pip install --user mdtoreveal
export PATH="$HOME/.local/bin/:$PATH"
make -C python-initiation rsync
make -C python-avance rsync
make -C drf-initiation rsync
make -C django-initiation rsync

View File

@ -10,6 +10,11 @@ https://mdk.fr
Introduce yourself! Introduce yourself!
Et juste pour doctest:
```python
import django.contrib.auth.models
```
# Les bonnes bases : Python # Les bonnes bases : Python
`*args, **kwargs` `*args, **kwargs`

View File

@ -38,7 +38,10 @@ async def pong_handler():
## Generator-based coroutines ## Generator-based coroutines
```python ```pytho
import types
@types.coroutine @types.coroutine
def get_then_print(url): def get_then_print(url):
... ...
@ -183,7 +186,7 @@ print(coro_manager(wont_terminate_here()))
## Gérer ses coroutines ## Gérer ses coroutines
``` ```python
def frenetic_coro_manager(coro): def frenetic_coro_manager(coro):
try: try:
while True: while True:
@ -196,6 +199,9 @@ def frenetic_coro_manager(coro):
## Gérer ses coroutines ## Gérer ses coroutines
```python ```python
import random
def frenetic_coros_manager(*coros): def frenetic_coros_manager(*coros):
coros = list(coros) coros = list(coros)
while coros: while coros:
@ -211,14 +217,14 @@ def frenetic_coros_manager(*coros):
```python ```python
async def tum(): async def tum():
while True: for _ in range(10): # ou : while True:
await Awaitable() await Awaitable()
print("Tum") print("Tum")
async def pak(): async def pak():
while True: for _ in range(10): # ou : while True:
await Awaitable() await Awaitable()
print("Pak") print("Pak")
frenetic_coro_manager(tum(), pak()) frenetic_coros_manager(tum(), pak())
``` ```

View File

@ -1,7 +1,5 @@
# TODO # TODO
On montre `or`, `and`, `not` mais a aucun moment on ne leur montre d'exemple.
On montre la syntaxe d'appel de méthode bien avant de montrer la On montre la syntaxe d'appel de méthode bien avant de montrer la
syntaxe d'appel de fonction, louche. syntaxe d'appel de fonction, louche.

View File

@ -171,6 +171,7 @@ False
``` ```
## Nombres ## Nombres
```python ```python
@ -257,6 +258,7 @@ Une liste c'est de la donnée, ce qu'elle contint c'est de la donnée.
## *n*-uplets, *tuple* ## *n*-uplets, *tuple*
```python ```python
>>> 1, 2 >>> 1, 2
(1, 2) (1, 2)
@ -275,9 +277,8 @@ liste, par exemple des coordonnées : (x, y).
## Ensembles ## Ensembles
```python ```python
>>> {101, 103, 107, 109} >>> {101, 103, 107, 109} == {103, 101, 109, 107}
{109, 107, 101, 103} True
``` ```
::: notes ::: notes
@ -386,6 +387,10 @@ False
False False
``` ```
::: notes
On utilisera ça plus tard, avec les structures de contrôle.
## Test d'appartenance ## Test d'appartenance