Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage Python project notebook: small fixes #189

Merged
merged 3 commits into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 23 additions & 10 deletions manage_python_project.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
" - [Version update](#Version-update)\n",
" - [Exercise on version update automation](#Exercise-on-version-update-automation)\n",
" - [Releasing](#Releasing)\n",
" - [Exercise on releasing automation](#Exercise-on-releasing-automation)"
" - [Exercises on releasing automation](#Exercises-on-releasing-automation)"
]
},
{
Expand Down Expand Up @@ -139,7 +139,7 @@
"3. Clone the package to your local machine: `git clone <url-to-your-repository>`.\n",
"\n",
"<div class=\"alert alert-block alert-info\">\n",
"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",
"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",
"</div>\n"
]
},
Expand Down Expand Up @@ -330,6 +330,8 @@
"pre-commit run --all-files\n",
"```\n",
"This command will run all the pre-commit hooks on all the files in the repository.\n",
"However, this command will fail if there is no `.pre-commit-config.yaml` file in the current directory.\n",
"We will discuss the `.pre-commit-config.yaml` file in the next section.\n",
"\n",
"Usually, one would run pre-commit on the files that are about to be committed.\n",
"It turns out that pre-commit can do that for us.\n",
Expand Down Expand Up @@ -1524,6 +1526,7 @@
"\n",
"on: push\n",
"\n",
"jobs:\n",
" tests:\n",
" name: Test Suite\n",
" runs-on: ubuntu-latest\n",
Expand Down Expand Up @@ -1610,11 +1613,11 @@
"To update the version, run the following command:\n",
"\n",
"```bash\n",
"bumpver update --minor --dry-run\n",
"bumpver update --minor --dry\n",
"```\n",
"Since the `--dry-run` flag is used, the version will not be updated, but the proposed changes will be printed to the console.\n",
"Since the `--dry` flag is used, the version will not be updated, but the proposed changes will be printed to the console.\n",
"In the example above we expect only the `MINOR` part of the version to be updated, as we have used the `--minor` flag.\n",
"Once you are happy with the changes, remove the `--dry-run` flag and run the command again.\n",
"Once you are happy with the changes, remove the `--dry` flag and run the command again.\n",
"\n",
"\n",
"For more information on the configuration, see [bumpver documentation](https://github.com/mbarkhau/bumpver#readme)."
Expand Down Expand Up @@ -1706,8 +1709,8 @@
"\n",
"Finally, we want to add a release to GitHub.\n",
"```yaml\n",
" - uses: softprops/action-gh-release@v0.1.14\n",
" name: Create release\n",
" - name: Create release\n",
" uses: softprops/action-gh-release@v0.1.14\n",
" with:\n",
" files: |\n",
" dist/*\n",
Expand All @@ -1731,11 +1734,21 @@
"id": "78322de9",
"metadata": {},
"source": [
"## Exercise on releasing automation\n",
"## Exercises on releasing automation\n",
"\n",
"- Configure the release workflow in your package.\n",
"You can use all steps from the example above except from the `Build and publish` step.\n",
"This step should be replaced with the following one:\n",
"\n",
"- Configure the release workflow in your package using `test.pypi.org`.\n",
"```yaml\n",
" - name: Build and publish\n",
" run: flit build\n",
"```\n",
"- Update the version of your package using `bumpver`.\n",
"- Check that the release workflow is triggered and the package is released on `test.pypi.org`."
"\n",
"**Optional:**\n",
"\n",
"- Only if you are working with your own package, you can try to release it on PyPI."
]
}
],
Expand Down