Skip to content

💡 [Feature]: Add Python CI Pipeline with Automated Testing and Code Quality Checks #517

@Ashvin-KS

Description

@Ashvin-KS

Problem Statement

The repository currently has 40+ Python projects with zero automated tests and no Python CI pipeline. When contributors submit new projects or modify existing ones, there is no mechanism to verify the code runs without syntax errors, ensure new changes don't break existing projects, or enforce code quality standards. This makes maintenance challenging as the project grows.

Proposed Enhancement

Set up a Python CI pipeline and lightweight testing infrastructure using only Python standard library (unittest) to maintain the zero-dependency ethos:

  1. Create a tests/ directory with test files for existing projects
  2. Add a .github/workflows/python-ci.yml workflow that runs on push/PR to main
  3. Test matrix across Python 3.10, 3.11, 3.12
  4. Syntax-check all .py files with python -m py_compile
  5. Run python -m unittest discover -s tests -v
  6. Add basic unittest tests for representative projects (math, games, utilities)
  7. Update CONTRIBUTING.md with a "Writing Tests" section

Suggested Implementation

.github/workflows/python-ci.yml:

  • Trigger: push and pull_request on main
  • Strategy matrix: python-version: ["3.10", "3.11", "3.12"]
  • Steps: checkout → setup-python → syntax check all .py files → run unittest

tests/ directory:

  • tests/test_armstrong.py — test pure math functions
  • tests/test_number_guessing.py — test game logic
  • tests/test_typing_speed.py — test utility functions

pyproject.toml:

  • Basic project metadata, Python >=3.10 requirement

  • I am a registered GSSoC 2026 contributor.
  • I would like to implement this feature myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions