Skip to content

Conversation

@sebastianorbell-qm
Copy link

chore: Add CI/CD setup with Black, Pylint, and pre-commit hooks to project styx

PR Description:

Summary

  • Set up comprehensive CI/CD tooling for code quality and consistency
  • Black for formatting and Pylint for linting
  • Added pre-commit hooks for automated checks on commits
  • Configured development dependencies and tooling in pyproject.toml

Changes

Configuration Files Added

  • .pre-commit-config.yaml: Pre-commit hooks configuration with:

    • Black formatter
    • Pylint linter using .pylintrc configuration
    • mypy for type checking (runs on push)
    • Generic hygiene checks (trailing whitespace, EOF, YAML/JSON validation)
    • Commitizen for conventional commits
  • .pylintrc: Pylint configuration enabling errors, refactor suggestions, and conventions while disabling warnings

  • CONTRIBUTING.md: Comprehensive contribution guide covering:

    • Development environment setup
    • Branch naming conventions (feature/, bugfix/, hotfix/, chore/, refactor/, experiment/, release/)
    • Pre-commit hooks usage (runs on staged files by default)
    • Conventional commits format
    • Testing and PR guidelines

pyproject.toml Updates

  • Added dev dependencies: black, pylint, mypy, pre-commit, commitizen, pytest-cov
  • Configured [tool.pylint.main] to reference .pylintrc
  • Added [tool.pytest.ini_options] with coverage settings
  • Added [tool.mypy] configuration
  • Added [tool.commitizen] for version management

Developer Setup

After merging, developers should run:

cd qualibration_graphs
pip install -e "superconducting[dev]"
pre-commit install
pre-commit install --hook-type commit-msg

Test Plan

- Install dev dependencies
- Run pre-commit run on staged changes
- Verify Black formatting works
- Verify Pylint runs with .pylintrc configuration
- Test conventional commit message validation

@KevinAVR
Copy link
Collaborator

  • Install dev dependencies: successfull and see pip freeze below / I had to use uv pip install -e "superconducting[dev]" --prerelease=allow

