This repository contains materials for the "Package Your Code" workshop held at the Data Science Mini-Conference. The workshop aims to teach participants how to package their code effectively for better collaboration, distribution, and reuse.
In the live section of this workshop, we will cover the following topics:
- Dependency Management: Learning how to manage project dependencies using tools like
uvand splitting dependencies into production, development, and documentation categories. - Packaging with
pyproject.toml: Understanding the structure and purpose ofpyproject.tomlfiles, and how to use them to define project metadata and dependencies so you can reuse your code in other projects. - Mkdocs and Mkdocstrings: Setting up documentation for your project using
mkdocsandmkdocstringsto create user-friendly and maintainable documentation.
There is also bonus content available in the repository, which can be explored at your own pace, including:
- Cookiecutter Templates: Using cookiecutter templates to quickly scaffold new projects with best practices in mind.
- Setting up Pre-Commit Hooks: Implementing pre-commit hooks to automate code quality checks, enforcing coding standards, and preventing secrets from being committed to version control.
- Setting up CI/CD with GitHub Actions: Automating testing, building, and deploying your code using GitHub Actions for continuous integration and continuous deployment.
The workshop assumes that participants have a basic understanding of the following concepts:
| Pre-requisite | Description |
|---|---|
| Python | Knowledge of how to write and run Python code |
| Git | Basic command line usage and version control concepts |
| GitHub | Familiarity with repositories, Codespaces, and forking |
| RAP | Understanding of the core principles of Reproducible Analytical Pipelines (RAP), particularly the levels of RAP |
| Virtual Environments & Package Management | Basic understanding of virtual environments and package management in Python (e.g., pip, venv, conda, etc.) |
The workshop materials are hosted on a dedicated website built with MkDocs: Package Your Code Workshop. On the website, you will find information about the workshop, how to get started, and the workshop content itself.
If you encounter any issues or have questions, please open an issue in this repository. We welcome feedback and contributions to improve the workshop materials.
Unless stated otherwise, the codebase is released under the MIT Licence. This covers both the codebase and any sample code in the documentation.
HTML and Markdown documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.