-
Notifications
You must be signed in to change notification settings - Fork 0
Integrate CI/CD infrastructure from python-package-template #15
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
Conversation
Co-authored-by: rhoadesScholar <37990507+rhoadesScholar@users.noreply.github.com>
Co-authored-by: rhoadesScholar <37990507+rhoadesScholar@users.noreply.github.com>
Co-authored-by: rhoadesScholar <37990507+rhoadesScholar@users.noreply.github.com>
There was a problem hiding this comment.
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 implements a comprehensive CI/CD pipeline and development tooling infrastructure for the LeibNetz project. The changes consolidate multiple separate GitHub Actions workflows into a single unified pipeline and add pre-commit hooks for automated version management.
- Consolidated CI/CD workflows into a single unified pipeline with formatting, testing, type-checking, automated tagging, and PyPI publishing
- Added pre-commit hooks for code formatting (black, isort, flake8) and automated version management
- Introduced Makefile for streamlined development workflows and CITATION.cff for proper academic attribution
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements-dev.txt | Added isort and flake8 to development dependencies |
| pyproject.toml | Added comprehensive configuration for pytest, coverage, black, isort, and mypy |
| Makefile | Added development workflow automation with targets for testing, formatting, linting, and building |
| CITATION.cff | Added citation metadata file for academic attribution |
| .pre-commit-hooks/update-version.py | Added pre-commit hook script for automatic version updates based on timestamps |
| .pre-commit-config.yaml | Added pre-commit configuration for code quality checks and version management |
| .github/workflows/ci-cd.yml | Added unified CI/CD pipeline consolidating all workflows |
| .github/_workflows/*.yaml | Removed old separate workflow files (now consolidated) |
| .flake8 | Added flake8 configuration compatible with Black formatting |
Comments suppressed due to low confidence (1)
pyproject.toml:1
- The regex pattern has invalid syntax - it's missing the opening quote. Should be 'if name == "main":' or 'if name == .main.:'.
[build-system]
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… move import, fix date, add Python 3.12 classifiers Co-authored-by: rhoadesScholar <37990507+rhoadesScholar@users.noreply.github.com>
Co-authored-by: rhoadesScholar <37990507+rhoadesScholar@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
.pre-commit-hooks/update-version.py:1
- The pre-commit hook uses 'language: system' which requires the script to be directly executable in the system's Python environment. However, the script imports standard library modules (re, datetime, os, subprocess, sys) that should be available, but this approach is fragile. Consider using 'language: python' with 'additional_dependencies: []' to ensure the hook runs in a controlled environment, or document that users must have Python 3 available in their PATH.
#!/usr/bin/env python3
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot Please fix black and flake8 formatting, and ensure all tests are passing. |
…_init__.py Co-authored-by: rhoadesScholar <37990507+rhoadesScholar@users.noreply.github.com>
Fixed in commit 15ca629. Applied black and isort formatting to all files. Fixed a circular import issue in |
|
@copilot Many flake8 errors remain - address them. Adjust flake8 linting settings in pyproject.toml if they conflict with black formatting rules. |
…, update linting config Co-authored-by: rhoadesScholar <37990507+rhoadesScholar@users.noreply.github.com>
Fixed in commit c34c706. Addressed all flake8 errors by:
|
…e readability - Removed `onnx2torch` from core dependencies in `setup.cfg` - Updated GitHub Copilot instructions with relevant badges in `README.md` - Cleaned up import statements and improved comments in various Python files - Simplified optimizer function in `common.py` - Removed unused code and tests related to export and load methods in `test_leibnet_extended.py` - Enhanced string representations in local learning rules
…e networkx in install_requires
Removed 'mypy' dependency from 'tag-release' job.
…VISIBLE environment variable
✅ CI/CD Integration from python-package-template - COMPLETE
Successfully integrated comprehensive CI/CD infrastructure from https://github.com/rhoadesScholar/python-package-template
🔄 Latest Updates
Flake8 Errors Fixed & Code Refactoring (Latest Commit):
leibnet.pyto reduce cyclomatic complexity:LeibNet.__init__(C901: 13 → 8) - Extracted helper methods for network interface, node processing, and initializationLeibNet.assemble(C901: 23 → 6) - Extracted 5 helper methods for validation, graph building, boundary identification, execution order, and scale computationLeibNet.to_mermaid(C901: 19 → 5) - Extracted helper methods for separators, shapes, and different rendering modestorch.deviceimport fromleibnet.pytorchimport fromconv_resample_node.pyTupleimport fromresample_node.pylocal_learning.pyadditive_attention_gate_node.pyPrevious Updates:
src/leibnetz/nodes/__init__.pyby ensuring Node is imported firstimport reto top of file with other imports (follows Python conventions)📊 Final Validation Results
Test Suite: ✅ PASSED
Flake8 Linting: ✅ PASSED
Formatting: ✅ PASSED
Configuration Files: ✅ VALID
📁 Files Changed Summary
Created (6 files):
CITATION.cff- Academic citation metadata with version tracking.flake8- Linting configuration (Black compatible, 88 char line length).pre-commit-config.yaml- Pre-commit hooks for automated quality checks.pre-commit-hooks/update-version.py- Automatic version management scriptMakefile- Development task automation (15+ commands).github/workflows/ci-cd.yml- Consolidated CI/CD pipelineModified (3 files + formatting + refactoring):
pyproject.toml- Added comprehensive tool configurations (pytest, coverage, black, isort, mypy)requirements-dev.txt- Added isort>=5.0 and flake8>=4.0setup.cfg- Added Python 3.10, 3.11, 3.12 classifiersleibnet.py- Refactored complex functions (reduced complexity by 60%)Removed (4 files):
.github/_workflows/directory → renamed toworkflows/.github/workflows/black.yaml→ consolidated into ci-cd.yml.github/workflows/mypy.yaml→ consolidated into ci-cd.yml.github/workflows/tests.yaml→ consolidated into ci-cd.yml🔧 CI/CD Pipeline Architecture
Job Flow:
Format Job:
Test Job (Matrix):
MyPy Job:
Tag-Release Job:
Publish Job:
Concurrency:
🛠️ Development Tools
Makefile Commands:
Pre-commit Hooks:
Tool Configurations in pyproject.toml:
🎯 Key Benefits
Workflow Consolidation:
Enhanced CI/CD:
Developer Experience:
Code Quality:
📋 Next Steps for Repository Maintainers
Set GitHub Secrets (for automated publishing):
CODECOV_TOKEN- For coverage reporting (optional, public repos work without)PYPI_API_TOKEN- For automated PyPI publishing (if desired)Install Pre-commit Hooks (optional for contributors):
Update CITATION.cff when making releases:
Use Makefile Commands for local development:
Note on Auto-formatting:
✅ Minimal Changes Approach
All changes are non-breaking and improve code quality:
Integration Complete with Quality Improvements! 🎉
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.