Using Python 3.11.11 environment at: .kev
Resolved 114 packages in 2.16s
Built superconducting-calibrations @ file:///C:/Users/KevinAVillegasRosale/OneDrive%20-%20QM%20Machine
Updated https://github.com/qua-platform/qualibration-libs.git (f6cb526d58f6a82d1c43fcabbce3351ad0ab3fdf
Built qualibration-libs @ git+https://github.com/qua-platform/qualibration-libs.git@f6cb526d58f6a82d1c
Prepared 17 packages in 50.59s
Installed 114 packages in 24.81s

  • a2wsgi==1.10.10
  • annotated-types==0.7.0
  • anyio==4.12.0
  • argcomplete==3.6.3
  • asteval==1.0.8
  • betterproto==2.0.0b7
  • black==26.1a1
  • certifi==2025.11.12
  • cffi==2.0.0
  • charset-normalizer==3.4.4
  • click==8.1.8
  • colorama==0.4.6
  • contourpy==1.3.3
  • cryptography==46.0.3
  • cycler==0.12.1
  • datadog-api-client==2.48.0
  • datamodel-code-generator==0.33.0
  • dependency-injector==4.48.3
  • dill==0.4.0
  • fastapi==0.117.1
  • fonttools==4.61.1
  • genson==1.3.0
  • grpcio==1.76.0
  • grpclib==0.4.5
  • h11==0.16.0
  • h2==4.3.0
  • hpack==4.1.0
  • httpcore==1.0.9
  • httpx==0.28.1
  • hyperframe==6.1.0
  • ibm-cloud-sdk-core==3.24.2
  • ibm-platform-services==0.72.0
  • idna==3.11
  • inflect==7.5.0
  • isort==6.1.0
  • jinja2==3.1.6
  • joblib==1.5.3
  • jsonpatch==1.33
  • jsonpointer==3.0.0
  • kiwisolver==1.4.10rc0
  • lmfit==1.3.4
  • markupsafe==3.0.3
  • marshmallow==3.23.3
  • marshmallow-polyfield==5.11
  • matplotlib==3.10.8
  • more-itertools==10.8.0
  • mpmath==1.3.0
  • multidict==6.7.0
  • mypy-extensions==1.1.0
  • networkx==3.4.2
  • numpy==1.26.4
  • packaging==25.0
  • pandas==3.0.0rc1
  • pathspec==0.12.1
  • pillow==12.0.0
  • platformdirs==4.5.1
  • plotly==5.24.1
  • protobuf==6.33.2
  • pycparser==2.23
  • pydantic==2.12.5
  • pydantic-core==2.41.5
  • pydantic-settings==2.12.0
  • pyjwt==2.10.1
  • pyparsing==3.3.1
  • pyspnego==0.12.0
  • python-dateutil==2.9.0.post0
  • python-dotenv==1.2.1
  • python-json-logger==3.3.0
  • pytokens==0.3.0
  • pyyaml==6.0.3
  • qiskit==1.4.5
  • qiskit-experiments==0.13.0
  • qiskit-ibm-experiment==0.4.8
  • qiskit-ibm-runtime==0.44.0
  • qm-octave==2.1.6
  • qm-qua==1.2.4
  • qualang-tools==0.21.0
  • qualibrate==0.4.0
  • qualibrate-app==0.5.0
  • qualibrate-config==0.1.8
  • qualibrate-core==0.5.0
  • qualibrate-runner==0.5.0
  • qualibration-libs==0.2.1 (from git+https://github.com/qua-platform/qualibration-libs.git@f6cb526d58f6a82d1c43fcabbce3351ad0ab3fdf)
  • quam==0.5.0a2
  • quam-builder==0.2.1 (from git+https://github.com/qua-platform/quam-builder.git@e3683ff182bda5c5f339af088993b907355c2466)
  • requests==2.32.5
  • requests-ntlm==1.3.0
  • rustworkx==0.17.1
  • scikit-learn==1.8.0
  • scipy==1.17.0rc1
  • six==1.17.0
  • sspilib==0.5.0
  • starlette==0.48.0
  • stevedore==5.6.0
  • superconducting-calibrations==0.1.0 (from file:///C:/Users/KevinAVillegasRosale/OneDrive%20-%20QM%20Machines%20LTD/Documents/GitKraken/CS_installations/qualibration_graphs/superconducting)
  • symengine==0.13.0
  • sympy==1.14.0
  • tenacity==9.1.2
  • threadpoolctl==3.6.0
  • tinydb==4.8.2
  • tomli==2.3.0
  • tomli-w==1.2.0
  • tqdm==4.67.1
  • typeguard==4.4.4
  • types-networkx==3.4.2.20250527
  • typing-extensions==4.15.0
  • typing-inspection==0.4.2
  • tzdata==2025.3
  • uncertainties==3.2.3
  • urllib3==2.6.2
  • uvicorn==0.37.0
  • websocket-client==1.9.0
  • websockets==15.0.1
  • xarray==2025.12.0
    warning: The package superconducting-calibrations @ file:///C:/Users/KevinAVillegasRosale/OneDrive%20-%20QM%20Machines%20LTD/Documents/GitKraken/CS_installations/qualibration_graphs/superconducting does not have an extra named dev

@KevinAVR
Copy link
Collaborator

@sebastianorbell-qm I got stuck here / I could not run pre-commit from powershell not sure if I have to do it somewhere else. I had staged changes in git I made tiny comment on it

image

- Move .pre-commit-config.yaml, .pylintrc, and CONTRIBUTING.md to superconducting/
- Update pyproject.toml to reference .pylintrc in same directory
- Update CONTRIBUTING.md with correct repository paths

This consolidates all configuration files at the same level as pyproject.toml
for better organization and easier maintenance.
Pylint automatically discovers .pylintrc in the same directory,
so the [tool.pylint.main] section is unnecessary.
@sebastianorbell-qm
Copy link
Author

@KevinAVR I have updated the instructions in CONTRIBUTING.md and moved the pre-commit yaml into the same directory as pyproject.toml

Add standard Python project exclusions including:
- Virtual environments (.venv/, venv/)
- Python cache files (*.pyc, __pycache__/)
- Test artifacts (.coverage, htmlcov/)
- IDE files (.vscode/, .idea/, .DS_Store)
- Build artifacts (dist/, build/, *.egg-info/)
- Tool caches (.mypy_cache/, .ruff_cache/, .pre-commit-cache/)

Note: uv.lock is intentionally tracked for reproducible builds.
Copy link
Collaborator

@OziEgri OziEgri left a comment

Choose a reason for hiding this comment

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

It looks good, was it tested E2E yet?

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.

4 participants