Skip to content

Commit 9dfbd41

Browse files
Update GitHub instructions in 10_manage_python_project.ipynb (#360)
* Update GitHub instructions in 10_manage_python_project.ipynb In this PR we ask users to establish passwordless connection to GitHub based on SSH key pair. * fix typo in header * Explicitly say that one should use Jupyter's Terminal * Add a simple explanation about ssh key pair * Explain how to get the content of id_rsa.pub --------- Co-authored-by: Despina Adamopoulou <despoina.adamopoulou@empa.ch>
1 parent cdec1d0 commit 9dfbd41

File tree

2 files changed

+37
-14
lines changed

2 files changed

+37
-14
lines changed

06_modules_and_packages.ipynb

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -881,13 +881,16 @@
881881
"2. Enable passwordless connection to your GitHub profile.\n",
882882
"\n",
883883
" 1. For that, you first need to open the Terminal and type the following:\n",
884-
" ```bash\n",
885-
" ssh-keygen -t rsa\n",
886-
" ```\n",
887-
" Then hit `Enter` three times to accept the default values.\n",
888-
"\n",
889-
" 1. In the File Browser, enter the `.ssh` folder and open the file named `id_rsa.pub`.\n",
890-
" Copy its content.\n",
884+
" ```bash\n",
885+
" ssh-keygen -t rsa\n",
886+
" ```\n",
887+
" Then hit `Enter` three times to accept the default values.\n",
888+
"\n",
889+
" 1. In the File Browser, enter the `.ssh` and copy the content of the file named `id_rsa.pub`.\n",
890+
" ```bash\n",
891+
" cat ~/.ssh/id_rsa.pub\n",
892+
" ```\n",
893+
" Copy the output of this command.\n",
891894
"\n",
892895
" 1. Go to [github.com](https://github.com), click on your icon (top right corner) and select `Settings`.\n",
893896
" In the newly opened window, select \"SSH and GPG keys\" and click on \"New SSH key\".\n",

10_manage_python_project.ipynb

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"metadata": {},
1515
"source": [
1616
"# Table of Contents\n",
17-
" - [Manage Python project](#Manage-Python-project)\n",
1817
" - [References](#References)\n",
1918
" - [Introduction](#Introduction)\n",
2019
" - [Preparatory exercise](#Preparatory-exercise)\n",
@@ -41,7 +40,7 @@
4140
" - [Exercise on testing](#Exercise-on-testing)\n",
4241
" - [Documentation](#Documentation)\n",
4342
" - [Why document?](#Why-document?)\n",
44-
" - [How document?](#How-document?)\n",
43+
" - [How to document?](#How-to-document?)\n",
4544
" - [Comments](#Comments)\n",
4645
" - [Docstrings](#Docstrings)\n",
4746
" - [Type hints](#Type-hints)\n",
@@ -137,10 +136,31 @@
137136
"1. Decide which package you want to use for the following exercises, yours or the [mypackage](https://github.com/empa-scientific-it/mypackage).\n",
138137
"1. If you use the `mypackage` fork it to your own GitHub account by clicking on the `Fork` button in the top right corner.\n",
139138
"1. Clone the fork to your local machine: `git clone <url-to-your-repository>`.\n",
140-
" The URL can be found by clicking on the `<Code>` dropdown and selecting __HTTPS__ tab.\n",
141-
"1. [Create an access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-personal-access-token-classic) for your account that will be used instead of your password.\n",
142-
" You should enable `workflow`, `write:packages`, `delete:packages`.\n",
143-
" Make sure to store the token in some secure location.\n",
139+
" The URL can be found by clicking on the `<Code>` dropdown and selecting the __SSH__ tab.\n",
140+
"\n",
141+
"<details>\n",
142+
"<summary>How to set up SSH keys (click to expand)</summary>\n",
143+
"\n",
144+
"An SSH key pair is a pair of cryptographic keys (a private key that stays on your machine and a public key that you share with GitHub) that lets you authenticate securely without typing a password every time. [Learn more](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh).\n",
145+
"\n",
146+
"1. Open the Jupyter Terminal (`File` -> `New Launcher`, then select `Terminal`), and generate an SSH key pair:\n",
147+
" ```bash\n",
148+
" ssh-keygen -t rsa\n",
149+
" ```\n",
150+
" Hit `Enter` three times to accept the default values.\n",
151+
"\n",
152+
"2. In the File Browser, enter the `.ssh` and copy the content of the file named `id_rsa.pub`.\n",
153+
" ```bash\n",
154+
" cat ~/.ssh/id_rsa.pub\n",
155+
" ```\n",
156+
" Copy the output of this command.\n",
157+
"\n",
158+
"3. Go to [github.com](https://github.com), click on your icon (top right corner) and select `Settings`.\n",
159+
" In the newly opened window, select \"SSH and GPG keys\" and click on \"New SSH key\".\n",
160+
" Provide a key title (e.g. `python-intro-tutorial`) and paste the key content in the \"Key\" field.\n",
161+
" Click on \"Add SSH key\".\n",
162+
"\n",
163+
"</details>\n",
144164
"\n",
145165
"<div class=\"alert alert-block alert-info\">\n",
146166
"In the following, we will always assume that <code>mypackage</code> is the package you are working on (either yours or the one you have forked).\n",
@@ -726,7 +746,7 @@
726746
"id": "28",
727747
"metadata": {},
728748
"source": [
729-
"## How document?\n",
749+
"## How to document?\n",
730750
"\n",
731751
"Usually, the documentation of a package is written in [reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html) or [Markdown](https://www.sphinx-doc.org/en/master/usage/markdown.html).\n",
732752
"However, it is also possible to write the documentation in [Jupyter notebooks](https://jupyter.org/) (as we do in this tutorial).\n",

0 commit comments

Comments
 (0)