|
1 | 1 | # Project Context |
2 | 2 |
|
3 | 3 | ## Purpose |
4 | | -[Describe your project's purpose and goals] |
| 4 | + |
| 5 | +The **emcd-projects** project addresses the complete lifecycle of Python projects, from creation to maintenance. It provides: |
| 6 | + |
| 7 | +1. **Project Template**: A Copier-based template for rapid scaffolding of new Python projects with consistent structure and configuration. |
| 8 | +2. **Runtime Management**: A Python package (`emcdproj`) for ongoing project maintenance, including static site generation and badge management. |
| 9 | +3. **Automation**: A collection of reusable GitHub Actions workflows for CI/CD, testing, and documentation. |
| 10 | + |
| 11 | +The goal is to facilitate a "single-maintainer model" while supporting community contributions, ensuring separation of concerns between template generation, workflow automation, and maintenance tooling. |
5 | 12 |
|
6 | 13 | ## Tech Stack |
7 | | -- [List your primary technologies] |
8 | | -- [e.g., TypeScript, React, Node.js] |
| 14 | + |
| 15 | +- **Language**: Python (>= 3.10) |
| 16 | +- **Project Management**: Hatch (build backend, environment management) |
| 17 | +- **Templating**: Copier, Jinja2 |
| 18 | +- **Documentation**: Sphinx, myst-parser |
| 19 | +- **Testing**: Pytest, coverage |
| 20 | +- **Linting/Formatting**: Ruff, Pyright, isort, Vulture |
| 21 | +- **CLI**: Tyro |
| 22 | +- **CI/CD**: GitHub Actions |
| 23 | +- **Utilities**: `defusedxml`, `icecream-truck`, `absence`, `accretive`, `frigid`, `classcore` |
9 | 24 |
|
10 | 25 | ## Project Conventions |
11 | 26 |
|
| 27 | +### Filesystem Organization |
| 28 | + |
| 29 | +The project follows a specific filesystem organization documented in: |
| 30 | +- `documentation/architecture/filesystem.rst` |
| 31 | + |
| 32 | +This document details the root directory structure, source code organization (including the `__` subpackage pattern), template system structure, and component integration. |
| 33 | + |
12 | 34 | ### Code Style |
13 | | -[Describe your code style preferences, formatting rules, and naming conventions] |
| 35 | + |
| 36 | +- **Formatting**: Enforced by Ruff and isort. Line length is set to 79 characters. |
| 37 | +- **Typing**: Strict static typing checked by Pyright. |
| 38 | +- **Lints**: Comprehensive linting via Ruff and Vulture (dead code detection). |
14 | 39 |
|
15 | 40 | ### Architecture Patterns |
16 | | -[Document your architectural decisions and patterns] |
| 41 | + |
| 42 | +- **Three-Tier Architecture**: The project is structured into three distinct tiers (Template Generation, CI/CD Automation, Project Maintenance) as detailed in: |
| 43 | + - `documentation/architecture/decisions/001-three-tier-architecture.rst` |
| 44 | +- **Centralized Import Pattern**: A double underscore (`__`) subpackage pattern is used for centralized import management to prevent namespace pollution and duplications. Details in: |
| 45 | + - `documentation/architecture/decisions/002-centralized-import-pattern.rst` |
| 46 | +- **CLI Structure**: The CLI uses `tyro` and separates command definition (`cli.py`, `website.py`) from the entry point (`__main__.py`). |
17 | 47 |
|
18 | 48 | ### Testing Strategy |
19 | | -[Explain your testing approach and requirements] |
| 49 | + |
| 50 | +Testing follows the principles outlined in: |
| 51 | +- `documentation/architecture/testplans/summary.rst` |
| 52 | + |
| 53 | +Key aspects include: |
| 54 | +- **Coverage**: High coverage requirements (near 100%) for core logic. |
| 55 | +- **Cross-platform**: Testing across multiple Python versions and operating systems via GitHub Actions. |
| 56 | +- **Types**: Doctests are run via Sphinx; unit tests via Pytest. |
20 | 57 |
|
21 | 58 | ### Git Workflow |
22 | | -[Describe your branching strategy and commit conventions] |
| 59 | + |
| 60 | +- **Branching**: |
| 61 | + - `master` (or `main`): Primary development branch. |
| 62 | + - `publication`: Dedicated branch for hosting the versioned static website (documentation + coverage reports). |
| 63 | +- **Workflows**: |
| 64 | + - `tester`: Runs on push/PR to verify code and tests. |
| 65 | + - `docsgen`: Generates documentation. |
| 66 | + - `linters`: Checks code style and static analysis. |
| 67 | + - `packagers`: Builds the distribution packages. |
23 | 68 |
|
24 | 69 | ## Domain Context |
25 | | -[Add domain-specific knowledge that AI assistants need to understand] |
| 70 | + |
| 71 | +- **emcdproj**: The CLI tool included in the project. It handles tasks like `website update` to manage the static documentation site, ensuring versioned docs and coverage badges are up-to-date without relying on external services like ReadTheDocs. |
| 72 | +- **Template Processing**: The `template/` directory contains the source for the Copier template. It mirrors the generated project structure but uses Jinja2 for customization. |
| 73 | +- **Auxiliary Workspace**: The `.auxiliary/` directory is used for local development artifacts, caches, and tool configurations, keeping the root clean. |
26 | 74 |
|
27 | 75 | ## Important Constraints |
28 | | -[List any technical, business, or regulatory constraints] |
| 76 | + |
| 77 | +- **Single-Maintainer Focus**: The architecture is designed to minimize overhead for a single maintainer while still allowing for community input. |
| 78 | +- **No External Doc Hosting Services**: The project explicitly avoids services like ReadTheDocs or Codecov in favor of a self-managed static site on GitHub Pages (via the `publication` branch). |
29 | 79 |
|
30 | 80 | ## External Dependencies |
31 | | -[Document key external services, APIs, or systems] |
| 81 | + |
| 82 | +- **GitHub Actions**: Heavily relied upon for all automation (testing, publishing, etc.). |
| 83 | +- **PyPI**: Target for package distribution. |
| 84 | +- **Copier**: Required for using and updating the project template. |
0 commit comments