|
| 1 | +# Switchbox Copier Template |
| 2 | + |
| 3 | +This is a standalone Copier template for Switchbox projects. It supports: |
| 4 | + |
| 5 | +- Python-focused development with modern tooling |
| 6 | +- Optional features: Data science tools, package publishing, GitHub Actions, AWS CLI |
| 7 | +- Python stack options: type checker (mypy/ty), always includes deptry and devcontainers |
| 8 | +- Conditional files and directories via Copier-native templated paths, no post-gen cleanup |
| 9 | + |
| 10 | +## Quick start |
| 11 | + |
| 12 | +Install Copier: |
| 13 | + |
| 14 | +```bash |
| 15 | +pipx install copier # or: uv tool install copier |
| 16 | +``` |
| 17 | + |
| 18 | +Generate a project (example: Python + Data Science tools): |
| 19 | + |
| 20 | +```bash |
| 21 | +copier copy --defaults --force \ |
| 22 | + --data python_data_science="y" --data python_package="y" \ |
| 23 | + . /path/to/new-project |
| 24 | +``` |
| 25 | + |
| 26 | +See `copier/copier.yml` for all questions and defaults. |
| 27 | + |
| 28 | +## Development |
| 29 | + |
| 30 | +- Install dev deps with uv: |
| 31 | + |
| 32 | +```bash |
| 33 | +uv sync --group dev |
| 34 | +``` |
| 35 | + |
| 36 | +- Run tests (pytest runs copier to generate scenarios and asserts outputs): |
| 37 | + |
| 38 | +```bash |
| 39 | +uv run pytest -q |
| 40 | +``` |
| 41 | + |
| 42 | +- Lint/format: |
| 43 | + |
| 44 | +```bash |
| 45 | +uv run pre-commit run -a |
| 46 | +``` |
| 47 | + |
| 48 | +## Docs |
| 49 | + |
| 50 | +This repo ships MkDocs. To serve locally: |
| 51 | + |
| 52 | +```bash |
| 53 | +uv run mkdocs serve |
| 54 | +``` |
| 55 | + |
| 56 | +## Using the Template |
| 57 | + |
| 58 | +To create a new project from this template: |
| 59 | + |
| 60 | +```bash |
| 61 | +# Install copier |
| 62 | +uv tool install copier |
| 63 | + |
| 64 | +# Create a new project (requires --trust for git initialization) |
| 65 | +copier copy --trust https://github.com/your-org/copier-sb.git my-new-project |
| 66 | +``` |
| 67 | + |
| 68 | +The template will: |
| 69 | +- 🔧 Initialize a git repository |
| 70 | +- 📁 Add all generated files to git |
| 71 | +- 💾 Create an initial commit |
| 72 | +- 🚀 Set up your development environment |
| 73 | + |
| 74 | +### Project Types |
| 75 | + |
| 76 | +You can select one or more of these project types: |
| 77 | +- **Python Data Science**: Includes polars, pyarrow, seaborn, numpy, Quarto notebooks |
| 78 | +- **Python Package**: Includes build tools, twine, MkDocs documentation |
| 79 | +- **R Data Science**: Includes R, renv, Quarto, R extensions |
| 80 | + |
| 81 | +**Note**: You must select at least one project type. |
| 82 | + |
| 83 | +## License |
| 84 | + |
| 85 | +MIT |
0 commit comments