diff --git a/.envrc b/.envrc new file mode 100644 index 0000000000000000000000000000000000000000..cb982f00b6294f263cec394495de886cb5af440c --- /dev/null +++ b/.envrc @@ -0,0 +1,9 @@ +watch_file flake.nix +watch_file flake.lock + +DEVENV_ROOT_FILE="$(mktemp)" +printf %s "$PWD" > "$DEVENV_ROOT_FILE" +if ! use flake . --override-input devenv-root "file+file://$DEVENV_ROOT_FILE" +then + echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 +fi diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..f6d3039f188cbc05ec48c98e247ee7ed7a12c31e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +ligne_de_commande_logo.png filter=lfs diff=lfs merge=lfs -text +R_logo.png filter=lfs diff=lfs merge=lfs -text +VS_code_logo.png filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index d2e99add758353effc952294152ba7ec22d34909..b0567325ca6eed80e61ad21417f585aa79efc07f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ public/*.png session_1_quarto_files/ *.swp .vscode +.devenv diff --git a/01_initiation/3_a_quoi_sert_git.qmd b/01_initiation/3_a_quoi_sert_git.qmd index 033c4b7f95edd4c5972a1dedba0417316545037e..8df9ee825d4c8cffc019a32228a3425e3ccf265d 100644 --- a/01_initiation/3_a_quoi_sert_git.qmd +++ b/01_initiation/3_a_quoi_sert_git.qmd @@ -4,18 +4,34 @@ {fig-align="center"} +::: notes +Ça vous est sans doute déjà arrivé de garder plusieurs versions de documents ou de scripts. +-> versionnage manuel +::: + ## À quoi sert Git ? * Suivi et sauvegarde des changements dans le code -* Mise à disposition / partage -* Mise en place des outillages logiciels (vérifications automatiques, empaquetage…) +{fig-align="center"} + +::: notes +De manière générale, git sert à enregistrer des versions de son code source. +On va l’utiliser dès qu’on fait une modification. +::: ## Bénéfices en général * Traçabilité des modifications * Retour à une version antérieure, reproductibilité +* Mise à disposition, partage * Synchronisation entre plusieurs postes, accessibilité * Copie de travail locale (pour un travail hors ligne) * Travail sur des questions en parallèle +* Associé à une forge: mise en place d’outillage logiciel (vérifications automatiques, empaquetage) + +::: notes +reproductibilité : permettre de relancer un programme ou un script associé à des données exactement dans les mêmes conditions que celles dans lesquelles ces données ont été générées +partage : permet donc de partager des données, mais aussi la manière exacte dont ces donées ont été générées +::: diff --git a/01_initiation/4_cas_d_utilisation.qmd b/01_initiation/4_cas_d_utilisation.qmd index f3e6c08dd987e1c3a7c37ca60ae7f42fe84cd8a1..9d6f412fd7787d463d3c383d7234f0877f269447 100644 --- a/01_initiation/4_cas_d_utilisation.qmd +++ b/01_initiation/4_cas_d_utilisation.qmd @@ -1,5 +1,9 @@ # Cas d'utilisation {.inverse} +::: notes +présentation des cas d’utilisation abordés dans cette session +::: + ---- Pourquoi aurait-on besoin de Git ? @@ -12,4 +16,4 @@ Pourquoi aurait-on besoin de Git ? ::: notes Cas d'utilisations abordés dans cette session -::: \ No newline at end of file +::: diff --git a/01_initiation/5_etats.qmd b/01_initiation/5_etats.qmd index 1ad3d88bffeb38eb50b585c0b8241e2bd484617b..5b419da7c478b50a7cc3ba8ec1be17850eb7e174 100644 --- a/01_initiation/5_etats.qmd +++ b/01_initiation/5_etats.qmd @@ -1,5 +1,9 @@ # États {.inverse} +::: notes +États d’un répertoire de travail +::: + ---- Les états du système de fichiers @@ -7,6 +11,12 @@ Les états du système de fichiers {fig-align="center"} +::: notes +Le répertoire et les fichiers suvis vont être dans différents états (ne pas détailler) +pour cette session, va s’intéresser à une petite partie de ces états +::: + + ## États (session 1) {fig-align="center"} diff --git a/01_initiation/6_pratiques_en_local.qmd b/01_initiation/6_pratiques_en_local.qmd index b2948b6f0d9c40b546c6949197fd32995098b9ce..4bded9721cebe663664cc35fda6520129f265f53 100644 --- a/01_initiation/6_pratiques_en_local.qmd +++ b/01_initiation/6_pratiques_en_local.qmd @@ -1,5 +1,10 @@ # Premières pratiques en local {.inverse} +::: notes +présentation du début de la première pratique en local +(la pratique commence à une slide un peu plus loin) +::: + ---- Généralement, les diapos seront construites avec 3 onglets permettant de faire le lien avec les outils suivants : @@ -235,6 +240,12 @@ Ne pas essayer d'éditer les fichiers du dossier `.git`. 3) Parcourir l'arborescence et constater qu'un dossier ".Git" a été créé ::: +::: notes +On va versionner et initialiser git dans un dossier de projet, par exemple un dossier où vous allez mettre votre script. + +(pas dans le dossier home =P ) +::: + ## Consultation état du dépôt ::: {.panel-tabset} @@ -333,4 +344,4 @@ touch .gitignore .RData .Ruserdata ``` -::: \ No newline at end of file +::: diff --git a/01_initiation/images/03_01_a_quoi_sert_git_versionnage.png b/01_initiation/images/03_01_a_quoi_sert_git_versionnage.png new file mode 100644 index 0000000000000000000000000000000000000000..2c55a7d556cfbedddd370ef832f1926957924732 Binary files /dev/null and b/01_initiation/images/03_01_a_quoi_sert_git_versionnage.png differ diff --git a/01_initiation/images/03_01_a_quoi_sert_git_versionnage.svg b/01_initiation/images/03_01_a_quoi_sert_git_versionnage.svg new file mode 100644 index 0000000000000000000000000000000000000000..30d636fd1ed66e305bf4a55af90df5c509ca0e5b --- /dev/null +++ b/01_initiation/images/03_01_a_quoi_sert_git_versionnage.svg @@ -0,0 +1,249 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --> + +<svg + width="1436.8044" + height="310.88547" + viewBox="0 0 43.104133 9.326564" + fill="none" + version="1.1" + id="svg1" + sodipodi:docname="03_01_a_quoi_sert_git_versionnage.svg" + inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)" + inkscape:export-filename="03_01_a_quoi_sert_git_versionnage.png" + inkscape:export-xdpi="96" + inkscape:export-ydpi="96" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <defs + id="defs1"> + <marker + style="overflow:visible" + id="ArrowWideRounded" + refX="0" + refY="0" + orient="auto-start-reverse" + inkscape:stockid="Wide, rounded arrow" + markerWidth="1" + markerHeight="1" + viewBox="0 0 1 1" + inkscape:isstock="true" + inkscape:collect="always" + preserveAspectRatio="xMidYMid"> + <path + style="fill:none;stroke:context-stroke;stroke-width:1;stroke-linecap:round" + d="M 3,-3 0,0 3,3" + transform="rotate(180,0.125,0)" + sodipodi:nodetypes="ccc" + id="path2" /> + </marker> + </defs> + <sodipodi:namedview + id="namedview1" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:showpageshadow="2" + inkscape:pageopacity="0.0" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + inkscape:zoom="1.0742991" + inkscape:cx="421.67029" + inkscape:cy="173.13615" + inkscape:window-width="1920" + inkscape:window-height="1080" + inkscape:window-x="1024" + inkscape:window-y="320" + inkscape:window-maximized="1" + inkscape:current-layer="svg1" /> + <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.12;stroke-linecap:round;stroke-dasharray:none" + id="rect43" + width="43.029133" + height="9.2515631" + x="0" + y="0" + inkscape:label="background" + sodipodi:insensitive="true" /> + <path + style="fill:none;stroke:#000000;stroke-width:0.15;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#ArrowWideRounded)" + d="m 28.126132,4.6632845 h 3.912906" + id="path47" + sodipodi:nodetypes="cc" /> + <g + id="g32" + transform="translate(-4.9165476,-8.790818)"> + <rect + style="fill:none;stroke:#000000;stroke-width:0.15;stroke-linecap:round;stroke-dasharray:none" + id="rect30" + width="9.5689993" + height="9.1765642" + x="4.9915476" + y="8.865818" /> + <g + id="g8" + transform="matrix(0.24897664,0,0,0.24897664,6.7883275,9.4565047)"> + <path + d="M 13,3 H 8.2 C 7.0799,3 6.51984,3 6.09202,3.21799 5.71569,3.40973 5.40973,3.71569 5.21799,4.09202 5,4.51984 5,5.0799 5,6.2 v 11.6 c 0,1.1201 0,1.6802 0.21799,2.108 0.19174,0.3763 0.4977,0.6823 0.87403,0.874 C 6.51984,21 7.0799,21 8.2,21 h 7.6 c 1.1201,0 1.6802,0 2.108,-0.218 0.3763,-0.1917 0.6823,-0.4977 0.874,-0.874 C 19,19.4802 19,18.9201 19,17.8 V 9 M 13,3 19,9 M 13,3 v 4.4 c 0,0.56005 0,0.84008 0.109,1.05399 0.0959,0.18816 0.2488,0.34114 0.437,0.43702 C 13.7599,9 14.0399,9 14.6,9 H 19" + stroke="#000000" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" + id="path1" + style="stroke-width:0.6;stroke-dasharray:none" + sodipodi:nodetypes="csccssccssccsccccsccsc" /> + </g> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:1.2px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.03" + x="9.7730465" + y="16.96669" + id="text23"><tspan + sodipodi:role="line" + id="tspan23" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';text-align:center;text-anchor:middle;stroke-width:0.03" + x="9.7730465" + y="16.96669">document vide</tspan><tspan + sodipodi:role="line" + style="stroke-width:0.03" + x="9.7730465" + y="18.46669" + id="tspan24" /></text> + </g> + <g + id="g37" + transform="translate(11.776019,-8.790818)"> + <g + id="g35" + transform="matrix(0.24897664,0,0,0.24897664,6.7883275,9.4565047)" + style="fill:#8ae234"> + <path + d="M 13,3 H 8.2 C 7.0799,3 6.51984,3 6.09202,3.21799 5.71569,3.40973 5.40973,3.71569 5.21799,4.09202 5,4.51984 5,5.0799 5,6.2 v 11.6 c 0,1.1201 0,1.6802 0.21799,2.108 0.19174,0.3763 0.4977,0.6823 0.87403,0.874 C 6.51984,21 7.0799,21 8.2,21 h 7.6 c 1.1201,0 1.6802,0 2.108,-0.218 0.3763,-0.1917 0.6823,-0.4977 0.874,-0.874 C 19,19.4802 19,18.9201 19,17.8 V 9 M 13,3 19,9 M 13,3 v 4.4 c 0,0.56005 0,0.84008 0.109,1.05399 0.0959,0.18816 0.2488,0.34114 0.437,0.43702 C 13.7599,9 14.0399,9 14.6,9 H 19" + stroke="#000000" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" + id="path32" + style="fill:#8ae234;stroke-width:0.6;stroke-dasharray:none" + sodipodi:nodetypes="csccssccssccsccccsccsc" /> + <path + sodipodi:type="star" + style="fill:#4e9a06;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-dasharray:none" + id="path42-3" + inkscape:flatsided="false" + sodipodi:sides="5" + sodipodi:cx="800" + sodipodi:cy="393.00974" + sodipodi:r1="25.534424" + sodipodi:r2="12.767212" + sodipodi:arg1="0.57877055" + sodipodi:arg2="1.2070891" + inkscape:rounded="0" + inkscape:randomized="0" + d="m 821.37578,406.97694 -16.83395,-2.03517 -11.21995,12.71364 -3.26642,-16.63894 -15.55855,-6.74207 14.8152,-8.24827 1.60424,-16.88047 12.42271,11.54124 16.55002,-3.69064 -7.13754,15.38114 z" + transform="matrix(0.11600199,-0.03259077,0.03259077,0.11600199,-91.615361,-3.7970886)" + inkscape:transform-center-x="-0.0021907167" + inkscape:transform-center-y="0.071059887" /> + </g> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:1.2px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.03" + x="9.7730465" + y="16.96669" + id="text36"><tspan + sodipodi:role="line" + id="tspan35" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';text-align:center;text-anchor:middle;stroke-width:0.03" + x="9.7730465" + y="16.96669">ajout d’une figure</tspan><tspan + sodipodi:role="line" + style="stroke-width:0.03" + x="9.7730465" + y="18.46669" + id="tspan36" /></text> + <rect + style="fill:none;stroke:#000000;stroke-width:0.15;stroke-linecap:round;stroke-dasharray:none" + id="rect37" + width="10.499099" + height="9.1765642" + x="4.5264983" + y="8.865818" /> + </g> + <g + id="g42" + transform="translate(28.468587,-8.790818)"> + <g + id="g43"> + <path + d="M 10.025024,10.203435 H 8.8299359 c -0.2788787,0 -0.4183205,0 -0.5248377,0.05427 -0.093697,0.04774 -0.1698743,0.123916 -0.2176131,0.217613 -0.054274,0.106517 -0.054274,0.245959 -0.054274,0.524838 v 2.888129 c 0,0.278879 0,0.41833 0.054274,0.524843 0.047739,0.09369 0.1239157,0.169876 0.2176131,0.217605 0.1065172,0.05428 0.245959,0.05428 0.5248377,0.05428 h 1.8922221 c 0.278879,0 0.418331,0 0.524843,-0.05428 0.09369,-0.04773 0.169877,-0.123915 0.217606,-0.217605 0.05428,-0.106513 0.05428,-0.245964 0.05428,-0.524843 V 11.69729 m -1.49386,-1.493859 1.49386,1.493859 m -1.49386,-1.493859 v 1.095497 c 0,0.139439 0,0.20916 0.02714,0.262419 0.02388,0.04685 0.06195,0.08494 0.108803,0.108807 0.05326,0.02714 0.12297,0.02714 0.262421,0.02714 h 1.095498" + stroke="#000000" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" + id="path37" + style="fill:#4e9a06;stroke-width:0.149386;stroke-dasharray:none" + sodipodi:nodetypes="csccssccssccsccccsccsc" /> + <path + sodipodi:type="star" + style="fill:#8ae234;fill-opacity:1;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-dasharray:none" + id="path42" + inkscape:flatsided="false" + sodipodi:sides="5" + sodipodi:cx="800" + sodipodi:cy="393.00974" + sodipodi:r1="25.534424" + sodipodi:r2="12.767212" + sodipodi:arg1="0.57877055" + sodipodi:arg2="1.2070891" + inkscape:rounded="0" + inkscape:randomized="0" + d="m 821.37578,406.97694 -16.83395,-2.03517 -11.21995,12.71364 -3.26642,-16.63894 -15.55855,-6.74207 14.8152,-8.24827 1.60424,-16.88047 12.42271,11.54124 16.55002,-3.69064 -7.13754,15.38114 z" + transform="matrix(0.02804382,0.01065571,-0.01065571,0.02804382,-8.4710429,-7.0159011)" + inkscape:transform-center-x="0.00014145071" + inkscape:transform-center-y="-0.073017117" /> + </g> + <text + xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:1.2px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.03" + x="9.7730465" + y="16.96669" + id="text41"><tspan + sodipodi:role="line" + id="tspan40" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Fira Sans';-inkscape-font-specification:'Fira Sans';text-align:center;text-anchor:middle;stroke-width:0.03" + x="9.7730465" + y="16.96669">correction figure</tspan><tspan + sodipodi:role="line" + style="stroke-width:0.03" + x="9.7730465" + y="18.46669" + id="tspan41" /></text> + <rect + style="fill:none;stroke:#000000;stroke-width:0.15;stroke-linecap:round;stroke-dasharray:none" + id="rect41" + width="9.5689993" + height="9.1765642" + x="4.9915476" + y="8.865818" /> + <rect + style="fill:none;stroke:#000000;stroke-width:0.15;stroke-linecap:round;stroke-dasharray:none" + id="rect42" + width="9.5689993" + height="9.1765642" + x="4.9915476" + y="8.865818" /> + </g> + <g + id="g46" + style="stroke-width:0.21;stroke-dasharray:none" /> + <g + id="g47" + transform="translate(17.202002)" /> + <path + style="fill:none;stroke:#000000;stroke-width:0.15;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#ArrowWideRounded)" + d="m 10.945022,4.6632845 h 3.912906" + id="path48" + sodipodi:nodetypes="cc" /> +</svg> diff --git a/Makefile b/Makefile index 42a4a911cb8a915bb3c461669a53ae05baf0cf05..8deec96ce481584328a51bcb91bdfcab1bc3e49e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SHELL := /bin/bash +SHELL := /usr/bin/env bash BUILD_DIR := public SESSIONS := 01_initiation 02_gitlab_depot_distant 03_branches @@ -7,7 +7,7 @@ INDEXES := $(SESSIONS:%=$(BUILD_DIR)/%/index.html) build: $(INDEXES) -$(BUILD_DIR)/%/index.html:: %/index.qmd +$(BUILD_DIR)/%/index.html:: %/index.qmd %/*.qmd @echo -e "###\n# $@\n###" quarto render $< --output-dir $(BUILD_DIR) diff --git a/R_logo.png b/R_logo.png index 932f7a90ff501cecc88915ed80eeef10491e0439..c544f7b5288fbc31d4fc425bcb9b3e494b5633cf 100644 Binary files a/R_logo.png and b/R_logo.png differ diff --git a/VS_code_logo.png b/VS_code_logo.png index 9955e1851c6ea18e4cfb23880994e1a404133789..d402a8af264357b52553f50f47d0d1866861011b 100644 Binary files a/VS_code_logo.png and b/VS_code_logo.png differ diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000000000000000000000000000000000..fe9d3f5d577b5db676eeb246147d50dfc08bfdda --- /dev/null +++ b/flake.nix @@ -0,0 +1,80 @@ +{ + description = "Description for the project"; + + inputs = { + devenv-root = { + url = "file+file:///dev/null"; + flake = false; + }; + flake-parts.url = "github:hercules-ci/flake-parts"; + nixpkgs.url = "github:NixOS/nixpkgs"; + devenv.url = "github:cachix/devenv"; + }; + + nixConfig = { + extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="; + extra-substituters = "https://devenv.cachix.org"; + }; + + outputs = inputs @ { + flake-parts, + devenv-root, + ... + }: + flake-parts.lib.mkFlake {inherit inputs;} { + imports = [ + inputs.devenv.flakeModule + ]; + systems = ["x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; + + perSystem = { + config, + self', + inputs', + pkgs, + system, + ... + }: { + # Per-system attributes can be defined here. The self' and inputs' + # module parameters provide easy access to attributes of the same + # system. + + # Equivalent to inputs'.nixpkgs.legacyPackages.hello; + packages.default = pkgs.hello; + + devenv.shells.default = { + devenv.root = let + devenvRootFileContent = builtins.readFile devenv-root.outPath; + in + pkgs.lib.mkIf (devenvRootFileContent != "") devenvRootFileContent; + + name = "my-project"; + + imports = [ + # This is just like the imports in devenv.nix. + # See https://devenv.sh/guides/using-with-flake-parts/#import-a-devenv-module + # ./devenv-foo.nix + ]; + + # https://devenv.sh/reference/options/ + packages = [ + config.packages.default + pkgs.quarto + pkgs.gnumake + pkgs.python3 + ]; + + enterShell = '' + hello + ''; + + processes.hello.exec = "hello"; + }; + }; + flake = { + # The usual flake attributes can be defined here, including system- + # agnostic ones like nixosModule and system-enumerating ones, although + # those are more easily expressed in perSystem. + }; + }; +} diff --git a/ligne_de_commande_logo.png b/ligne_de_commande_logo.png index 48316e1686a65be8d2839927f1a837bca01c92fc..599dd30422d4a10c5c4cc61334686a80304ca2ee 100644 Binary files a/ligne_de_commande_logo.png and b/ligne_de_commande_logo.png differ