Skip to content

Develop#3

Merged
eiAlex merged 10 commits intomainfrom
develop
Dec 7, 2025
Merged

Develop#3
eiAlex merged 10 commits intomainfrom
develop

Conversation

@eiAlex
Copy link
Copy Markdown
Owner

@eiAlex eiAlex commented Dec 7, 2025

This pull request introduces a comprehensive development and CI/CD workflow for the project, focusing on code quality, security, and automation. It adds configuration files for linting and security, updates development dependencies, documents the development process, and implements a robust GitHub Actions pipeline for testing, building, and publishing. Additionally, the helper script for build and quality checks is improved and renamed for clarity.

CI/CD and Automation Enhancements:

  • Added a multi-stage GitHub Actions workflow (ci.yml) for CI/CD, covering testing (across OSes and Python versions), linting, type checking, security scanning, building, publishing to PyPI, and automated release creation.
  • Introduced .flake8 and .bandit configuration files for consistent linting and security checks, and integrated these tools into the workflow. [1] [2]

Development Environment and Documentation:

  • Expanded the README.md with a detailed development section, including environment setup, code quality tools usage, workflow instructions, and CI/CD overview.
  • Added requirements-dev.txt for streamlined installation of development dependencies and tooling.
  • Updated pyproject.toml to include new development dependencies (e.g., bandit, safety, build) and enhanced tool configurations for mypy, flake8, bandit, and coverage. [1] [2]

Build and Quality Script Improvements:

  • Renamed and refactored the helper script to scripts/build_helper.py, improving code clarity, error handling, and output formatting, and aligning commands with the documented workflow. [1] [2] [3] [4] [5] [6] [7]

Minor Code and Test Adjustments:

  • Made minor code style and test improvements for consistency and clarity, such as updating string quotes and test comments. [1] [2] [3] [4]

Summary of Most Important Changes:

1. CI/CD and Security Automation

  • Added a full-featured GitHub Actions workflow for testing, linting, type checking, security scanning, building, publishing, and release automation (.github/workflows/ci.yml).
  • Introduced .flake8 and .bandit config files and integrated them into the workflow for consistent code quality and security checks. [1] [2]

2. Development Experience and Documentation

  • Expanded README.md with detailed setup, workflow, and code quality instructions for contributors.
  • Added requirements-dev.txt for easy installation of all development and code verification dependencies.

3. Dependency and Tooling Updates

  • Updated pyproject.toml to include new development dependencies and enhanced tool configurations for mypy, flake8, bandit, and coverage. [1] [2]

4. Build Helper Script Improvements

  • Renamed and refactored the build helper script to scripts/build_helper.py, improving usability, output, and alignment with the documented workflow. [1] [2] [3] [4] [5] [6] [7]

5. Minor Code and Test Cleanup

  • Made small improvements to code style and test clarity. [1] [2] [3] [4]

eiAlex added 10 commits December 7, 2025 18:28
make with black

- Cleaned up whitespace and formatting across multiple files.
- Standardized string quotes to double quotes for consistency.
- Removed unnecessary blank lines and adjusted indentation.
- Enhanced logging messages for better clarity.
- Updated comments and docstrings for improved documentation.
- Ensured consistent use of argument formatting in function definitions.
- Improved error handling and response messages in the upload handler.
- Streamlined configuration loading and saving methods.
- Fixed unused variable assignments in handlers.py and utils.py
- Removed f-string placeholders where not needed in server.py and handlers.py
- Split long lines in cli.py, handlers.py, logging_config.py, and server.py
- Added .flake8 configuration file with exceptions for templates.py HTML strings
- All tests still pass and code formatting is compliant with Black

Resolves code quality issues for clean CI/CD pipeline
- Update Python version from 3.8 to 3.9 in mypy configuration
- Fix incompatible type assignments in config.py and logging_config.py:
  - Use default_factory for mutable default list in dataclass
  - Use Optional[T] syntax for nullable parameters (Python 3.8+ compatibility)
- Update CI/CD workflow to use .flake8 config file instead of inline args
- All type checks, linting, formatting, and tests now pass

Resolves mypy compliance for reliable type checking in CI/CD pipeline
Security Improvements:
- Added nosec comments for intentional 0.0.0.0 binding in file server
- Created .bandit configuration file to properly handle B104 warnings
- Updated CI/CD workflow to use bandit configuration file
- Refactored hardcoded IP checks to use variables for better maintainability

Code Quality:
- Fixed line length violations caused by security comments
- Maintained Black formatting compliance
- All security, linting, type checking, and tests pass

Resolves all Bandit security warnings while maintaining server accessibility
Breaking Changes Fixed:
- Updated actions/setup-python from v4 to v5
- Updated actions/upload-artifact from v3 to v4 (fixes deprecation error)
- Updated actions/download-artifact from v3 to v4
- Updated codecov/codecov-action from v3 to v4

Pipeline Improvements:
- Integrated security checks (bandit) into test job for efficiency
- Removed separate security job to reduce complexity
- Updated Python version matrix: removed 3.8 (mypy compatibility), added 3.13
- Added bandit to test dependencies for comprehensive security scanning
- Simplified job dependencies (build now only needs test)

Resolves GitHub Actions deprecation warnings and improves pipeline performance
- Separated security checks back into dedicated job for parallel execution
- Test and security jobs now run simultaneously instead of sequentially
- Added safety check with || true to prevent failure on system dependencies
- Build job now depends on both test and security jobs
- Improved overall pipeline efficiency through parallelization
- Move build.py to scripts/build_helper.py to avoid conflict with python -m build
- This resolves CI/CD build failures where local build.py was interfering with package building
- python -m build now works correctly for package distribution
@eiAlex eiAlex merged commit 02c2774 into main Dec 7, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant