-
Notifications
You must be signed in to change notification settings - Fork 0
Fix template for library packages #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e5c1645
Fix template for library packages
JoshCLWren 11832e5
fix: ralph loop phase 0 — AI-assisted quality gate fixes
JoshCLWren 9760984
docs: improve template with clear placeholders and post-init guidance
JoshCLWren a4733f0
docs: fix template documentation for library vs application support
JoshCLWren b639c96
fix: remove sudo from container apt commands
JoshCLWren 7535869
docs: clarify hyphen-to-underscore normalization in module naming
JoshCLWren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| # TODO: After init, update CODECOV_TOKEN in GitHub repository secrets if using Codecov | ||
| name: CI | ||
|
|
||
| on: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Added | ||
|
|
||
| - Warning banners to README.md and AGENTS.md to clearly indicate template files | ||
| - Post-initialization checklist section to README.md | ||
| - Placeholder system using `[[MODULE_NAME]]` for easy replacement | ||
| - POST_INIT_CHECKLIST.md with comprehensive post-init guidance | ||
| - TEMPLATE_GUIDE.md explaining template purpose and usage | ||
| - Improved `make init` output with summary of changes and next steps | ||
| - Comment placeholder in CI workflow for Codecov token setup | ||
| - Git worktrees section marked as optional in AGENTS.md | ||
|
|
||
| ### Changed | ||
|
|
||
| - Replaced hardcoded "example_module" with `[[MODULE_NAME]]` placeholder in README.md | ||
| - Updated CI badge URLs to use placeholders (YOUR_USERNAME/YOUR_REPO) | ||
| - Enhanced `make init` target to provide detailed summary of automated changes | ||
| - Improved documentation clarity with visual indicators (⚠️, ✅, 📋, etc.) | ||
|
|
||
| ### Improved | ||
|
|
||
| - Template now provides clearer guidance on what gets automated vs manual | ||
| - Better distinction between template-specific patterns and project-specific needs | ||
| - More comprehensive documentation for new users | ||
| - Enhanced visibility of post-initialization requirements | ||
|
|
||
| ## [0.1.0] - 2024-01-15 | ||
|
|
||
| ### Added | ||
|
|
||
| - Initial template release | ||
| - Python 3.13 support | ||
| - uv package manager integration | ||
| - pytest with 96% minimum coverage | ||
| - ruff for linting and formatting | ||
| - pyright for type checking | ||
| - Pre-commit hooks for code quality | ||
| - GitHub Actions CI workflow | ||
| - Make commands for common tasks | ||
| - AGENTS.md for AI agent guidelines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,168 @@ | ||
| # Post-Initialization Checklist | ||
|
|
||
| This checklist guides you through the manual steps needed after running `make init NAME=your-project` to customize your new project. | ||
|
|
||
| ## 🎯 Overview | ||
|
|
||
| The `make init` command automates the following: | ||
| - ✅ Renames the module directory from `example_module` to your project name (hyphenated names are normalized: my-project → my_project) | ||
| - ✅ Updates `pyproject.toml` with your project name | ||
| - ✅ Updates all Python imports to use the new module name | ||
| - ✅ Updates CI workflow to use the new module name | ||
| - ✅ Removes `main.py` (template uses a library package structure) | ||
|
|
||
| However, some items require manual attention to ensure your project is properly configured. | ||
|
|
||
| ## 📋 Documentation Updates | ||
|
|
||
| ### README.md | ||
| - [ ] **Update project title and description** | ||
| - Change "Python Starter Template" to your project name | ||
| - Update the description to reflect what your project does | ||
| - Add your project's specific features | ||
|
|
||
| - [ ] **Replace `[[MODULE_NAME]]` references** | ||
| - Search for all instances of `[[MODULE_NAME]]` | ||
| - Replace with your actual module name (e.g., project name `my-project` becomes module directory `my_project`) | ||
|
|
||
| - [ ] **Update CI badge URLs** | ||
| - Replace `YOUR_USERNAME` with your GitHub username | ||
| - Replace `YOUR_REPO` with your repository name | ||
| - Example: `https://github.com/johndoe/my-awesome-project/workflows/CI/badge.svg` | ||
|
|
||
| - [ ] **Update features list** | ||
| - Remove or add features based on your project's capabilities | ||
| - Add specific libraries or frameworks your project uses | ||
|
|
||
| - [ ] **Add usage examples** | ||
| - Replace template examples with your actual usage | ||
| - Add code snippets showing how to use your project | ||
|
|
||
| - [ ] **Remove the warning banner** | ||
| - Delete the `⚠️ TEMPLATE FILE` banner at the top | ||
| - Remove the "📝 Post-Initialization Checklist" section | ||
|
|
||
| ### AGENTS.md | ||
| - [ ] **Review and customize patterns** | ||
| - Update module organization to match your structure | ||
| - Add project-specific commands or workflows | ||
| - Remove git worktrees section if not using that workflow | ||
| - Update coverage commands to use your module name | ||
|
|
||
| - [ ] **Remove the warning banner** | ||
| - Delete the `⚠️ TEMPLATE FILE` banner at the top | ||
|
|
||
| ## ⚙️ Configuration Updates | ||
|
|
||
| ### pyproject.toml | ||
| - [ ] **Update project metadata** | ||
| ```toml | ||
| name = "your-project-name" | ||
| description = "Your project description" | ||
| authors = [{ name = "Your Name", email = "your.email@example.com" }] | ||
| ``` | ||
|
|
||
| - [ ] **Review dependencies** | ||
| - Remove unused template dependencies | ||
| - Add your project's specific dependencies | ||
| - Update dev dependencies as needed | ||
|
|
||
| - [ ] **Update coverage configuration** | ||
| - Ensure `[[MODULE_NAME]]` is replaced with your actual module name | ||
| - Adjust coverage threshold if needed (default: 96%) | ||
|
|
||
| ### .github/workflows/ci.yml | ||
| - [ ] **Review CI workflow** | ||
| - The workflow is automatically updated by `make init` | ||
| - Verify module name is correct in coverage commands | ||
| - Add additional jobs if needed (e.g., deployment, integration tests) | ||
|
|
||
| ## 🧹 Code Cleanup | ||
|
|
||
| ### Module Structure | ||
| - [ ] **Review your module directory** | ||
| - Remove or modify `core.py` based on your needs | ||
| - Add new modules as needed | ||
| - Update `__init__.py` with your public API | ||
|
|
||
| - [ ] **Update test files** | ||
| - Rename `test_example.py` to match your modules | ||
| - Remove template tests if not applicable | ||
| - Add tests for your actual functionality | ||
|
|
||
| ### main.py (if needed) | ||
| - [ ] **Decide if you need an entrypoint** | ||
| - If creating a library: Keep removed (default behavior) | ||
| - If creating an application: Create `main.py` with your entry point | ||
| - Update `pyproject.toml` to include `[project.scripts]` if needed | ||
|
|
||
| ## 🧪 Testing Updates | ||
|
|
||
| - [ ] **Update test configuration** | ||
| - Ensure `[[MODULE_NAME]]` is replaced in `pyproject.toml` | ||
| - Update coverage source paths if needed | ||
| - Add test-specific fixtures in `conftest.py` | ||
|
|
||
| - [ ] **Run tests** | ||
| ```bash | ||
| pytest | ||
| ``` | ||
| - Ensure all tests pass | ||
| - Check coverage meets the 96% threshold | ||
|
|
||
| ## 🚀 CI/CD Updates | ||
|
|
||
| - [ ] **Test CI workflow** | ||
| - Push your changes to GitHub | ||
| - Verify the CI workflow runs successfully | ||
| - Check that coverage reports are generated correctly | ||
|
|
||
| - [ ] **Set up Codecov** (optional) | ||
| - If using Codecov, add your repository token to GitHub secrets | ||
| - Update `CODECOV_TOKEN` in repository settings | ||
|
|
||
| ## 📄 License | ||
|
|
||
| - [ ] **Review license** | ||
| - Template uses MIT License | ||
| - Update LICENSE file if you need a different license | ||
| - Update `license = "MIT"` in `pyproject.toml` if changed | ||
|
|
||
| ## 🗑️ Remove Unnecessary Files | ||
|
|
||
| - [ ] **Remove template documentation** | ||
| - Delete `POST_INIT_CHECKLIST.md` after completing all steps | ||
| - Delete `TEMPLATE_GUIDE.md` (if you no longer need it) | ||
| - Consider creating your own contributing guide | ||
|
|
||
| ## ✅ Final Verification | ||
|
|
||
| - [ ] **Run all checks** | ||
| ```bash | ||
| make lint | ||
| make pytest | ||
| ``` | ||
| - Ensure linting passes | ||
| - Ensure tests pass with adequate coverage | ||
|
|
||
| - [ ] **Test your project** | ||
| - Install your package: `pip install -e .` | ||
| - Test your public API | ||
| - Verify documentation is clear and accurate | ||
|
|
||
| - [ ] **Commit your changes** | ||
| ```bash | ||
| git add . | ||
| git commit -m "chore: customize project after initialization" | ||
| ``` | ||
|
|
||
| ## 🎉 You're Done! | ||
|
|
||
| Your project is now fully configured and ready for development. Remember to: | ||
|
|
||
| - Keep documentation updated as you add features | ||
| - Maintain test coverage above 96% | ||
| - Follow the coding patterns defined in AGENTS.md | ||
| - Use conventional commits for your commit messages | ||
|
|
||
| For questions or issues, refer to the project documentation or create an issue in your repository. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.