Skip to content

feat: claude: Refactoring code, tests, docs and cicd process - #2

Merged
RaymondSu-Public-Base merged 2 commits into
mainfrom
feature/claude/refactoring-project
May 7, 2026
Merged

RaymondSu-Public-Base merged 2 commits into
mainfrom
feature/claude/refactoring-project

Conversation

@RaymondSu-Public-Base

Copy link
Copy Markdown
Owner
  • 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

Summary

Describe what this PR changes and why.

Related Issue

  • Closes #
  • Related: #

Type Of Change

  • feat: new feature
  • fix: bug fix
  • docs: documentation only
  • test: tests added or updated
  • chore: maintenance/refactor/build/ci updates

What Changed

How To Test

List exact commands and expected outcomes.

# Example
/home/raymondsu/src/Vibe-helloworld-python/.venv/bin/python -m pytest -q

Validation Evidence

  • Lint passes
  • Tests pass
  • Build succeeds (if applicable)

Paste important output snippets:

# ruff / pytest / build output

UI/UX Changes (if applicable)

  • No UI changes
  • UI updated (attach screenshots)
  • Docs updated (README.md or docs/*)

Before/After screenshots or links:

  • Before:
  • After:

CI Checklist

  • Workflow changes reviewed (.github/workflows/*)
  • poetry.lock updated when dependencies changed
  • Headless test requirements handled (QT_QPA_PLATFORM=offscreen when needed)

Risk And Rollback

  • Risk level: Low / Medium / ==High==
  • Rollback plan:

Reviewer Checklist

  • Scope is clear and focused
  • Code/docs are understandable
  • Tests are sufficient for changed behavior
  • No obvious regressions

v-raymondsu 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
@RaymondSu-Public-Base RaymondSu-Public-Base added documentation Improvements or additions to documentation enhancement New feature or request labels May 7, 2026
@RaymondSu-Public-Base RaymondSu-Public-Base self-assigned this May 7, 2026
@RaymondSu-Public-Base
RaymondSu-Public-Base merged commit 6030398 into main May 7, 2026
11 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_python entry point + Poetry script entry point.
  • Replaced formatting/style/build scripts with Python classes (CodeStyle, BuildExecutable) and added corresponding tests (including slow markers).
  • 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 thread README.md
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 thread src/hello_python/build.py
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 thread src/hello_python/build.py
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}")
Comment thread src/hello_python/build.py
exe = self.dist_path / f"{self.name}.exe"
else:
exe = self.dist_path / self.name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants