|
| 1 | +# Python Packaging Basics: A Practical Guide |
| 2 | + |
| 3 | +Welcome to the **Python Packaging Basics** training series! This repository provides a hands-on, story-driven approach to learning modern Python packaging. |
| 4 | + |
| 5 | +## 🎯 What You'll Learn |
| 6 | + |
| 7 | +Through building `kir-pydemo`, a simple bioinformatics utility package, you'll master: |
| 8 | + |
| 9 | +- Modern Python packaging with `pyproject.toml` |
| 10 | +- The `src/` layout pattern |
| 11 | +- Creating installable packages |
| 12 | +- Building CLI tools with entry points |
| 13 | +- Managing dependencies |
| 14 | +- Testing and code quality |
| 15 | +- Building and distributing packages |
| 16 | + |
| 17 | +## 📚 Episodes |
| 18 | + |
| 19 | +This training is divided into five progressive episodes, each building on the previous: |
| 20 | + |
| 21 | +1. **[Episode 1: Project Structure & pyproject.toml](docs/episode-01.md)** |
| 22 | + - Introduction to modern Python packaging |
| 23 | + - Setting up project structure with `src/` layout |
| 24 | + - Creating your first `pyproject.toml` |
| 25 | + - Making your package installable |
| 26 | + |
| 27 | +2. **[Episode 2: Entry Points & CLI Tools](docs/episode-02.md)** |
| 28 | + - Adding command-line interfaces |
| 29 | + - Console scripts and entry points |
| 30 | + - Argument parsing basics |
| 31 | + |
| 32 | +3. **[Episode 3: Dependencies & Environments](docs/episode-03.md)** |
| 33 | + - Managing dependencies properly |
| 34 | + - Optional dependencies for extras |
| 35 | + - Virtual environments best practices |
| 36 | + |
| 37 | +4. **[Episode 4: Testing & Quality](docs/episode-04.md)** |
| 38 | + - Adding tests with pytest |
| 39 | + - Code quality tools (ruff, black, mypy) |
| 40 | + - Pre-commit hooks |
| 41 | + |
| 42 | +5. **[Episode 5: Building & Distribution](docs/episode-05.md)** |
| 43 | + - Building wheels and source distributions |
| 44 | + - Version management strategies |
| 45 | + - Publishing to PyPI or private repositories |
| 46 | + |
| 47 | +## 🚀 Getting Started |
| 48 | + |
| 49 | +Each episode has: |
| 50 | +- **Concept explanations** - Clear, concise theory |
| 51 | +- **Working code examples** - In the `episodes/` directory |
| 52 | +- **Step-by-step instructions** - Follow along and build |
| 53 | +- **Checkpoints** - Verify your understanding |
| 54 | +- **Best practices** - Learn the right way |
| 55 | + |
| 56 | +### Prerequisites |
| 57 | + |
| 58 | +- Python 3.9 or higher |
| 59 | +- Basic Python programming knowledge |
| 60 | +- Familiarity with command line |
| 61 | + |
| 62 | +### How to Use This Repository |
| 63 | + |
| 64 | +1. **Read the episode documentation** in the `docs/` folder |
| 65 | +2. **Follow along** by creating your own version of `kir-pydemo` |
| 66 | +3. **Reference the example code** in `episodes/episodeXX/` for comparison |
| 67 | +4. **Complete the checkpoints** to verify your progress |
| 68 | + |
| 69 | +## 📖 Documentation Site |
| 70 | + |
| 71 | +You can browse this as a documentation site using MkDocs: |
| 72 | + |
| 73 | +```bash |
| 74 | +pip install mkdocs-material |
| 75 | +mkdocs serve |
| 76 | +``` |
| 77 | + |
| 78 | +Then visit http://127.0.0.1:8000 |
| 79 | + |
| 80 | +## 🎓 Who Is This For? |
| 81 | + |
| 82 | +This training is designed for: |
| 83 | +- Researchers packaging their analysis tools |
| 84 | +- Scientists sharing computational methods |
| 85 | +- Anyone wanting to understand modern Python packaging |
| 86 | +- Developers moving from scripts to packages |
| 87 | + |
| 88 | +## 📝 License |
| 89 | + |
| 90 | +This training material is provided for educational purposes. |
| 91 | + |
| 92 | +## 🤝 Contributing |
| 93 | + |
| 94 | +Found an issue or have a suggestion? Feel free to open an issue or submit a pull request! |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +**Ready to begin?** Start with [Episode 1: Project Structure & pyproject.toml](docs/episode-01.md) |
0 commit comments