Repository navigation
feat: claude: Refactoring code, tests, docs and cicd process - #2
Merged
Merged
Conversation
added 2 commits
May 7, 2026 13:49
- Replaced scripts/ by python class - Added test cases: slow and fast args - Added pre-commit hook and cicd github actions - Updated docs - Updated PR template - Updated poetry virtual environment
- Updated docs
There was a problem hiding this comment.
Pull request overview
This PR refactors project automation (format/lint/build) from shell scripts into Python modules, adds build/style test coverage, and introduces pre-commit plus CI/CD workflows to standardize quality gates across local development and GitHub Actions.
Changes:
- Moved GUI window code into a dedicated module and added
python -m hello_pythonentry point + Poetry script entry point. - Replaced formatting/style/build scripts with Python classes (
CodeStyle,BuildExecutable) and added corresponding tests (includingslowmarkers). - Added pre-commit hooks and expanded GitHub Actions into separate lint/test/build jobs plus a CD workflow for release candidates; updated docs/templates accordingly.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_main.py | Updated tests to use shared app fixture and new HelloWindow module import/patching. |
| tests/test_codestyle.py | Added unit tests for the new CodeStyle helper. |
| tests/test_build.py | Added build configuration tests and Windows-only slow build integration coverage. |
| tests/test_build_class.py | Added unit + slow integration tests for BuildExecutable. |
| tests/conftest.py | Introduced session-scoped QApplication fixture with offscreen support for CI. |
| src/hello_python/window.py | New HelloWindow UI module extracted from main.py. |
| src/hello_python/main.py | Simplified entrypoint; imports HelloWindow lazily and retains get_hello_message(). |
| src/hello_python/codestyle.py | New Ruff runner class to replace shell formatting/style scripts. |
| src/hello_python/build.py | New PyInstaller build class to replace platform scripts. |
| src/hello_python/main.py | Enables python -m hello_python execution path. |
| src/hello_python/init.py | Updates package description and exports get_hello_message. |
| scripts/style_check.sh | Removed legacy shell-based Ruff style check script. |
| scripts/format.sh | Removed legacy shell-based Ruff format script. |
| scripts/build_windows.ps1 | Removed legacy Windows PowerShell build script. |
| scripts/build_linux.sh | Removed legacy Linux build script. |
| README.md | Updated usage instructions (Poetry scripts, pre-commit, CI/CD, structure). |
| pyproject.toml | Adds Poetry script entry point, groups build deps, configures Ruff/Pytest markers. |
| poetry.lock | Updated lockfile for new dependency set and Python version range. |
| docs/penpot-uiux-spec.json | Updated implementation mapping and command references to new entry points. |
| docs/penpot-uiux-import.md | Documented current UI implementation and updated run/build commands. |
| docs/git-version-control.md | Updated recommended local checks and pre-commit usage. |
| docs/figma-uiux-style-guide.md | Updated interaction flow and added implementation references. |
| docs/CICD-validation.md | New consolidated Pre-commit/CI/CD guide (replacing prior CI validation doc). |
| docs/ci-validation.md | Removed legacy CI validation tutorial doc. |
| .pre-commit-config.yaml | Added Ruff hooks + local pytest hook for fast test gate. |
| .github/workflows/ci.yml | Split CI into lint/test/build jobs across OS + Python matrices. |
| .github/workflows/cd.yml | Added workflow-run CD pipeline to publish release-candidate artifacts. |
| .github/pull_request_template.md | Updated template commands + checklist aligned with new tooling. |
| .github/copilot-instructions.md | Expanded project overview, structure, and common commands for contributors. |
Comment on lines
+132
to
+139
| - **CI:** `.github/workflows/ci.yml` — lint, test, build on push/PR | ||
| - **CD:** `.github/workflows/cd.yml` — release candidate on main after CI passes | ||
|
|
||
| Note: PyInstaller does not reliably cross-compile Windows executables from Linux. Use the Windows script on Windows. | ||
| See `docs/ci-validation.md` for full details. | ||
|
|
||
| ## Additional Documentation | ||
|
|
||
| - CI validation tutorial: `docs/ci-validation.md` | ||
| - Git version control guide: `docs/git-version-control.md` | ||
| - Figma-style UI/UX spec: `docs/figma-uiux-style-guide.md` | ||
| - Penpot UI/UX spec JSON: `docs/penpot-uiux-spec.json` | ||
| - Penpot import guide: `docs/penpot-uiux-import.md` | ||
| - [Pre-commit, CI & CD Guide](docs/ci-validation.md) |
Comment on lines
+20
to
+29
| if platform.system() == "Windows": | ||
| self.name = "hello-python-windows" | ||
| self.dist_path = self.root_dir / "dist" / "windows" | ||
| self.work_path = self.root_dir / "build" / "pyinstaller" / "windows" | ||
| self.spec_path = self.root_dir / "build" / "spec" / "windows" | ||
| else: | ||
| self.name = "hello-python-linux" | ||
| self.dist_path = self.root_dir / "dist" / "linux" | ||
| self.work_path = self.root_dir / "build" / "pyinstaller" / "linux" | ||
| self.spec_path = self.root_dir / "build" / "spec" / "linux" |
Comment on lines
+67
to
+69
| result = subprocess.run(cmd, cwd=str(self.root_dir), check=False) | ||
| if result.returncode != 0: | ||
| raise RuntimeError(f"Build failed with exit code {result.returncode}") |
| exe = self.dist_path / f"{self.name}.exe" | ||
| else: | ||
| exe = self.dist_path / self.name | ||
|
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Describe what this PR changes and why.
Related Issue
Type Of Change
What Changed
How To Test
List exact commands and expected outcomes.
# Example /home/raymondsu/src/Vibe-helloworld-python/.venv/bin/python -m pytest -qValidation Evidence
Paste important output snippets:
UI/UX Changes (if applicable)
README.mdordocs/*)Before/After screenshots or links:
CI Checklist
.github/workflows/*)poetry.lockupdated when dependencies changedQT_QPA_PLATFORM=offscreenwhen needed)Risk And Rollback
Reviewer Checklist