wads.config_comparison¶
Compare project configuration files (pyproject.toml, setup.cfg, MANIFEST.in) against templates.
This module provides tools to analyze project configurations and identify differences from standard templates, helping users maintain up-to-date project structures.
- Key Functions:
compare_pyproject_toml: Compare actual pyproject.toml against template compare_setup_cfg: Analyze setup.cfg and recommend migration compare_manifest_in: Analyze MANIFEST.in and recommend Hatchling migration summarize_config_status: Overall project config health check compare_ci_workflow: Compare CI workflow against template
Example
>>> from wads.config_comparison import summarize_config_status
>>> status = summarize_config_status('/path/to/project')
>>> if status['needs_attention']:
... print(status['recommendations'])
Functions
|
Compare CI workflow against modern template. |
|
Analyze MANIFEST.in and recommend migration to Hatchling configuration. |
|
Compare actual pyproject.toml against template. |
|
Analyze setup.cfg and recommend migration to pyproject.toml. |
|
Check overall config status of a project. |
- wads.config_comparison.compare_ci_workflow(actual_path, template_path='/home/runner/work/wads/wads/wads/data/github_ci_publish_2025.yml', *, project_name=None)[source]¶
Compare CI workflow against modern template.
- Parameters:
- Return type:
- Returns:
Dictionary with comparison results and recommendations
Example
>>> diff = compare_ci_workflow('.github/workflows/ci.yml') >>> if diff['needs_attention']: ... print("CI might be outdated")
- wads.config_comparison.compare_manifest_in(actual_path)[source]¶
Analyze MANIFEST.in and recommend migration to Hatchling configuration.
- Parameters:
- Return type:
- Returns:
Dictionary with migration recommendations
Example
>>> analysis = compare_manifest_in('MANIFEST.in') >>> if analysis['needs_migration']: ... print(analysis['hatchling_config'])
- wads.config_comparison.compare_pyproject_toml(actual_path, template_path='/home/runner/work/wads/wads/wads/data/pyproject_toml_tpl.toml', *, ignore_keys=None, project_name=None)[source]¶
Compare actual pyproject.toml against template.
- Parameters:
- Returns:
‘missing_sections’: sections in template but not in actual
’outdated_sections’: sections in actual that might be outdated
’recommendations’: suggested updates
’needs_attention’: boolean flag
- Return type:
Example
>>> diff = compare_pyproject_toml('my_project/pyproject.toml') >>> if diff['needs_attention']: ... for rec in diff['recommendations']: ... print(f" - {rec}")
- wads.config_comparison.compare_setup_cfg(actual_path, *, warn_about_deprecation=True)[source]¶
Analyze setup.cfg and recommend migration to pyproject.toml.
- Parameters:
- Return type:
- Returns:
Dictionary with migration recommendations
Example
>>> analysis = compare_setup_cfg('old_project/setup.cfg') >>> if analysis['should_migrate']: ... print(analysis['recommendations'])
- wads.config_comparison.summarize_config_status(pkg_dir, *, check_ci=True, project_name=None)[source]¶
Check overall config status of a project.
Analyzes pyproject.toml, setup.cfg, CI workflows and returns a comprehensive summary of what needs attention.
- Parameters:
- Returns:
‘has_pyproject’: bool
’has_setup_cfg’: bool
’has_ci’: bool
’needs_attention’: list of issues
’recommendations’: list of recommendations
Details for each file type
- Return type:
Example
>>> status = summarize_config_status('/path/to/project') >>> for issue in status['needs_attention']: ... print(f"⚠️ {issue}")