Skip to content

Commit c89031d

Browse files
authored
Manage Python project notebook: small fixes (#189)
It includes, but is not limited to: * Fix the table of contents. * Replace `--dry-run` with `--dry`
1 parent b38ea63 commit c89031d

1 file changed

Lines changed: 23 additions & 10 deletions

File tree

manage_python_project.ipynb

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
" - [Version update](#Version-update)\n",
6868
" - [Exercise on version update automation](#Exercise-on-version-update-automation)\n",
6969
" - [Releasing](#Releasing)\n",
70-
" - [Exercise on releasing automation](#Exercise-on-releasing-automation)"
70+
" - [Exercises on releasing automation](#Exercises-on-releasing-automation)"
7171
]
7272
},
7373
{
@@ -139,7 +139,7 @@
139139
"3. Clone the package to your local machine: `git clone <url-to-your-repository>`.\n",
140140
"\n",
141141
"<div class=\"alert alert-block alert-info\">\n",
142-
"In the following, we will always assume that <code>mypackage</code> is the package you are working on (other yours or the one you have forked).\n",
142+
"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",
143143
"</div>\n"
144144
]
145145
},
@@ -330,6 +330,8 @@
330330
"pre-commit run --all-files\n",
331331
"```\n",
332332
"This command will run all the pre-commit hooks on all the files in the repository.\n",
333+
"However, this command will fail if there is no `.pre-commit-config.yaml` file in the current directory.\n",
334+
"We will discuss the `.pre-commit-config.yaml` file in the next section.\n",
333335
"\n",
334336
"Usually, one would run pre-commit on the files that are about to be committed.\n",
335337
"It turns out that pre-commit can do that for us.\n",
@@ -1524,6 +1526,7 @@
15241526
"\n",
15251527
"on: push\n",
15261528
"\n",
1529+
"jobs:\n",
15271530
" tests:\n",
15281531
" name: Test Suite\n",
15291532
" runs-on: ubuntu-latest\n",
@@ -1610,11 +1613,11 @@
16101613
"To update the version, run the following command:\n",
16111614
"\n",
16121615
"```bash\n",
1613-
"bumpver update --minor --dry-run\n",
1616+
"bumpver update --minor --dry\n",
16141617
"```\n",
1615-
"Since the `--dry-run` flag is used, the version will not be updated, but the proposed changes will be printed to the console.\n",
1618+
"Since the `--dry` flag is used, the version will not be updated, but the proposed changes will be printed to the console.\n",
16161619
"In the example above we expect only the `MINOR` part of the version to be updated, as we have used the `--minor` flag.\n",
1617-
"Once you are happy with the changes, remove the `--dry-run` flag and run the command again.\n",
1620+
"Once you are happy with the changes, remove the `--dry` flag and run the command again.\n",
16181621
"\n",
16191622
"\n",
16201623
"For more information on the configuration, see [bumpver documentation](https://github.com/mbarkhau/bumpver#readme)."
@@ -1706,8 +1709,8 @@
17061709
"\n",
17071710
"Finally, we want to add a release to GitHub.\n",
17081711
"```yaml\n",
1709-
" - uses: softprops/action-gh-release@v0.1.14\n",
1710-
" name: Create release\n",
1712+
" - name: Create release\n",
1713+
" uses: softprops/action-gh-release@v0.1.14\n",
17111714
" with:\n",
17121715
" files: |\n",
17131716
" dist/*\n",
@@ -1731,11 +1734,21 @@
17311734
"id": "78322de9",
17321735
"metadata": {},
17331736
"source": [
1734-
"## Exercise on releasing automation\n",
1737+
"## Exercises on releasing automation\n",
1738+
"\n",
1739+
"- Configure the release workflow in your package.\n",
1740+
"You can use all steps from the example above except from the `Build and publish` step.\n",
1741+
"This step should be replaced with the following one:\n",
17351742
"\n",
1736-
"- Configure the release workflow in your package using `test.pypi.org`.\n",
1743+
"```yaml\n",
1744+
" - name: Build and publish\n",
1745+
" run: flit build\n",
1746+
"```\n",
17371747
"- Update the version of your package using `bumpver`.\n",
1738-
"- Check that the release workflow is triggered and the package is released on `test.pypi.org`."
1748+
"\n",
1749+
"**Optional:**\n",
1750+
"\n",
1751+
"- Only if you are working with your own package, you can try to release it on PyPI."
17391752
]
17401753
}
17411754
],

0 commit comments

Comments
 (0)