diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef8eeef0..e6b731f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,11 +6,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Install dependencies + run: bundle install - name: Build run: | git config user.name github-actions git config user.email github-actions@github.com - ruby build.rb + bundle exec ruby build.rb if ! git diff --exit-code then git add . diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000..6393cf22 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,6 @@ + + Layout/HashAlignment: + Enabled: false + + Layout/LeadingEmptyLines: + Enabled: false diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..632fced6 --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "liquid" +gem "base64" +gem "cgi" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..29d32bb0 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,29 @@ +GEM + remote: https://rubygems.org/ + specs: + base64 (0.3.0) + bigdecimal (4.1.2) + cgi (0.5.1) + liquid (5.12.0) + bigdecimal + strscan (>= 3.1.1) + strscan (3.1.8) + +PLATFORMS + arm64-darwin-24 + ruby + +DEPENDENCIES + base64 + cgi + liquid + +CHECKSUMS + base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b + bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd + cgi (0.5.1) sha256=e93fcafc69b8a934fe1e6146121fa35430efa8b4a4047c4893764067036f18e9 + liquid (5.12.0) sha256=5a3c2c2430cd925d21c53e4ed9abea52cd0a9da53b541422f81dee79aca2a673 + strscan (3.1.8) sha256=aae2db611a225559f21ffbb71765c9a4e60fd262534a9ea84f4f11c7f32f679e + +BUNDLED WITH + 4.0.10 diff --git a/LINUX.es.md b/LINUX.es.md index abe1f701..682125e7 100644 --- a/LINUX.es.md +++ b/LINUX.es.md @@ -203,12 +203,14 @@ Cuando termines, tu terminal debería lucir así: [direnv](https://direnv.net/) es una extensión del shell. Facilita trabajar con variables de entorno por proyecto, lo cual será útil para customizar el comportamiento de tu código. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + ## GitHub CLI CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando. @@ -505,8 +507,10 @@ Chequea si tienes `conda` instalado en tu computadora: ```bash conda list ``` + Si aparece `zsh: command not found: conda`, puedes **saltear** la desinstalación de `conda` e ir directo a la sección de **Instalar pre-requisitos**. +
Instrucciones de desinstalación conda @@ -520,11 +524,14 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup + ``` - Elimina el directorio Anaconda de tu `.bash_profile` - Abre el archivo con `code ~/.bash_profile` - Si el archivo abre, busca la línea que coincida con el siguiente patrón `export PATH="/path/to/anaconda3/bin:$PATH"` y eliminala + - Guarda el archivo con `CTRL` + `s` + - Reinicia la terminal con `exec zsh` - Remueve la inicializaciópn de Anaconda de tu `.zshrc`: - Abre el archivo con `code ~/.zshrc` @@ -612,11 +619,13 @@ pip install --upgrade pip Ahora instala algunos paquetes para las primeras semanas del programa: + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## Mejora Jupyter Notebook Mejora la visualización del [elemento `details` para revelación de información](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. diff --git a/LINUX.md b/LINUX.md index 51611c37..180207b0 100644 --- a/LINUX.md +++ b/LINUX.md @@ -227,12 +227,14 @@ At the end your terminal should look like this: [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + ## GitHub CLI CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface). @@ -520,8 +522,10 @@ Check if you have `conda` installed on your machine: ```bash conda list ``` + If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install `pyenv`** section. +
conda uninstall instructions @@ -535,11 +539,14 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup + ``` - Remove Anaconda path from your `.bash_profile` - Open the file with `code ~/.bash_profile` - If the file opens find the line matching the following pattern `export PATH="/path/to/anaconda3/bin:$PATH"` and delete the line + - Save the file with `CTRL` + `s` + - Restart your terminal with `exec zsh` - Remove Anaconda initialization from your `.zshrc`: - Open the file with `code ~/.zshrc` @@ -648,11 +655,13 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## Jupyter Notebook tweaking Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. @@ -926,10 +935,12 @@ Once the verification goes through, you should receive an email stating that "Yo - Authenticate the `gcloud` CLI with the google account you used for GCP + ```bash gcloud auth login ``` + - Login to your Google account on the new tab opened in your web browser - List your active account and check your email address you used for GCP is present ```bash diff --git a/LINUX_keep_current.es.md b/LINUX_keep_current.es.md index c9531854..67b418a9 100644 --- a/LINUX_keep_current.es.md +++ b/LINUX_keep_current.es.md @@ -86,10 +86,12 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Actualiza pyenv: + ``` bash cd $(pyenv root) && git pull ``` + Instala la versión actual de python: ```bash @@ -140,10 +142,12 @@ pyenv versions pip install -U pip ``` + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## GCP Asegúrate de que el comando `gcloud` esté conectado con el email de tu cuenta Google Cloud Platform: @@ -252,12 +256,14 @@ gcloud auth configure-docker ## Docker + Start Docker : ``` bash sudo service docker start ``` + Verifica que Docker pueda ejecutar la imagen de hello-world: ``` bash @@ -266,6 +272,7 @@ docker run hello-world 👉 Asegúrate de que este comando se ejecute completamente + Stop Docker : ``` bash @@ -273,6 +280,7 @@ sudo service docker stop ``` + ## Chequeo de la configuración de Python ### Chequeo de Python y packages diff --git a/LINUX_keep_current.md b/LINUX_keep_current.md index 68a85273..1ee086a1 100644 --- a/LINUX_keep_current.md +++ b/LINUX_keep_current.md @@ -86,10 +86,12 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Update pyenv : + ``` bash cd $(pyenv root) && git pull ``` + Install the current python version : ```bash @@ -140,10 +142,12 @@ pyenv versions pip install -U pip ``` + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## GCP Make sure that the `gcloud` command is linked to the email address of your Google Cloud Platform account : @@ -252,12 +256,14 @@ gcloud auth configure-docker ## Docker + Start Docker : ``` bash sudo service docker start ``` + Verify that Docker can run the hello-world image : ``` bash @@ -266,6 +272,7 @@ docker run hello-world 👉 Make sure that this command completes correctly + Stop Docker : ``` bash @@ -273,6 +280,7 @@ sudo service docker stop ``` + ## Python setup check ### Python and packages check diff --git a/REMOTE_SETUP.md b/REMOTE_SETUP.md index cb72a475..8dccf810 100644 --- a/REMOTE_SETUP.md +++ b/REMOTE_SETUP.md @@ -502,12 +502,14 @@ At the end your terminal should look like this: [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + ## GitHub CLI CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface). @@ -884,11 +886,13 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## Jupyter Notebook tweaking Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. diff --git a/VM.es.md b/VM.es.md index f1a9d5a4..6e577c9f 100644 --- a/VM.es.md +++ b/VM.es.md @@ -370,12 +370,14 @@ Cuando termines, tu terminal debería lucir así: [direnv](https://direnv.net/) es una extensión del shell. Facilita trabajar con variables de entorno por proyecto, lo cual será útil para customizar el comportamiento de tu código. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + ## GitHub CLI CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando. @@ -756,11 +758,13 @@ pip install --upgrade pip Ahora instala algunos paquetes para las primeras semanas del programa: + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## Mejora Jupyter Notebook Mejora la visualización del [elemento `details` para revelación de información](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. diff --git a/VM.md b/VM.md index 80597d71..ba150d9d 100644 --- a/VM.md +++ b/VM.md @@ -485,12 +485,14 @@ At the end your terminal should look like this: [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + ## GitHub CLI CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface). @@ -981,11 +983,13 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## Jupyter Notebook tweaking Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. diff --git a/WINDOWS.es.md b/WINDOWS.es.md index 435de86d..0d4a1c8b 100644 --- a/WINDOWS.es.md +++ b/WINDOWS.es.md @@ -655,12 +655,14 @@ No dudes en **pedirle ayuda a tu profesor**. [direnv](https://direnv.net/) es una extensión del shell. Facilita trabajar con variables de entorno por proyecto, lo cual será útil para customizar el comportamiento de tu código. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + ## GitHub CLI CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando. @@ -957,8 +959,10 @@ Chequea si tienes `conda` instalado en tu computadora: ```bash conda list ``` + Si aparece `zsh: command not found: conda`, puedes **saltear** la desinstalación de `conda` e ir directo a la sección de **Instalar pre-requisitos**. +
Instrucciones de desinstalación conda @@ -972,10 +976,12 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup + ``` - Elimina el directorio Anaconda de tu `.bash_profile` - Abre el archivo con `code ~/.bash_profile` - Si el archivo abre, busca la línea que coincida con el siguiente patrón `export PATH="/path/to/anaconda3/bin:$PATH"` y eliminala + - Reinicia la terminal con `exec zsh` - Remueve la inicializaciópn de Anaconda de tu `.zshrc`: - Abre el archivo con `code ~/.zshrc` @@ -1063,11 +1069,13 @@ pip install --upgrade pip Ahora instala algunos paquetes para las primeras semanas del programa: + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## Mejora Jupyter Notebook Mejora la visualización del [elemento `details` para revelación de información](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. diff --git a/WINDOWS.md b/WINDOWS.md index 42981174..4370032a 100644 --- a/WINDOWS.md +++ b/WINDOWS.md @@ -670,12 +670,14 @@ Do not hesitate to **contact a teacher**. [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. + ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + ## GitHub CLI CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface). @@ -963,8 +965,10 @@ Check if you have `conda` installed on your machine: ```bash conda list ``` + If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install `pyenv`** section. +
conda uninstall instructions @@ -978,10 +982,12 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup + ``` - Remove Anaconda path from your `.bash_profile` - Open the file with `code ~/.bash_profile` - If the file opens find the line matching the following pattern `export PATH="/path/to/anaconda3/bin:$PATH"` and delete the line + - Restart your terminal with `exec zsh` - Remove Anaconda initialization from your `.zshrc`: - Open the file with `code ~/.zshrc` @@ -1090,11 +1096,13 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## Jupyter Notebook tweaking Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. @@ -1500,10 +1508,12 @@ Once the verification goes through, you should receive an email stating that "Yo - Authenticate the `gcloud` CLI with the google account you used for GCP + ```bash gcloud auth login --no-launch-browser ``` + - Login to your Google account on the new tab opened in your web browser - List your active account and check your email address you used for GCP is present ```bash diff --git a/WINDOWS_keep_current.es.md b/WINDOWS_keep_current.es.md index c02696f9..9106eb0f 100644 --- a/WINDOWS_keep_current.es.md +++ b/WINDOWS_keep_current.es.md @@ -86,10 +86,12 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Actualiza pyenv: + ``` bash cd $(pyenv root) && git pull ``` + Instala la versión actual de python: ```bash @@ -140,10 +142,12 @@ pyenv versions pip install -U pip ``` + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## GCP Asegúrate de que el comando `gcloud` esté conectado con el email de tu cuenta Google Cloud Platform: @@ -252,8 +256,10 @@ gcloud auth configure-docker ## Docker + Start the Docker Desktop app + Verifica que Docker pueda ejecutar la imagen de hello-world: ``` bash @@ -262,9 +268,11 @@ docker run hello-world 👉 Asegúrate de que este comando se ejecute completamente + Stop the Docker Desktop app + ## Chequeo de la configuración de Python ### Chequeo de Python y packages diff --git a/WINDOWS_keep_current.md b/WINDOWS_keep_current.md index bfddaf6d..f12ea962 100644 --- a/WINDOWS_keep_current.md +++ b/WINDOWS_keep_current.md @@ -86,10 +86,12 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Update pyenv : + ``` bash cd $(pyenv root) && git pull ``` + Install the current python version : ```bash @@ -140,10 +142,12 @@ pyenv versions pip install -U pip ``` + ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` + ## GCP Make sure that the `gcloud` command is linked to the email address of your Google Cloud Platform account : @@ -252,8 +256,10 @@ gcloud auth configure-docker ## Docker + Start the Docker Desktop app + Verify that Docker can run the hello-world image : ``` bash @@ -262,9 +268,11 @@ docker run hello-world 👉 Make sure that this command completes correctly + Stop the Docker Desktop app + ## Python setup check ### Python and packages check diff --git a/_partials/conda_uninstall.md b/_partials/conda_uninstall.md index 388aed7f..e27129ee 100644 --- a/_partials/conda_uninstall.md +++ b/_partials/conda_uninstall.md @@ -9,15 +9,13 @@ Check if you have `conda` installed on your machine: ```bash conda list ``` -$MAC_START +{% if os == "macos" %} If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install pre-requisites** section. -$MAC_END -$LINUX_START +{% elsif os == "linux" %} If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install `pyenv`** section. -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install `pyenv`** section. -$WINDOWS_END +{% endif %}
conda uninstall instructions @@ -32,19 +30,18 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup -$MAC_START +{% if os == "macos" %} rm -rf ~/opt -$MAC_END +{% endif %} ``` - Remove Anaconda path from your `.bash_profile` - Open the file with `code ~/.bash_profile` - If the file opens find the line matching the following pattern `export PATH="/path/to/anaconda3/bin:$PATH"` and delete the line -$MAC_START +{% if os == "macos" %} - Save the file with `CMD` + `s` -$MAC_END -$LINUX_START +{% elsif os == "linux" %} - Save the file with `CTRL` + `s` -$LINUX_END +{% endif %} - Restart your terminal with `exec zsh` - Remove Anaconda initialization from your `.zshrc`: - Open the file with `code ~/.zshrc` diff --git a/_partials/direnv.md b/_partials/direnv.md index 2370ae71..2e434226 100644 --- a/_partials/direnv.md +++ b/_partials/direnv.md @@ -2,21 +2,19 @@ [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. -$MAC_START +{% if os == "macos" %} ``` bash brew install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -$LINUX_END +{% endif %} diff --git a/_partials/dotfiles_merge_upstream.md b/_partials/dotfiles_merge_upstream.md index 9fdfa16e..879e87f5 100644 --- a/_partials/dotfiles_merge_upstream.md +++ b/_partials/dotfiles_merge_upstream.md @@ -28,11 +28,11 @@ Time to merge the changes from `lewagon/dotfiles` into yours: First abort the merge: `git merge --abort`. - Run ` .` + Run `{{ CODE_EDITOR_CMD }} .` - In , open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. + In {{ CODE_EDITOR }}, open the `zshrc` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Save to disk. - Still in , open the `zprofile` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Save to disk. + Still in {{ CODE_EDITOR }}, open the `zprofile` file. Replace its content with the [newest version](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Save to disk. Back in the terminal, run a `git diff` and check if this didn't remove any personal configuration setting that you wanted to keep. diff --git a/_partials/es/conda_uninstall.md b/_partials/es/conda_uninstall.md index a61aa84a..72dbaa7b 100644 --- a/_partials/es/conda_uninstall.md +++ b/_partials/es/conda_uninstall.md @@ -9,15 +9,13 @@ Chequea si tienes `conda` instalado en tu computadora: ```bash conda list ``` -$MAC_START +{% if os == "macos" %} Si aparece `zsh: command not found: conda`, puedes **saltear** la desinstalación de `conda` e ir directo a la sección de **Instalar pre-requisitos**. -$MAC_END -$LINUX_START +{% elsif os == "linux" %} Si aparece `zsh: command not found: conda`, puedes **saltear** la desinstalación de `conda` e ir directo a la sección de **Instalar pre-requisitos**. -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} Si aparece `zsh: command not found: conda`, puedes **saltear** la desinstalación de `conda` e ir directo a la sección de **Instalar pre-requisitos**. -$WINDOWS_END +{% endif %}
Instrucciones de desinstalación conda @@ -32,19 +30,18 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup -$MAC_START +{% if os == "macos" %} rm -rf ~/opt -$MAC_END +{% endif %} ``` - Elimina el directorio Anaconda de tu `.bash_profile` - Abre el archivo con `code ~/.bash_profile` - Si el archivo abre, busca la línea que coincida con el siguiente patrón `export PATH="/path/to/anaconda3/bin:$PATH"` y eliminala -$MAC_START +{% if os == "macos" %} - Guarda el archivo con `CMD` + `s` -$MAC_END -$LINUX_START +{% elsif os == "linux" %} - Guarda el archivo con `CTRL` + `s` -$LINUX_END +{% endif %} - Reinicia la terminal con `exec zsh` - Remueve la inicializaciópn de Anaconda de tu `.zshrc`: - Abre el archivo con `code ~/.zshrc` diff --git a/_partials/es/direnv.md b/_partials/es/direnv.md index 28901f91..989ab657 100644 --- a/_partials/es/direnv.md +++ b/_partials/es/direnv.md @@ -2,21 +2,19 @@ [direnv](https://direnv.net/) es una extensión del shell. Facilita trabajar con variables de entorno por proyecto, lo cual será útil para customizar el comportamiento de tu código. -$MAC_START +{% if os == "macos" %} ``` bash brew install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash sudo apt-get update; sudo apt-get install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` -$LINUX_END +{% endif %} diff --git a/_partials/es/dotfiles_merge_upstream.md b/_partials/es/dotfiles_merge_upstream.md index 71509a62..06498340 100644 --- a/_partials/es/dotfiles_merge_upstream.md +++ b/_partials/es/dotfiles_merge_upstream.md @@ -29,11 +29,11 @@ Es hora de fusionar los cambios de lewagon/dotfiles en los tuyos: Primero aborta la merge: `git merge --abort`. - Ejecuta ` .` + Ejecuta `{{ CODE_EDITOR_CMD }} .` - En , abre el archivo zshrc. Reemplaza su contenido con la [versión más reciente](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Luego guárdalo en el disco. + En {{ CODE_EDITOR }}, abre el archivo zshrc. Reemplaza su contenido con la [versión más reciente](https://raw.githubusercontent.com/lewagon/dotfiles/master/zshrc). Luego guárdalo en el disco. - Aún en , abre el archivo `zprofile`. Reemplaza su contenido con la [versión más reciente](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Luego guárdalo en el disco. + Aún en {{ CODE_EDITOR }}, abre el archivo `zprofile`. Reemplaza su contenido con la [versión más reciente](https://raw.githubusercontent.com/lewagon/dotfiles/master/zprofile). Luego guárdalo en el disco. Regresa a la terminal y ejecuta un `git diff` y verifica que esto no haya eliminado ninguna configuración personal que quisieras conservar. diff --git a/_partials/es/keep_current.md b/_partials/es/keep_current.md index 45fafd5f..8cf7b7c0 100644 --- a/_partials/es/keep_current.md +++ b/_partials/es/keep_current.md @@ -86,26 +86,24 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Actualiza pyenv: -$MAC_START +{% if os == "macos" %} ``` bash brew update && brew upgrade pyenv ``` -$MAC_END -$LINUX_START +{% elsif os == "linux" %} ``` bash cd $(pyenv root) && git pull ``` -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash cd $(pyenv root) && git pull ``` -$WINDOWS_END +{% endif %} Instala la versión actual de python: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` 👉 Asegúrate de que el comando se ejecute completamente y luego **reinicia tu terminal**. @@ -119,7 +117,7 @@ pyenv virtualenv-delete lewagon_current Crea un nuevo ambiente virtual: ```bash -pyenv virtualenv lewagon_current +pyenv virtualenv {{ PYTHON_VERSION }} lewagon_current ``` Define el nuevo ambiente virtual como predeterminado: @@ -138,8 +136,8 @@ pyenv versions ``` bash system - - /envs/lewagon_current + {{ PYTHON_VERSION }} + {{ PYTHON_VERSION }}/envs/lewagon_current 3.7.6 3.7.6/envs/lewagon * lewagon_current @@ -152,7 +150,7 @@ pyenv versions pip install -U pip ``` -$MAC_START +{% if os == "macos" %} Si tu computadora usa **Apple Silicon**, expande el párrafo de abajo y léelo. Si no es el caso, ignóralo.
@@ -172,17 +170,15 @@ Si tu computadora usa **Apple Intel**, expande el párrafo de abajo y léelo. Si pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_intel.txt ```
-$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -$LINUX_END +{% endif %} ## GCP @@ -292,19 +288,17 @@ gcloud auth configure-docker ## Docker -$MAC_START +{% if os == "macos" %} Start the Docker app -$MAC_END -$LINUX_START +{% elsif os == "linux" %} Start Docker : ``` bash sudo service docker start ``` -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} Start the Docker Desktop app -$WINDOWS_END +{% endif %} Verifica que Docker pueda ejecutar la imagen de hello-world: @@ -314,16 +308,14 @@ docker run hello-world 👉 Asegúrate de que este comando se ejecute completamente -$MAC_START +{% if os == "macos" %} Stop the Docker app -$MAC_END -$LINUX_START +{% elsif os == "linux" %} Stop Docker : ``` bash sudo service docker stop ``` -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} Stop the Docker Desktop app -$WINDOWS_END +{% endif %} diff --git a/_partials/es/osx_python.md b/_partials/es/osx_python.md index 7bcafb0c..1bd23661 100644 --- a/_partials/es/osx_python.md +++ b/_partials/es/osx_python.md @@ -36,7 +36,7 @@ exec zsh Instala la [última versión estable de Python](https://www.python.org/doc/versions/) aceptada en el currículum de Le Wagon: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` Este comando puede tomar un tiempo en ejecutarse. Esto es completamente normal. ¡No dudes en ayudar a los estudiantes que estén sentados cerca de ti! @@ -61,7 +61,7 @@ export CPPFLAGS="-I/usr/local/opt/zlib/include" Luego trata de instalar Python nuevamente: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` Es posible que aparezca otro error relacionado con `bzip2`. Esto lo puedes ignorar y continuar al paso siguiente. @@ -72,8 +72,8 @@ Es posible que aparezca otro error relacionado con `bzip2`. Esto lo puedes ignor OK. Cuando este comando termine de ejecutarse, le diremos al sistema que use esta versión de Python **por defecto**. Esto se hace con: ```bash -pyenv global +pyenv global {{ PYTHON_VERSION }} exec zsh ``` -Para verificar si esto ha funcionado, ejecuta `python --version`. Si ves ``, ¡todo está bien! Si no, pídele ayuda a un TA para resolver el problema por medio `pyenv versions` y `type -a python` (`python` debería estar usando la versión `.pyenv/shims` de primero). +Para verificar si esto ha funcionado, ejecuta `python --version`. Si ves `{{ PYTHON_VERSION }}`, ¡todo está bien! Si no, pídele ayuda a un TA para resolver el problema por medio `pyenv versions` y `type -a python` (`python` debería estar usando la versión `.pyenv/shims` de primero). diff --git a/_partials/es/pip.md b/_partials/es/pip.md index 73364c74..6d12d725 100644 --- a/_partials/es/pip.md +++ b/_partials/es/pip.md @@ -10,7 +10,7 @@ pip install --upgrade pip Ahora instala algunos paquetes para las primeras semanas del programa: -$MAC_START +{% if os == "macos" %} Si tu computadora usa **Apple Silicon**, expande el párrafo de abajo y léelo. Si no es el caso, ignóralo.
@@ -30,14 +30,12 @@ Si tu computadora usa **Apple Intel**, expande el párrafo de abajo y léelo. Si pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_intel.txt ```
-$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -$LINUX_END +{% endif %} diff --git a/_partials/es/python_checkup.md b/_partials/es/python_checkup.md index cab57c6e..9fe5ab2e 100644 --- a/_partials/es/python_checkup.md +++ b/_partials/es/python_checkup.md @@ -10,17 +10,17 @@ cd ~/code && exec zsh Verifica tu versión de Python con los siguientes comandos: ```bash -zsh -c "$(curl -fsSL )" +zsh -c "$(curl -fsSL {{ PYTHON_CHECKER_URL }})" {{ PYTHON_VERSION }} ``` Ejecuta el comando siguiente para verificar que hayas instalado los paquetes requeridos correctamente: ```bash -zsh -c "$(curl -fsSL )" +zsh -c "$(curl -fsSL {{ PIP_CHECKER_URL }})" ``` Ahora ejecuta el siguiente comando para verificar que puedas cargar estos paquetes: ```bash -python -c "$(curl -fsSL )" +python -c "$(curl -fsSL {{ PIP_LOADER_URL }})" ``` ### Chequeo de Jupyter @@ -48,7 +48,7 @@ Asegúrate de que estés usando la versión correcta de python en el notebook. A import sys; sys.version ``` -Debería mostrar `` seguido de algunos detalles adicionales. Si no es así, consulta con un TA. +Debería mostrar `{{ PYTHON_VERSION }}` seguido de algunos detalles adicionales. Si no es así, consulta con un TA. Puedes cerrar tu navegador web y luego cerrar el servidor jupyter con `CTRL` + `C`. diff --git a/_partials/es/ubuntu_python.md b/_partials/es/ubuntu_python.md index a2ffa5fd..1a90ee9e 100644 --- a/_partials/es/ubuntu_python.md +++ b/_partials/es/ubuntu_python.md @@ -23,7 +23,7 @@ python3-dev Instala la [última versión estable de Python](https://www.python.org/doc/versions/) que sea aceptada en el currículum de Le Wagon: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` Este comando puede tomar un tiempo en ejecutarse. Esto es completamente normal. ¡No dudes en ayudar a los estudiantes que estén sentados cerca de ti! @@ -31,8 +31,8 @@ Este comando puede tomar un tiempo en ejecutarse. Esto es completamente normal. OK. Cuando este comando termine de ejecutarse, le diremos al sistema que use esta versión de Python **por defecto**. Esto se hace con: ```bash -pyenv global +pyenv global {{ PYTHON_VERSION }} exec zsh ``` -Para verificar que esto haya funcionado, ejecuta `python --version`. Si ves ``, ¡todo está bien! Si no, pídele ayuda a un TA para resolver el problema por medio de `versiones de pyenv` y `type -a python` (`python` debería estar usando la versión `.pyenv/shims` de primero). +Para verificar que esto haya funcionado, ejecuta `python --version`. Si ves `{{ PYTHON_VERSION }}`, ¡todo está bien! Si no, pídele ayuda a un TA para resolver el problema por medio de `versiones de pyenv` y `type -a python` (`python` debería estar usando la versión `.pyenv/shims` de primero). diff --git a/_partials/es/virtualenv.md b/_partials/es/virtualenv.md index 577d67f0..1f00a287 100644 --- a/_partials/es/virtualenv.md +++ b/_partials/es/virtualenv.md @@ -14,7 +14,7 @@ exec zsh Crea el entorno virtual que usaremos durante todo el bootcamp: ```bash -pyenv virtualenv lewagon +pyenv virtualenv {{ PYTHON_VERSION }} lewagon ``` Define el entorno virtual con lo siguiente: diff --git a/_partials/gcp_setup.md b/_partials/gcp_setup.md index 599a20c1..fb4c6d43 100644 --- a/_partials/gcp_setup.md +++ b/_partials/gcp_setup.md @@ -127,21 +127,19 @@ Once the verification goes through, you should receive an email stating that "Yo - Authenticate the `gcloud` CLI with the google account you used for GCP -$MAC_START +{% if os == "macos" %} ```bash gcloud auth login ``` -$MAC_END -$LINUX_START +{% elsif os == "linux" %} ```bash gcloud auth login ``` -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} ```bash gcloud auth login --no-launch-browser ``` -$WINDOWS_END +{% endif %} - Login to your Google account on the new tab opened in your web browser - List your active account and check your email address you used for GCP is present diff --git a/_partials/keep_current.md b/_partials/keep_current.md index 86f48134..b838ee8c 100644 --- a/_partials/keep_current.md +++ b/_partials/keep_current.md @@ -86,26 +86,24 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Update pyenv : -$MAC_START +{% if os == "macos" %} ``` bash brew update && brew upgrade pyenv ``` -$MAC_END -$LINUX_START +{% elsif os == "linux" %} ``` bash cd $(pyenv root) && git pull ``` -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash cd $(pyenv root) && git pull ``` -$WINDOWS_END +{% endif %} Install the current python version : ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` 👉 Make sure that the command completes correctly and **restart your terminal** @@ -119,7 +117,7 @@ pyenv virtualenv-delete lewagon_current Create a new virtual environment : ```bash -pyenv virtualenv lewagon_current +pyenv virtualenv {{ PYTHON_VERSION }} lewagon_current ``` Set the new virtual environment as default : @@ -138,8 +136,8 @@ pyenv versions ``` bash system - - /envs/lewagon_current + {{ PYTHON_VERSION }} + {{ PYTHON_VERSION }}/envs/lewagon_current 3.10.6 3.10.6/envs/lewagon * lewagon_current @@ -152,7 +150,7 @@ pyenv versions pip install -U pip ``` -$MAC_START +{% if os == "macos" %} If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it.
@@ -172,17 +170,15 @@ If your computer uses **Apple Intel**, expand the paragraph below and go through pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_intel.txt ```
-$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -$LINUX_END +{% endif %} ## GCP @@ -292,19 +288,17 @@ gcloud auth configure-docker ## Docker -$MAC_START +{% if os == "macos" %} Start the Docker app -$MAC_END -$LINUX_START +{% elsif os == "linux" %} Start Docker : ``` bash sudo service docker start ``` -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} Start the Docker Desktop app -$WINDOWS_END +{% endif %} Verify that Docker can run the hello-world image : @@ -314,16 +308,14 @@ docker run hello-world 👉 Make sure that this command completes correctly -$MAC_START +{% if os == "macos" %} Stop the Docker app -$MAC_END -$LINUX_START +{% elsif os == "linux" %} Stop Docker : ``` bash sudo service docker stop ``` -$LINUX_END -$WINDOWS_START +{% elsif os == "windows" %} Stop the Docker Desktop app -$WINDOWS_END +{% endif %} diff --git a/_partials/osx_python.md b/_partials/osx_python.md index 8fdca592..17af7b48 100644 --- a/_partials/osx_python.md +++ b/_partials/osx_python.md @@ -36,7 +36,7 @@ exec zsh Let's install the [latest stable version of Python](https://www.python.org/doc/versions/) supported by Le Wagon's curriculum: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` This command might take a while, this is perfectly normal. Don't hesitate to help other students seated next to you! @@ -53,7 +53,7 @@ source ~/.zprofile Then try to install Python again: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` If `pyenv` is still not found, contact a teacher. @@ -81,7 +81,7 @@ export CPPFLAGS="-I/usr/local/opt/zlib/include" Then try to install Python again: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` It could raise another error about `bzip2`, you can ignore it and continue to the next step. @@ -92,8 +92,8 @@ It could raise another error about `bzip2`, you can ignore it and continue to th OK once this command is complete, we are going to tell the system to use this version of Python **by default**. This is done with: ```bash -pyenv global +pyenv global {{ PYTHON_VERSION }} exec zsh ``` -To check if this worked, run `python --version`. If you see ``, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). +To check if this worked, run `python --version`. If you see `{{ PYTHON_VERSION }}`, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). diff --git a/_partials/pip.md b/_partials/pip.md index 5147270c..090cb7a1 100644 --- a/_partials/pip.md +++ b/_partials/pip.md @@ -10,7 +10,7 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: -$MAC_START +{% if os == "macos" %} If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it.
@@ -30,14 +30,12 @@ If your computer uses **Apple Intel**, expand the paragraph below and go through pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/apple_intel.txt ```
-$MAC_END -$WINDOWS_START +{% elsif os == "windows" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -$WINDOWS_END -$LINUX_START +{% elsif os == "linux" %} ``` bash pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs/releases/linux.txt ``` -$LINUX_END +{% endif %} diff --git a/_partials/python_checkup.md b/_partials/python_checkup.md index 81466919..fd8439c3 100644 --- a/_partials/python_checkup.md +++ b/_partials/python_checkup.md @@ -10,17 +10,17 @@ cd ~/code && exec zsh Check your Python version with the following commands: ```bash -zsh -c "$(curl -fsSL )" +zsh -c "$(curl -fsSL {{ PYTHON_CHECKER_URL }})" {{ PYTHON_VERSION }} ``` Run the following command to check if you successfully installed the required packages: ```bash -zsh -c "$(curl -fsSL )" +zsh -c "$(curl -fsSL {{ PIP_CHECKER_URL }})" ``` Now run the following command to check if you can load these packages: ```bash -python -c "$(curl -fsSL )" +python -c "$(curl -fsSL {{ PIP_LOADER_URL }})" ``` ### Jupyter check @@ -78,7 +78,7 @@ Make sure that you are running the correct python version in the notebook. Open import sys; sys.version ``` -It should output `` followed by some more details. If not, check with a TA. +It should output `{{ PYTHON_VERSION }}` followed by some more details. If not, check with a TA. You can close your web browser then terminate the jupyter server with `CTRL` + `C`. diff --git a/_partials/ubuntu_python.md b/_partials/ubuntu_python.md index 6584fc6c..5531d17c 100644 --- a/_partials/ubuntu_python.md +++ b/_partials/ubuntu_python.md @@ -23,7 +23,7 @@ python3-dev Let's install the [latest stable version of Python](https://www.python.org/doc/versions/) supported by Le Wagon's curriculum: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` This command might take a while, this is perfectly normal. Don't hesitate to help other students seated next to you! @@ -40,7 +40,7 @@ source ~/.zprofile Then try to install Python again: ```bash -pyenv install +pyenv install {{ PYTHON_VERSION }} ``` If `pyenv` is still not found, contact a teacher. @@ -52,8 +52,8 @@ If `pyenv` is still not found, contact a teacher. OK once this command is complete, we are going to tell the system to use this version of Python **by default**. This is done with: ```bash -pyenv global +pyenv global {{ PYTHON_VERSION }} exec zsh ``` -To check if this worked, run `python --version`. If you see ``, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). +To check if this worked, run `python --version`. If you see `{{ PYTHON_VERSION }}`, perfect! If not, ask a TA that will help you debug the problem thanks to `pyenv versions` and `type -a python` (`python` should be using the `.pyenv/shims` version first). diff --git a/_partials/virtualenv.md b/_partials/virtualenv.md index e7b9ca13..87a81425 100644 --- a/_partials/virtualenv.md +++ b/_partials/virtualenv.md @@ -14,7 +14,7 @@ exec zsh Let's create the virtual environment we are going to use during the whole bootcamp: ```bash -pyenv virtualenv lewagon +pyenv virtualenv {{ PYTHON_VERSION }} lewagon ``` Let's now set the virtual environment with: diff --git a/build.rb b/build.rb index 7c1fb6be..702f5a5c 100755 --- a/build.rb +++ b/build.rb @@ -1,319 +1,22 @@ -#!/usr/bin/env ruby -wU +#!/usr/bin/env ruby +# frozen_string_literal: true -require 'open-uri' +require 'yaml' +require_relative 'lib/builder' -CONSTANTS = { - 'PYTHON_VERSION' => '3.12.9', - 'PYTHON_CHECKER_URL' => 'https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh', - 'PIP_CHECKER_URL' => 'https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh', - 'PIP_LOADER_URL' => 'https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py', - 'CODE_EDITOR' => 'VS Code', - 'CODE_EDITOR_CMD' => 'code' -} - -# NOTE(ssaunier): This script needs https://github.com/lewagon/setup to be cloned as well -MAC_OS = %w[ - intro - setup/github - osx_silicon - setup/macos_command_line_tools - homebrew - setup/macos_vscode - vscode_extensions - setup/vscode_aifeatures - setup/oh_my_zsh - direnv - setup/gh_cli - dotfiles - dotfiles_new_student - dotfiles_new_laptop - dotfiles_merge_upstream - dotfiles_same_laptop - dotfiles_merge_upstream - dotfiles_installer - conda_uninstall - osx_python - virtualenv - pip - nbextensions - python_checkup - dbeaver - docker - gcp_cli_setup - gcp_setup - gcp_setup_mid - gcp_setup_end - kitt - setup/macos_slack - setup/slack_settings - setup/macos_settings - kata -].freeze - -MAC_OS_KC = %w[ - keep_current - python_checkup -].freeze - -WINDOWS = %w[ - intro - setup/github - setup/windows_version - setup/windows_virtualization - setup/windows_wsl - setup/windows_ubuntu - setup/windows_vscode - setup/windows_terminal - vscode_extensions - setup/vscode_aifeatures - setup/cli_tools - setup/oh_my_zsh - windows_browser - direnv - setup/gh_cli - ubuntu_gcloud - dotfiles - dotfiles_new_student - dotfiles_new_laptop - dotfiles_merge_upstream - dotfiles_same_laptop - dotfiles_merge_upstream - dotfiles_installer - setup/ssh_agent - conda_uninstall - ubuntu_python - virtualenv - pip - nbextensions - win_jupyter - python_checkup - dbeaver - setup/windows_settings - win_vs_redistributable - win_docker - gcp_setup - gcp_setup_wsl - gcp_setup_end - kitt - setup/windows_slack - setup/slack_settings - kata -].freeze - -WINDOWS_KC = %w[ - keep_current - python_checkup -].freeze - -LINUX = %w[ - intro - setup/github - setup/ubuntu_vscode - vscode_extensions - setup/vscode_aifeatures - setup/cli_tools - setup/oh_my_zsh - direnv - setup/gh_cli - ubuntu_gcloud - dotfiles - dotfiles_new_student - dotfiles_new_laptop - dotfiles_merge_upstream - dotfiles_same_laptop - dotfiles_merge_upstream - dotfiles_installer - setup/ssh_agent - conda_uninstall - ubuntu_python - virtualenv - pip - nbextensions - python_checkup - dbeaver - ubuntu_docker - gcp_setup - gcp_setup_linux - gcp_setup_end - kitt - setup/ubuntu_slack - setup/slack_settings - kata -] +build_specs = Dir['builds/*.yml'].map { |filename| -LINUX_KC = %w[ - keep_current - python_checkup -] + data = YAML.load_file(filename) -# student installs vscode, creates gcp vm, runs setup on vm -VM = %w[ - intro - setup/github - de_setup/ssh_key - de_setup/gcp_setup - de_setup/virtual_machine - de_setup/win_vscode - de_setup/vscode_remote_ssh - vscode_extensions - setup/vscode_aifeatures - setup/cli_tools - setup/oh_my_zsh - direnv - setup/gh_cli - de_setup/ubuntu_gcloud - de_setup/gcp_setup_linux - dotfiles - dotfiles_new_student - dotfiles_new_laptop - dotfiles_merge_upstream - dotfiles_same_laptop - dotfiles_merge_upstream - dotfiles_installer - de_setup/zsh_default_terminal - setup/ssh_agent - ubuntu_python - virtualenv - pip - nbextensions - python_checkup - dbeaver - ubuntu_docker - kitt - setup/windows_slack - setup/slack_settings - kata -] - -# student installs vscode, redeems vm provided by lewagon, runs setup on vm -REMOTE_SETUP = %w[ - intro - setup/github - de_setup/ssh_key - vm_register - vm_start - vm_test - de_setup/win_vscode - de_setup/vscode_remote_ssh - vscode_extensions - setup/vscode_aifeatures - setup/cli_tools - setup/oh_my_zsh - direnv - setup/gh_cli - #de_setup/ubuntu_gcloud - #de_setup/gcp_setup_linux - dotfiles - dotfiles_new_student - dotfiles_new_laptop - dotfiles_merge_upstream - dotfiles_same_laptop - dotfiles_merge_upstream - dotfiles_installer - de_setup/zsh_default_terminal - setup/ssh_agent - ubuntu_python - virtualenv - pip - nbextensions - python_checkup - dbeaver - ubuntu_docker - #de_setup/gcp_setup - #kitt - #setup/windows_slack - #setup/slack_settings - #kata - vm_stop - end -] - -LOCALES = ["", "es"] # english + spanish locales -ENGLISH_ONLY = %w[REMOTE_SETUP].freeze - -FILENAMES = { - "WINDOWS" => ["WINDOWS", WINDOWS], - "macOS" => ["macOS", MAC_OS], - "LINUX" => ["LINUX", LINUX], - "WINDOWS_keep_current" => ["WINDOWS", WINDOWS_KC], - "macOS_keep_current" => ["macOS", MAC_OS_KC], - "LINUX_keep_current" => ["LINUX", LINUX_KC], - "VM" => ["LINUX", VM], - "REMOTE_SETUP" => ["LINUX", REMOTE_SETUP] + BuildSpec.new( + name: File.basename(filename, '.yml'), + os: data['os'], + locales: data['locales'], + partials: data['partials'] + ) } -DELIMITERS = { - "WINDOWS" => ["\\$WINDOWS_START\n", "\\$WINDOWS_END\n"], - "macOS" => ["\\$MAC_START\n", "\\$MAC_END\n"], - "LINUX" => ["\\$LINUX_START\n", "\\$LINUX_END\n"], -} - -def load_partial(partial, locale) - match_setup = partial.match(/setup\/(?[0-9a-z_]+)/) - match_de_setup = partial.match(/de_setup\/(?[0-9a-z_]+)/) - if match_de_setup - partial = match_de_setup[:partial] - elsif match_setup - partial = match_setup[:partial] - end - partial = File.join(locale, partial) unless locale.empty? - file = File.join("_partials", "#{partial}.md") - if match_de_setup - content = URI.open(File.join("https://raw.githubusercontent.com/lewagon/data-engineering-setup/main", file)) - .read - # replace data-setup repo relative path by data-engineering-setup repo URL - image_paths = content.scan(/\!\[.*\]\((.*)\)/).flatten - image_paths.reject { |ip| ip.start_with?("http") }.each { |ip| content.gsub!(ip, "https://github.com/lewagon/data-engineering-setup/blob/main/#{ip}")} - # alternative image format - image_paths = content.scan(/src="(images\/.*)"/).flatten - image_paths.each { |ip| content.gsub!(ip, "https://github.com/lewagon/data-engineering-setup/blob/main/#{ip}")} - elsif match_setup - content = URI.open(File.join("https://raw.githubusercontent.com/lewagon/setup/master", file)) - .read - # replace data-setup repo relative path by setup repo URL - image_paths = content.scan(/\!\[.*\]\((.*)\)/).flatten - image_paths.each { |ip| content.gsub!(ip, "https://github.com/lewagon/setup/blob/master/#{ip}")} - else - content = File.read(file, encoding: "utf-8") - end - return content -end - -# load partials (skip non-English locales for ENGLISH_ONLY configurations) -pairs = FILENAMES.flat_map { |filename, (os_name, partials)| - LOCALES.flat_map { |locale| - next [] if !locale.empty? && ENGLISH_ONLY.include?(filename) - partials.reject { |s| s.start_with?("#") }.map { |partial| [partial, locale] } - } -}.uniq -loaded = pairs.map { |partial, locale| ["#{partial}.#{locale}", load_partial(partial, locale)] }.to_h +constants = YAML.load_file('constants/constants.yml').freeze +repos_cfg = YAML.load_file('constants/repos.yml').freeze -# write files -LOCALES.each do |locale| - FILENAMES.each do |filename, (os_name, partials)| - next if !locale.empty? && ENGLISH_ONLY.include?(filename) - filename += ".#{locale}" unless locale.empty? - filename += ".md" - File.open(filename, "w:utf-8") do |f| - partials.reject { |s| s.start_with?("#") }.each do |partial| - content = loaded["#{partial}.#{locale}"].clone - # remove the OS dependant blocks - removed_blocks = DELIMITERS.keys - [os_name] - removed_blocks.each do |block| - delimiter_start, delimiter_end = DELIMITERS[block] - pattern = "#{delimiter_start}(.|\n)*?(?", value) - end - f << content - f << "\n\n" - end - end - end -end +Builder.new(build_specs, constants, repos_cfg).run diff --git a/builds/LINUX.yml b/builds/LINUX.yml new file mode 100644 index 00000000..6c7cc11f --- /dev/null +++ b/builds/LINUX.yml @@ -0,0 +1,37 @@ + +os: linux +locales: [en, es] +partials: + - intro + - setup/github + - setup/ubuntu_vscode + - vscode_extensions + - setup/vscode_aifeatures + - setup/cli_tools + - setup/oh_my_zsh + - direnv + - setup/gh_cli + - ubuntu_gcloud + - dotfiles + - dotfiles_new_student + - dotfiles_new_laptop + - dotfiles_merge_upstream + - dotfiles_same_laptop + - dotfiles_merge_upstream + - dotfiles_installer + - setup/ssh_agent + - conda_uninstall + - ubuntu_python + - virtualenv + - pip + - nbextensions + - python_checkup + - dbeaver + - ubuntu_docker + - gcp_setup + - gcp_setup_linux + - gcp_setup_end + - kitt + - setup/ubuntu_slack + - setup/slack_settings + - kata diff --git a/builds/LINUX_keep_current.yml b/builds/LINUX_keep_current.yml new file mode 100644 index 00000000..a11a6364 --- /dev/null +++ b/builds/LINUX_keep_current.yml @@ -0,0 +1,6 @@ + +os: linux +locales: [en, es] +partials: + - keep_current + - python_checkup diff --git a/builds/REMOTE_SETUP.yml b/builds/REMOTE_SETUP.yml new file mode 100644 index 00000000..9a2f6608 --- /dev/null +++ b/builds/REMOTE_SETUP.yml @@ -0,0 +1,43 @@ + +os: linux +locales: [en] +partials: + - intro + - setup/github + - de_setup/ssh_key + - vm_register + - vm_start + - vm_test + - de_setup/win_vscode + - de_setup/vscode_remote_ssh + - vscode_extensions + - setup/vscode_aifeatures + - setup/cli_tools + - setup/oh_my_zsh + - direnv + - setup/gh_cli + # - de_setup/ubuntu_gcloud + # - de_setup/gcp_setup_linux + - dotfiles + - dotfiles_new_student + - dotfiles_new_laptop + - dotfiles_merge_upstream + - dotfiles_same_laptop + - dotfiles_merge_upstream + - dotfiles_installer + - de_setup/zsh_default_terminal + - setup/ssh_agent + - ubuntu_python + - virtualenv + - pip + - nbextensions + - python_checkup + - dbeaver + - ubuntu_docker + # - de_setup/gcp_setup + # - kitt + # - setup/windows_slack + # - setup/slack_settings + # - kata + - vm_stop + - end diff --git a/builds/VM.yml b/builds/VM.yml new file mode 100644 index 00000000..ef37889f --- /dev/null +++ b/builds/VM.yml @@ -0,0 +1,39 @@ + +os: linux +locales: [en, es] +partials: + - intro + - setup/github + - de_setup/ssh_key + - de_setup/gcp_setup + - de_setup/virtual_machine + - de_setup/win_vscode + - de_setup/vscode_remote_ssh + - vscode_extensions + - setup/vscode_aifeatures + - setup/cli_tools + - setup/oh_my_zsh + - direnv + - setup/gh_cli + - de_setup/ubuntu_gcloud + - de_setup/gcp_setup_linux + - dotfiles + - dotfiles_new_student + - dotfiles_new_laptop + - dotfiles_merge_upstream + - dotfiles_same_laptop + - dotfiles_merge_upstream + - dotfiles_installer + - de_setup/zsh_default_terminal + - setup/ssh_agent + - ubuntu_python + - virtualenv + - pip + - nbextensions + - python_checkup + - dbeaver + - ubuntu_docker + - kitt + - setup/windows_slack + - setup/slack_settings + - kata diff --git a/builds/WINDOWS.yml b/builds/WINDOWS.yml new file mode 100644 index 00000000..48867b25 --- /dev/null +++ b/builds/WINDOWS.yml @@ -0,0 +1,46 @@ + +os: windows +locales: [en, es] +partials: + - intro + - setup/github + - setup/windows_version + - setup/windows_virtualization + - setup/windows_wsl + - setup/windows_ubuntu + - setup/windows_vscode + - setup/windows_terminal + - vscode_extensions + - setup/vscode_aifeatures + - setup/cli_tools + - setup/oh_my_zsh + - windows_browser + - direnv + - setup/gh_cli + - ubuntu_gcloud + - dotfiles + - dotfiles_new_student + - dotfiles_new_laptop + - dotfiles_merge_upstream + - dotfiles_same_laptop + - dotfiles_merge_upstream + - dotfiles_installer + - setup/ssh_agent + - conda_uninstall + - ubuntu_python + - virtualenv + - pip + - nbextensions + - win_jupyter + - python_checkup + - dbeaver + - setup/windows_settings + - win_vs_redistributable + - win_docker + - gcp_setup + - gcp_setup_wsl + - gcp_setup_end + - kitt + - setup/windows_slack + - setup/slack_settings + - kata diff --git a/builds/WINDOWS_keep_current.yml b/builds/WINDOWS_keep_current.yml new file mode 100644 index 00000000..42310e56 --- /dev/null +++ b/builds/WINDOWS_keep_current.yml @@ -0,0 +1,6 @@ + +os: windows +locales: [en, es] +partials: + - keep_current + - python_checkup diff --git a/builds/macOS.yml b/builds/macOS.yml new file mode 100644 index 00000000..535fd42a --- /dev/null +++ b/builds/macOS.yml @@ -0,0 +1,39 @@ + +os: macos +locales: [en, es] +partials: + - intro + - setup/github + - osx_silicon + - setup/macos_command_line_tools + - homebrew + - setup/macos_vscode + - vscode_extensions + - setup/vscode_aifeatures + - setup/oh_my_zsh + - direnv + - setup/gh_cli + - dotfiles + - dotfiles_new_student + - dotfiles_new_laptop + - dotfiles_merge_upstream + - dotfiles_same_laptop + - dotfiles_merge_upstream + - dotfiles_installer + - conda_uninstall + - osx_python + - virtualenv + - pip + - nbextensions + - python_checkup + - dbeaver + - docker + - gcp_cli_setup + - gcp_setup + - gcp_setup_mid + - gcp_setup_end + - kitt + - setup/macos_slack + - setup/slack_settings + - setup/macos_settings + - kata diff --git a/builds/macOS_keep_current.yml b/builds/macOS_keep_current.yml new file mode 100644 index 00000000..f2c7f47f --- /dev/null +++ b/builds/macOS_keep_current.yml @@ -0,0 +1,6 @@ + +os: macos +locales: [en, es] +partials: + - keep_current + - python_checkup diff --git a/constants/constants.yml b/constants/constants.yml new file mode 100644 index 00000000..fc248190 --- /dev/null +++ b/constants/constants.yml @@ -0,0 +1,7 @@ + +PYTHON_VERSION: "3.12.9" +PYTHON_CHECKER_URL: "https://raw.githubusercontent.com/lewagon/data-setup/master/checks/python_checker.sh" +PIP_CHECKER_URL: "https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.sh" +PIP_LOADER_URL: "https://raw.githubusercontent.com/lewagon/data-setup/master/checks/pip_check.py" +CODE_EDITOR: "VS Code" +CODE_EDITOR_CMD: "code" diff --git a/constants/repos.yml b/constants/repos.yml new file mode 100644 index 00000000..2fc6f3d9 --- /dev/null +++ b/constants/repos.yml @@ -0,0 +1,6 @@ + +branches: + setup: master + +aliases: + de_setup: data-engineering-setup diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 00000000..4bcfeecd --- /dev/null +++ b/doc/README.md @@ -0,0 +1,30 @@ + +# NOTE(ssaunier): This script needs https://github.com/lewagon/setup to be cloned as well + +## Build guides + +`bundle exec ruby build.rb` generates the setup guide markdown files at the repo root (e.g. `macOS.md`, `macOS.es.md`). + +Each file in `builds/` defines one guide: + +```yaml +os: macos +locales: [en, es] +partials: + - intro # local: _partials/intro.md / _partials/es/intro.md + - setup/github # remote: lewagon/setup _partials/github.md + - de_setup/direnv # remote alias: lewagon/data-engineering-setup _partials/direnv.md +``` + +Partials without a `/` are loaded from `_partials/` (English) or `_partials/{locale}/` (other locales). +Partials with a `/` are fetched from GitHub: `{repo}/_partials/{locale}/{name}.md`. Remote repo branches and aliases are configured in `constants/repos.yml`. + +Template variables available in all partials are defined in `constants/constants.yml`. + +CI runs the build on every push and commits the generated files if they changed. + +## Guide descriptions + +`VM`: student installs VS Code, creates a GCP VM, runs setup on the VM + +`REMOTE_SETUP`: student installs VS Code, redeems a Le Wagon-provided VM, runs setup on the VM diff --git a/lib/build_spec.rb b/lib/build_spec.rb new file mode 100644 index 00000000..a86d1646 --- /dev/null +++ b/lib/build_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require_relative 'localized_build' + +class BuildSpec + attr_reader :name, :os, :locales, :partials + + def initialize(name:, os:, locales:, partials:) + @name = name + @os = os + @locales = locales + @partials = partials + end + + def localized_builds(repos_cfg) + @locales.map { |locale| LocalizedBuild.new(self, locale, repos_cfg) } + end +end diff --git a/lib/builder.rb b/lib/builder.rb new file mode 100644 index 00000000..9a22437a --- /dev/null +++ b/lib/builder.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative 'build_spec' +require_relative 'partial_cache' +require_relative 'generator' + +class Builder + def initialize(build_specs, constants, repos_cfg) + @build_specs = build_specs + @constants = constants + @repos_cfg = repos_cfg + end + + def run + builds = @build_specs.flat_map { |spec| spec.localized_builds(@repos_cfg) } + cache = PartialCache.new(builds) + Generator.new(builds, cache, @constants).run + end +end diff --git a/lib/generator.rb b/lib/generator.rb new file mode 100644 index 00000000..55cfdca8 --- /dev/null +++ b/lib/generator.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'liquid' + +class Generator + def initialize(localized_builds, cache, constants) + @localized_builds = localized_builds + @cache = cache + @constants = constants + end + + def run + @localized_builds.each do |build| + File.open(build.output_filename, 'w:utf-8') do |f| + build.partials.each { |partial| f << render(partial, build) } + end + warn "built #{build.output_filename}" + end + end + + private + + def render(partial, build) + variables = @constants.merge(partial.vars).merge('os' => build.os, 'build_md' => build.output_filename) + "#{Liquid::Template.parse(@cache[partial.url].clone).render(variables)}\n\n" + end +end diff --git a/lib/localized_build.rb b/lib/localized_build.rb new file mode 100644 index 00000000..7bb8f9d9 --- /dev/null +++ b/lib/localized_build.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require_relative 'partial' + +class LocalizedBuild + attr_reader :os, :locale, :partials + + def initialize(spec, locale, repos_cfg) + @name = spec.name + @os = spec.os + @locale = locale + @partials = spec.partials.map { |entry| Partial.from(entry, locale, repos_cfg) } + end + + def output_filename + @locale == 'en' ? "#{@name}.md" : "#{@name}.#{@locale}.md" + end +end diff --git a/lib/partial.rb b/lib/partial.rb new file mode 100644 index 00000000..a7f39515 --- /dev/null +++ b/lib/partial.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative 'partial/remote' +require_relative 'partial/local' + +module Partial + REMOTE_REGEX = %r{\A(?[a-z][a-z0-9_-]*)/(?[a-z0-9_]+)\z} + + # entry is either a plain string or a hash: { 'name' => '...', 'vars' => { ... } } + def self.from(entry, locale, repos_cfg) + name = entry.is_a?(Hash) ? entry['name'] : entry + vars = entry.is_a?(Hash) ? entry.fetch('vars', {}) : {} + if (m = name.match(REMOTE_REGEX)) + Remote.new(m[:repo], locale, m[:name], vars, repos_cfg) + else + Local.new(locale, name, vars) + end + end +end diff --git a/lib/partial/local.rb b/lib/partial/local.rb new file mode 100644 index 00000000..92bb9929 --- /dev/null +++ b/lib/partial/local.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Partial + class Local + attr_reader :url, :vars + + def initialize(locale, name, vars) + localized = "_partials/#{locale}/#{name}.md" + english = "_partials/#{name}.md" + @url = (locale != 'en' && File.exist?(localized)) ? localized : english + @vars = vars + end + + def content = File.read(@url, encoding: 'utf-8') + end +end diff --git a/lib/partial/remote.rb b/lib/partial/remote.rb new file mode 100644 index 00000000..33a86ba9 --- /dev/null +++ b/lib/partial/remote.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'open-uri' + +module Partial + class Remote + attr_reader :url, :vars + + def initialize(repo, locale, name, vars, repos_cfg) + repo = repos_cfg.dig('aliases', repo) || repo + branch = repos_cfg.dig('branches', repo) || 'main' + path = locale == 'en' ? name : "#{locale}/#{name}" + @base_url = "https://github.com/lewagon/#{repo}/blob/#{branch}" + @url = "https://raw.githubusercontent.com/lewagon/#{repo}/#{branch}/_partials/#{path}.md" + @vars = vars + end + + def content + text = URI.open(@url).read + # Rewrite relative image paths to absolute GitHub URLs so they render outside their source repo + text.scan(/\!\[.*\]\((.*)\)/).flatten + .reject { |ip| ip.start_with?('http') } + .each { |ip| text.gsub!(ip, "#{@base_url}/#{ip}") } + text.scan(/src="(images\/.*)"/).flatten + .each { |ip| text.gsub!(ip, "#{@base_url}/#{ip}") } + warn "fetched #{@url}" + text + end + end +end diff --git a/lib/partial_cache.rb b/lib/partial_cache.rb new file mode 100644 index 00000000..91ab0c1e --- /dev/null +++ b/lib/partial_cache.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class PartialCache + def initialize(localized_builds) + @cache = localized_builds + .flat_map(&:partials) + .uniq { |partial| partial.url } + .sort_by { |partial| partial.url } + .map { |partial| Thread.new { [partial.url, partial.content] } } + .map { |thread| thread.value } + .to_h + end + + def [](url) + @cache[url] + end +end diff --git a/macOS.es.md b/macOS.es.md index bfb3c5b6..f8c6a27f 100644 --- a/macOS.es.md +++ b/macOS.es.md @@ -260,12 +260,14 @@ Cuando termines, tu terminal debería lucir así: [direnv](https://direnv.net/) es una extensión del shell. Facilita trabajar con variables de entorno por proyecto, lo cual será útil para customizar el comportamiento de tu código. + ``` bash brew install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + ## GitHub CLI CLI es una abreviación de [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface) que significa interfaz de línea de comando. @@ -526,8 +528,10 @@ Chequea si tienes `conda` instalado en tu computadora: ```bash conda list ``` + Si aparece `zsh: command not found: conda`, puedes **saltear** la desinstalación de `conda` e ir directo a la sección de **Instalar pre-requisitos**. +
Instrucciones de desinstalación conda @@ -541,12 +545,16 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup + rm -rf ~/opt + ``` - Elimina el directorio Anaconda de tu `.bash_profile` - Abre el archivo con `code ~/.bash_profile` - Si el archivo abre, busca la línea que coincida con el siguiente patrón `export PATH="/path/to/anaconda3/bin:$PATH"` y eliminala + - Guarda el archivo con `CMD` + `s` + - Reinicia la terminal con `exec zsh` - Remueve la inicializaciópn de Anaconda de tu `.zshrc`: - Abre el archivo con `code ~/.zshrc` @@ -675,6 +683,7 @@ pip install --upgrade pip Ahora instala algunos paquetes para las primeras semanas del programa: + Si tu computadora usa **Apple Silicon**, expande el párrafo de abajo y léelo. Si no es el caso, ignóralo.
@@ -696,6 +705,7 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs
+ ## Mejora Jupyter Notebook Mejora la visualización del [elemento `details` para revelación de información](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) en tus notebooks. diff --git a/macOS.md b/macOS.md index 1eafcaef..79fab949 100644 --- a/macOS.md +++ b/macOS.md @@ -260,12 +260,14 @@ At the end your terminal should look like this: [direnv](https://direnv.net/) is a shell extension. It makes it easy to deal with per project environment variables. This will be useful in order to customize the behavior of your code. + ``` bash brew install direnv echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc ``` + ## GitHub CLI CLI is the acronym of [Command-line Interface](https://en.wikipedia.org/wiki/Command-line_interface). @@ -523,8 +525,10 @@ Check if you have `conda` installed on your machine: ```bash conda list ``` + If you have `zsh: command not found: conda`, you can **skip** the uninstall of `conda` and jump to the **Install pre-requisites** section. +
conda uninstall instructions @@ -538,12 +542,16 @@ anaconda-clean --yes rm -rf ~/anaconda2 rm -rf ~/anaconda3 rm -rf ~/.anaconda_backup + rm -rf ~/opt + ``` - Remove Anaconda path from your `.bash_profile` - Open the file with `code ~/.bash_profile` - If the file opens find the line matching the following pattern `export PATH="/path/to/anaconda3/bin:$PATH"` and delete the line + - Save the file with `CMD` + `s` + - Restart your terminal with `exec zsh` - Remove Anaconda initialization from your `.zshrc`: - Open the file with `code ~/.zshrc` @@ -692,6 +700,7 @@ pip install --upgrade pip Then let's install some packages for the first weeks of the program: + If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it.
@@ -713,6 +722,7 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs
+ ## Jupyter Notebook tweaking Let's improve the display of the [`details` disclosure elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) in your notebooks. @@ -1004,10 +1014,12 @@ Once the verification goes through, you should receive an email stating that "Yo - Authenticate the `gcloud` CLI with the google account you used for GCP + ```bash gcloud auth login ``` + - Login to your Google account on the new tab opened in your web browser - List your active account and check your email address you used for GCP is present ```bash diff --git a/macOS_keep_current.es.md b/macOS_keep_current.es.md index 64cf6bec..973ee8d9 100644 --- a/macOS_keep_current.es.md +++ b/macOS_keep_current.es.md @@ -86,10 +86,12 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Actualiza pyenv: + ``` bash brew update && brew upgrade pyenv ``` + Instala la versión actual de python: ```bash @@ -140,6 +142,7 @@ pyenv versions pip install -U pip ``` + Si tu computadora usa **Apple Silicon**, expande el párrafo de abajo y léelo. Si no es el caso, ignóralo.
@@ -160,6 +163,7 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs ```
+ ## GCP Asegúrate de que el comando `gcloud` esté conectado con el email de tu cuenta Google Cloud Platform: @@ -268,8 +272,10 @@ gcloud auth configure-docker ## Docker + Start the Docker app + Verifica que Docker pueda ejecutar la imagen de hello-world: ``` bash @@ -278,9 +284,11 @@ docker run hello-world 👉 Asegúrate de que este comando se ejecute completamente + Stop the Docker app + ## Chequeo de la configuración de Python ### Chequeo de Python y packages diff --git a/macOS_keep_current.md b/macOS_keep_current.md index b2a7b868..9890f7e0 100644 --- a/macOS_keep_current.md +++ b/macOS_keep_current.md @@ -86,10 +86,12 @@ type -a pyenv > /dev/null && eval "$(pyenv init --path)" Update pyenv : + ``` bash brew update && brew upgrade pyenv ``` + Install the current python version : ```bash @@ -140,6 +142,7 @@ pyenv versions pip install -U pip ``` + If your computer uses **Apple Silicon**, expand the paragraph below and go through it. Otherwise ignore it.
@@ -160,6 +163,7 @@ pip install -r https://raw.githubusercontent.com/lewagon/data-setup/master/specs ```
+ ## GCP Make sure that the `gcloud` command is linked to the email address of your Google Cloud Platform account : @@ -268,8 +272,10 @@ gcloud auth configure-docker ## Docker + Start the Docker app + Verify that Docker can run the hello-world image : ``` bash @@ -278,9 +284,11 @@ docker run hello-world 👉 Make sure that this command completes correctly + Stop the Docker app + ## Python setup check ### Python and packages check