|
| 1 | +# Getting Started with Python Collab Template |
| 2 | + |
| 3 | +This guide walks you through using this template to create a new Python project. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Python 3.9 or higher |
| 8 | +- Git |
| 9 | +- GitHub account (for template usage) |
| 10 | + |
| 11 | +## Creating a Project from This Template |
| 12 | + |
| 13 | +### Step 1: Create Repository from Template |
| 14 | + |
| 15 | +1. Go to this template repository on GitHub |
| 16 | +2. Click **"Use this template"** button |
| 17 | +3. Choose **"Create a new repository"** |
| 18 | +4. Fill in your repository details: |
| 19 | + - Repository name (e.g., `my-awesome-project`) |
| 20 | + - Description |
| 21 | + - Public/Private visibility |
| 22 | + |
| 23 | +### Step 2: Clone and Initialize |
| 24 | + |
| 25 | +1. Clone your new repository: |
| 26 | + ```bash |
| 27 | + git clone https://github.com/your-username/your-project-name.git |
| 28 | + cd your-project-name |
| 29 | + ``` |
| 30 | + |
| 31 | +2. Initialize your project: |
| 32 | + ```bash |
| 33 | + make init |
| 34 | + ``` |
| 35 | + |
| 36 | +3. Follow the interactive prompts: |
| 37 | + - **Project name**: Enter your project name (e.g., "My Awesome Project") |
| 38 | + - **Description**: Brief description of your project |
| 39 | + - **Author info**: Your name and email (auto-detected from git config) |
| 40 | + - **Example code**: Choose how to handle example code: |
| 41 | + - Keep (useful for reference) |
| 42 | + - Minimal (basic working example) |
| 43 | + - Remove (clean slate) |
| 44 | + - **Documentation**: Set up MkDocs documentation (default: yes) |
| 45 | + - **Pre-commit hooks**: Enable quality checks on commit (default: yes) |
| 46 | + |
| 47 | +### Step 3: Verify Setup |
| 48 | + |
| 49 | +After initialization, verify everything works: |
| 50 | + |
| 51 | +```bash |
| 52 | +# Run all quality checks |
| 53 | +make check |
| 54 | + |
| 55 | +# If you enabled documentation |
| 56 | +make docs-serve |
| 57 | +``` |
| 58 | + |
| 59 | +## Project Structure After Initialization |
| 60 | + |
| 61 | +Your initialized project will have: |
| 62 | + |
| 63 | +``` |
| 64 | +your-project-name/ |
| 65 | +├── your_project_name/ # Main package (renamed from src/) |
| 66 | +├── tests/ # Test files |
| 67 | +├── docs/ # Documentation (if enabled) |
| 68 | +├── .github/workflows/ # CI/CD workflows |
| 69 | +├── pyproject.toml # Project configuration |
| 70 | +├── Makefile # Development commands |
| 71 | +└── README.md # Project documentation |
| 72 | +``` |
| 73 | + |
| 74 | +## Development Workflow |
| 75 | + |
| 76 | +### Daily Development |
| 77 | + |
| 78 | +1. Make your changes to the code |
| 79 | +2. Add or update tests |
| 80 | +3. Run quality checks: |
| 81 | + ```bash |
| 82 | + make check |
| 83 | + ``` |
| 84 | +4. Update documentation if needed |
| 85 | +5. Commit and push |
| 86 | + |
| 87 | +### Available Commands |
| 88 | + |
| 89 | +Your project comes with these make targets: |
| 90 | + |
| 91 | +- `make setup` - Set up development environment |
| 92 | +- `make test` - Run tests with coverage |
| 93 | +- `make lint` - Run linting with auto-fix |
| 94 | +- `make format` - Format code |
| 95 | +- `make mypy` - Run type checking |
| 96 | +- `make check` - Run all quality checks |
| 97 | +- `make docs-serve` - Serve documentation locally (if enabled) |
| 98 | +- `make docs-build` - Build documentation (if enabled) |
| 99 | +- `make docs-check` - Validate documentation build (if enabled) |
| 100 | + |
| 101 | +### Documentation (If Enabled) |
| 102 | + |
| 103 | +If you chose to set up documentation: |
| 104 | + |
| 105 | +1. **Local development**: |
| 106 | + ```bash |
| 107 | + make docs-serve |
| 108 | + # Visit http://localhost:8000 |
| 109 | + ``` |
| 110 | + |
| 111 | +2. **Content organization**: |
| 112 | + - `docs/index.md` - Project homepage |
| 113 | + - `docs/getting-started.md` - User guide |
| 114 | + - `docs/reference/api.md` - Auto-generated API docs |
| 115 | + |
| 116 | +3. **GitHub Pages setup**: |
| 117 | + - Go to repository Settings → Pages |
| 118 | + - Set source to "GitHub Actions" |
| 119 | + - Documentation will auto-deploy on main branch pushes |
| 120 | + |
| 121 | +### CI/CD |
| 122 | + |
| 123 | +Your project includes GitHub Actions workflows: |
| 124 | + |
| 125 | +- **Quality checks** (`tests.yml`): Runs on PRs and pushes |
| 126 | +- **Documentation** (`docs.yml`): Deploys docs to GitHub Pages (if enabled) |
| 127 | + |
| 128 | +## Next Steps |
| 129 | + |
| 130 | +1. **Update README.md** with project-specific information |
| 131 | +2. **Add your code** in the main package directory |
| 132 | +3. **Write tests** for your functionality |
| 133 | +4. **Update documentation** to describe your project |
| 134 | +5. **Set up GitHub Pages** (if documentation enabled) |
| 135 | +6. **Configure repository settings** (branch protection, etc.) |
| 136 | + |
| 137 | +## Tips |
| 138 | + |
| 139 | +- The template includes example code you can reference or remove |
| 140 | +- All configuration follows modern Python best practices |
| 141 | +- The documentation system auto-generates API docs from docstrings |
| 142 | +- Pre-commit hooks ensure code quality before commits |
| 143 | +- Use `make` commands for consistent development workflow |
0 commit comments