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
on: [push]
jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: publish
env:
deploy_key: ${{secrets.deploy_key}}
known_hosts: ${{secrets.known_hosts}}
run: |
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
- uses: actions/checkout@v1
- name: test
run: |
python -m pip install pytest hypothesis django
make -C python-initiation test
make -C python-avance test
# TODO: The following needs a configured Django:
# make -C drf-initiation test
# make -C django-initiation test
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: publish
env:
deploy_key: ${{secrets.deploy_key}}
known_hosts: ${{secrets.known_hosts}}
run: |
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!
Et juste pour doctest:
```python
import django.contrib.auth.models
```
# Les bonnes bases : Python
`*args, **kwargs`

View File

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

View File

@ -1,7 +1,5 @@
# 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
syntaxe d'appel de fonction, louche.

View File

@ -171,6 +171,7 @@ False
```
## Nombres
```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*
```python
>>> 1, 2
(1, 2)
@ -275,9 +277,8 @@ liste, par exemple des coordonnées : (x, y).
## Ensembles
```python
>>> {101, 103, 107, 109}
{109, 107, 101, 103}
>>> {101, 103, 107, 109} == {103, 101, 109, 107}
True
```
::: notes
@ -386,6 +387,10 @@ False
False
```
::: notes
On utilisera ça plus tard, avec les structures de contrôle.
## Test d'appartenance