wexample-wex-addon-dev-python 13.1.0__tar.gz → 13.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wexample_wex_addon_dev_python-13.2.0/PKG-INFO +310 -0
- wexample_wex_addon_dev_python-13.2.0/README.md +284 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/pyproject.toml +4 -4
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/config_value/python_package_readme_config_value.py +13 -11
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/helper → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/formatter}/__init__.py +0 -0
- wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/formatter/python_code_formatter.py +46 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/selection → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/middleware/__pycache__}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/services → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/operation}/__init__.py +0 -0
- wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/operation/generated_description_operation.py +127 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/services/python → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/option}/__init__.py +0 -0
- wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/option/generated_description_option.py +77 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/services/python/commands → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/options_provider}/__init__.py +0 -0
- wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/options_provider/generative_options_provider.py +26 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/python_addon_manager.py +31 -1
- wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/resources/ai/agents/describer/agent.yml +8 -0
- wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/resources/ai/agents/describer/context.j2 +36 -0
- wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/resources/design_rules/python_code.md +13 -0
- wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/resources/readme_templates/install.md.j2 +7 -0
- wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/resources/writing_rules/python_code.md +41 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/services/python/commands/service → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/selection}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/tests/helper → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/services/python/samples/docker/images}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/tests/integration → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/workdir}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/tests/integration/refactor → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/workdir/__pycache__}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/tests/unit → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/workdir/mixin}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/workdir/python_package_workdir.py +10 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/workdir/python_workdir.py +32 -3
- wexample_wex_addon_dev_python-13.2.0/tests/integration/__init__.py +0 -0
- wexample_wex_addon_dev_python-13.2.0/tests/integration/refactor/__init__.py +0 -0
- wexample_wex_addon_dev_python-13.2.0/tests/unit/__init__.py +0 -0
- wexample_wex_addon_dev_python-13.2.0/tests/unit/helper/__init__.py +0 -0
- wexample_wex_addon_dev_python-13.2.0/tests/unit/refactor/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_rename_plan.py +19 -11
- wexample_wex_addon_dev_python-13.1.0/PKG-INFO +0 -491
- wexample_wex_addon_dev_python-13.1.0/README.md +0 -465
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/__pycache__/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/check/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/check/mypy.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/check/pylint.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/check/pyright.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/check.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/format/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/format/black.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/format/isort.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/format.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/code/rename.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/examples/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/examples/utils/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/examples/utils/some_example_type.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/examples/validate.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/commands/release/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/common/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/common/pypi_registry_gateway.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/config_value/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/config_value/__pycache__/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/const/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/const/__pycache__/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/const/package.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/const/python.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/const/tags.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/file/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/file/__pycache__/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/file/python_app_iml_file.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/file/python_pyproject_toml_file.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/middleware → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/helper}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/helper/pdm.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/middleware/__pycache__ → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/middleware}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/middleware/each_python_file_middleware.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/py.typed +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/abstract_python_path_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/abstract_python_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/abstract_python_symbol_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/applier.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/python_class_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/python_common.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/python_constant_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/python_function_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/python_module_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/python_package_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/rename_plan.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/refactor/symbol_kind.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/resources/.wex.yml +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/resources/docker/Dockerfile.python-profiling +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/resources/package_publish_gitlab.yml +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/resources/readme_templates/tests.md.j2 +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/selection/abstract_python_code_selection.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/selection/python_code_performance_selection.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/services/python/samples → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/services}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/services/python/samples/docker → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/services/python}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/app_service.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/services/python/samples/docker/images → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/services/python/commands}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/workdir → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/services/python/commands/service}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/commands/service/install.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/commands/service/setup.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/docker/.wex.yml +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/docker/docker-compose.yml +0 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/workdir/__pycache__ → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/services/python/samples}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0/src/wexample_wex_addon_dev_python/workdir/mixin → wexample_wex_addon_dev_python-13.2.0/src/wexample_wex_addon_dev_python/services/python/samples/docker}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/docker-compose.yml +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/entrypoint.sh +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/images/Dockerfile.base +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/images/Dockerfile.develop +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/services/python/service.yml +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/workdir/mixin/with_profiling_python_workdir_mixin.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/src/wexample_wex_addon_dev_python/workdir/python_packages_suite_workdir.py +0 -0
- /wexample_wex_addon_dev_python-13.1.0/tests/unit/helper/__init__.py → /wexample_wex_addon_dev_python-13.2.0/tests/.gitkeep +0 -0
- {wexample_wex_addon_dev_python-13.1.0/tests/unit/refactor → wexample_wex_addon_dev_python-13.2.0/tests/helper}/__init__.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/helper/test_pdm.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/integration/refactor/test_python_class_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/integration/refactor/test_python_constant_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/integration/refactor/test_python_function_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/integration/refactor/test_python_module_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/integration/refactor/test_python_package_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/helper/test_pdm.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_abstract_python_path_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_abstract_python_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_abstract_python_symbol_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_applier.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_python_class_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_python_common.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_python_constant_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_python_function_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_python_module_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_python_package_rename_handler.py +0 -0
- {wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/tests/unit/refactor/test_symbol_kind.py +0 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: wexample-wex-addon-dev-python
|
|
3
|
+
Version: 13.2.0
|
|
4
|
+
Summary: Extends wex with commands to format, lint, and rename Python symbols, plus workdir types for Python packages and suites
|
|
5
|
+
Author-Email: weeger <contact@wexample.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Project-URL: homepage, https://github.com/wexample/python-wex-dev-python
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Requires-Dist: attrs>=23.1.0
|
|
13
|
+
Requires-Dist: cattrs>=23.1.0
|
|
14
|
+
Requires-Dist: griffe>=2.0.2
|
|
15
|
+
Requires-Dist: networkx
|
|
16
|
+
Requires-Dist: pylint
|
|
17
|
+
Requires-Dist: pyright
|
|
18
|
+
Requires-Dist: wexample-api>=6.8.0
|
|
19
|
+
Requires-Dist: wexample-filestate-python>=9.0.0
|
|
20
|
+
Requires-Dist: wexample-wex-addon-ai>=13.0.0
|
|
21
|
+
Requires-Dist: wexample-wex-addon-app>=30.0.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: pytest; extra == "dev"
|
|
24
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# wex_addon_dev_python
|
|
28
|
+
|
|
29
|
+
Version: 13.2.0
|
|
30
|
+
|
|
31
|
+
`wex_addon_dev_python` extends the wex CLI with a `python::` command group that formats source files with isort and black (`python::code/format`), checks them with mypy, pylint, and pyright (`python::code/check`), and renames Python symbols — packages, modules, classes, functions, constants — while propagating every affected import statement across the workdir (`python::code/rename`). It also ships `PythonPackageWorkdir` and `PythonPackagesSuiteWorkdir`, two workdir types that let wex manage a single PDM-based package or a multi-package suite as a first-class project structure. The intended users are wex operators who develop and maintain Python packages within the wexample ecosystem.
|
|
32
|
+
|
|
33
|
+
## Table of Contents
|
|
34
|
+
|
|
35
|
+
- [Installation](#installation)
|
|
36
|
+
- [Quickstart](#quickstart)
|
|
37
|
+
- [Tests](#tests)
|
|
38
|
+
- [Architecture](#architecture)
|
|
39
|
+
- [Integration in the Suite](#integration-in-the-suite)
|
|
40
|
+
- [Dependencies](#dependencies)
|
|
41
|
+
- [Versioning & Compatibility Policy](#versioning--compatibility-policy)
|
|
42
|
+
- [License](#license)
|
|
43
|
+
- [About us](#about-us)
|
|
44
|
+
- [Known Limitations & Roadmap](#known-limitations--roadmap)
|
|
45
|
+
- [Status & Compatibility](#status--compatibility)
|
|
46
|
+
- [Useful Links](#useful-links)
|
|
47
|
+
- [Migration Notes](#migration-notes)
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install wexample-wex-addon-dev-python
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Requires Python >=3.10.
|
|
56
|
+
|
|
57
|
+
## Quickstart
|
|
58
|
+
|
|
59
|
+
Install from PyPI:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install wexample-wex-addon-dev-python
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
That makes the `python::` command group available to wex. Pass any file or directory to `--file`; the middleware expands globs and recurses automatically.
|
|
66
|
+
|
|
67
|
+
Format a source tree — isort sorts imports, black reformats the rest:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
wex python::code/format --file src/mypackage/
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Run the three static-analysis tools (mypy, pylint, pyright) against the same tree:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
wex python::code/check --file src/mypackage/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Rename a Python symbol and rewrite every import statement that references it across the workdir. The `--dry_run` flag prints which files would change without touching them:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
wex python::code/rename \
|
|
83
|
+
--source mylib.helpers \
|
|
84
|
+
--target mylib.helper \
|
|
85
|
+
--kind package \
|
|
86
|
+
--dry_run
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Drop `--dry_run` to apply. Valid `--kind` values are `package`, `module`, `class`, `function`, and `constant`.
|
|
90
|
+
|
|
91
|
+
## Tests
|
|
92
|
+
|
|
93
|
+
This project uses `pytest` for testing and `pytest-cov` for code coverage analysis.
|
|
94
|
+
|
|
95
|
+
### Installation
|
|
96
|
+
|
|
97
|
+
First, install the required testing dependencies:
|
|
98
|
+
```bash
|
|
99
|
+
.venv/bin/python -m pip install pytest pytest-cov
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Basic Usage
|
|
103
|
+
|
|
104
|
+
Run all tests with coverage:
|
|
105
|
+
```bash
|
|
106
|
+
.venv/bin/python -m pytest --cov --cov-report=html
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Common Commands
|
|
110
|
+
```bash
|
|
111
|
+
# Run tests with coverage for a specific module
|
|
112
|
+
.venv/bin/python -m pytest --cov=your_module
|
|
113
|
+
|
|
114
|
+
# Show which lines are not covered
|
|
115
|
+
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing
|
|
116
|
+
|
|
117
|
+
# Generate an HTML coverage report
|
|
118
|
+
.venv/bin/python -m pytest --cov=your_module --cov-report=html
|
|
119
|
+
|
|
120
|
+
# Combine terminal and HTML reports
|
|
121
|
+
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing --cov-report=html
|
|
122
|
+
|
|
123
|
+
# Run specific test file with coverage
|
|
124
|
+
.venv/bin/python -m pytest tests/test_file.py --cov=your_module --cov-report=term-missing
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Viewing HTML Reports
|
|
128
|
+
|
|
129
|
+
After generating an HTML report, open `htmlcov/index.html` in your browser to view detailed line-by-line coverage information.
|
|
130
|
+
|
|
131
|
+
### Coverage Threshold
|
|
132
|
+
|
|
133
|
+
To enforce a minimum coverage percentage:
|
|
134
|
+
```bash
|
|
135
|
+
.venv/bin/python -m pytest --cov=your_module --cov-fail-under=80
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
This will cause the test suite to fail if coverage drops below 80%.
|
|
139
|
+
|
|
140
|
+
## Architecture
|
|
141
|
+
|
|
142
|
+
The package is a wex addon. Its single registration point is src/wexample_wex_addon_dev_python/python_addon_manager.py — a `PythonAddonManager` that inherits `AbstractAddonManager` and declares four contributions:
|
|
143
|
+
|
|
144
|
+
- **middlewares** — `EachPythonFileMiddleware`
|
|
145
|
+
- **selections** — `PythonCodePerformanceSelection`
|
|
146
|
+
- **workdir types** — `python`, `python-package`, `python-packages-suite`
|
|
147
|
+
- **configurable keys** — `PDM_BIN_DIR`, detected and applied by src/wexample_wex_addon_dev_python/helper/pdm.py
|
|
148
|
+
|
|
149
|
+
Everything else in the package implements one of those four surfaces.
|
|
150
|
+
|
|
151
|
+
### Middleware
|
|
152
|
+
|
|
153
|
+
src/wexample_wex_addon_dev_python/middleware/each_python_file_middleware.py extends `EachFileMiddleware`. It filters `.py` files by extension and refuses to recurse into `__pycache__`, `.git`, `.venv`, `.mypy_cache`, and similar directories. Commands that operate file-by-file declare `@middleware(name="each_python_file")` to let the kernel expand a path argument into individual files before calling the command function.
|
|
154
|
+
|
|
155
|
+
### Commands
|
|
156
|
+
|
|
157
|
+
All three live under `src/wexample_wex_addon_dev_python/commands/code/`.
|
|
158
|
+
|
|
159
|
+
**Format** — src/wexample_wex_addon_dev_python/commands/code/format.py runs isort then black in that order on one file. An optional `--tool` flag restricts execution to a single tool. The command returns `False` on the first failure when `--stop_on_failure` is set.
|
|
160
|
+
|
|
161
|
+
**Check** — src/wexample_wex_addon_dev_python/commands/code/check.py runs mypy, pylint, and pyright in sequence. Pylint is invoked with `--output-format=json`; only messages of type `error` or `fatal` cause a `False` return; warnings and conventions are reported but do not fail the check.
|
|
162
|
+
|
|
163
|
+
**Rename** — src/wexample_wex_addon_dev_python/commands/code/rename.py accepts `--source`, `--target`, and `--kind`. It resolves the `SymbolKind` enum, picks a handler class, delegates to `handler.run()`, and returns a `TableResponse` listing the changed files. A `--dry_run` flag stops the handler after the plan phase, touching nothing on disk.
|
|
164
|
+
|
|
165
|
+
### Refactor subsystem
|
|
166
|
+
|
|
167
|
+
The refactor package implements a three-phase rename pipeline.
|
|
168
|
+
|
|
169
|
+
src/wexample_wex_addon_dev_python/refactor/abstract_python_rename_handler.py defines the pipeline: `compute_plan()` (scan only, no writes) → `preflight()` (detect permission errors and missing parents) → `apply()` (hand the plan to a `RenameApplier`). Subclasses implement `compute_plan` and `_build_report`.
|
|
170
|
+
|
|
171
|
+
src/wexample_wex_addon_dev_python/refactor/rename_plan.py is the data structure. It carries:
|
|
172
|
+
- `rewrites` — per-file new source text
|
|
173
|
+
- `path_renames` — `(old, new)` pairs for files or directories
|
|
174
|
+
- `directories_to_create` — dirs that must exist before rewrites run
|
|
175
|
+
- `files_to_delete`, `directories_to_remove`, `directories_to_purge` — cleanup after moves
|
|
176
|
+
|
|
177
|
+
src/wexample_wex_addon_dev_python/refactor/applier.py defines `RenameApplier` (abstract strategy) and `NaiveRenameApplier` (direct `os`/`shutil` calls). The sequencing is: create dirs → write files → rename paths → delete files → purge artefact dirs → remove empty dirs.
|
|
178
|
+
|
|
179
|
+
src/wexample_wex_addon_dev_python/refactor/symbol_kind.py lists the supported kinds: `package`, `module`, `class`, `function`, `constant`. `method` is declared in the enum but not implemented; the comment explains why (dynamic typing makes safe method-rename impossible without a full type-inference pipeline).
|
|
180
|
+
|
|
181
|
+
The package handler adds merge logic: when the target directory already exists, each child of the source is moved in, identical `__init__.py` files are dropped, and the empty source dir is removed. Non-identical file conflicts abort with a descriptive error.
|
|
182
|
+
|
|
183
|
+
### Workdir hierarchy
|
|
184
|
+
|
|
185
|
+
**`PythonWorkdir`** — src/wexample_wex_addon_dev_python/workdir/python_workdir.py is the base for every Python project. It mixes in `WithAiWorkdirMixin`, `WithProfilingPythonWorkdirMixin`, and `CodeBaseWorkdir`. Responsibilities:
|
|
186
|
+
|
|
187
|
+
- venv path resolution (local `.venv` or a suite-level `python.venv_path` from runtime config)
|
|
188
|
+
- `app_install` — creates the venv, then calls `_install_dependencies_in_venv`
|
|
189
|
+
- test execution via `test_run` / `test_get_command` (pytest + pytest-cov, JSON report stored in `.wex/local/`)
|
|
190
|
+
- filestate layout declaration in `prepare_value`: `src/{vendor}_{name}/`, `tests/`, `helpers/`, plus the full set of Python file options (future annotations, sort imports, modernize typing, order class members, format, …)
|
|
191
|
+
- `get_app_config_file` — returns the managed `PythonPyprojectTomlFile`
|
|
192
|
+
- `update_dependencies` — updates `pyproject.toml` then re-pins `requirements.txt` via `uv pip compile` with retry logic for PyPI propagation races
|
|
193
|
+
|
|
194
|
+
**`PythonPackageWorkdir`** — src/wexample_wex_addon_dev_python/workdir/python_package_workdir.py extends `PythonWorkdir` for distributable packages. Additional responsibilities:
|
|
195
|
+
|
|
196
|
+
- publish via `pdm publish` (PyPI) or a git tag push (private GitLab registry when `pdm.repository.url` is set)
|
|
197
|
+
- `_wait_for_registry` — polls the PEP 503 Simple index through `PypiRegistryGateway` until the new version appears
|
|
198
|
+
- `_classify_version_bump` — uses `griffe` to compare the current AST against the previous git tag and determine major vs. intermediate bump
|
|
199
|
+
- suite-aware install in local env: external deps are pip-installed normally; suite packages are installed in editable mode, leaf-to-trunk order, skipping packages already editable at the right path
|
|
200
|
+
- `get_required_knowledge_pages` adds `usage/quickstart` to the pages the workdir expects to exist
|
|
201
|
+
|
|
202
|
+
**`PythonPackagesSuiteWorkdir`** — src/wexample_wex_addon_dev_python/workdir/python_packages_suite_workdir.py extends `FrameworkPackageSuiteWorkdir`. It treats any subdirectory of `pip/` that contains a `pyproject.toml` as a package. `build_dependencies_stack` builds a `networkx` directed graph from the local dependency map and returns the shortest path from one package to another as concrete `PythonPackageWorkdir` objects.
|
|
203
|
+
|
|
204
|
+
**`WithProfilingPythonWorkdirMixin`** — src/wexample_wex_addon_dev_python/workdir/mixin/with_profiling_python_workdir_mixin.py runs `pytest --benchmark-only` in the project's venv, writes a temporary JSON report, parses benchmark stats (min, mean, median, max in ms, rounds), and returns the result as a structured dict.
|
|
205
|
+
|
|
206
|
+
### File objects
|
|
207
|
+
|
|
208
|
+
src/wexample_wex_addon_dev_python/file/python_pyproject_toml_file.py wraps `pyproject.toml` as a managed filestate object. Its `dumps` method enforces canonical structure on every write: build-system pinned to `pdm-backend`, PDM build config derived from the workdir's `get_src_import_name()`, project metadata from wex config, dependencies sorted, dev group always containing `pytest` and `pytest-cov`, pytest and coverage tool config injected, and sections reordered (`build-system` → `project` → `tool`).
|
|
209
|
+
|
|
210
|
+
### Selection
|
|
211
|
+
|
|
212
|
+
src/wexample_wex_addon_dev_python/selection/abstract_python_code_selection.py establishes the Python-file baseline for AI agent selections: `.py` extension only, skip `__init__.py`, skip `__pycache__` / `/tests/` / `/build/` / `/dist/` / `/.venv/` / `/.pdm-build/`, 50-byte minimum.
|
|
213
|
+
|
|
214
|
+
src/wexample_wex_addon_dev_python/selection/python_code_performance_selection.py inherits that baseline and adds two constraints: the file must be under `/src/`, and its AST must contain at least one non-trivial function. Trivial is defined as: `pass`, `...`, docstring-only, `raise NotImplementedError`, a same-name `super()` pass-through, or any `@abstractmethod`.
|
|
215
|
+
|
|
216
|
+
### Supporting pieces
|
|
217
|
+
|
|
218
|
+
src/wexample_wex_addon_dev_python/common/pypi_registry_gateway.py is a thin HTTP client over the PEP 503 Simple index. It accepts optional Basic auth (`username` + `token`) and exposes `has_version(package, version) -> bool`.
|
|
219
|
+
|
|
220
|
+
src/wexample_wex_addon_dev_python/operation/generated_description_operation.py is a filestate operation that invokes a `ClaudeAgent` to produce a one-sentence `global.description` and writes it to the app config. The model is called only during `apply_operation`, not during dry-run, so a preview is always offline. Failures (network, model, length over 200 chars) leave the key unset and log a warning rather than aborting the rectification.
|
|
221
|
+
|
|
222
|
+
src/wexample_wex_addon_dev_python/services/python/app_service.py contributes the initial `pyproject.toml` and `src/app/` scaffolding when a new Python app service is set up.
|
|
223
|
+
|
|
224
|
+
src/wexample_wex_addon_dev_python/const/tags.py declares the `DomainTag` constants (`domain:format`, `domain:language-python`, `domain:lint`, `domain:service`) used in command `@command(tags=[…])` decorators.
|
|
225
|
+
|
|
226
|
+
### Call path for a rename
|
|
227
|
+
|
|
228
|
+
1. `python__code__rename` validates `--kind`, selects a handler class, calls `app_workdir.get_code_scope_paths(kernel)` for the set of roots.
|
|
229
|
+
2. The handler's `__attrs_post_init__` splits the dotted names and validates they are non-empty.
|
|
230
|
+
3. `handler.run()` calls `compute_plan()` — the handler scans every root for the source pattern, builds a `RenamePlan` (rewrites + path moves), returns it.
|
|
231
|
+
4. If not `dry_run`, `plan.preflight()` checks writability and parent existence. Any problem raises `RuntimeError` before a single file is touched.
|
|
232
|
+
5. `NaiveRenameApplier().apply(plan)` executes the six steps in sequence.
|
|
233
|
+
6. The command formats the report into a `TableResponse`.
|
|
234
|
+
|
|
235
|
+
## Integration in the Suite
|
|
236
|
+
|
|
237
|
+
This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.
|
|
238
|
+
|
|
239
|
+
### Related Packages
|
|
240
|
+
|
|
241
|
+
The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.
|
|
242
|
+
|
|
243
|
+
Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
|
|
244
|
+
|
|
245
|
+
## Dependencies
|
|
246
|
+
|
|
247
|
+
- attrs: >=23.1.0
|
|
248
|
+
- cattrs: >=23.1.0
|
|
249
|
+
- griffe: >=2.0.2
|
|
250
|
+
- networkx:
|
|
251
|
+
- pylint:
|
|
252
|
+
- pyright:
|
|
253
|
+
- wexample-api: >=6.8.0
|
|
254
|
+
- wexample-filestate-python: >=9.0.0
|
|
255
|
+
- wexample-wex-addon-ai: >=13.0.0
|
|
256
|
+
- wexample-wex-addon-app: >=30.0.0
|
|
257
|
+
|
|
258
|
+
## Versioning & Compatibility Policy
|
|
259
|
+
|
|
260
|
+
Wexample packages follow **Semantic Versioning** (SemVer):
|
|
261
|
+
|
|
262
|
+
- **MAJOR**: Breaking changes
|
|
263
|
+
- **MINOR**: New features, backward compatible
|
|
264
|
+
- **PATCH**: Bug fixes, backward compatible
|
|
265
|
+
|
|
266
|
+
We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
|
|
267
|
+
|
|
268
|
+
## License
|
|
269
|
+
|
|
270
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
271
|
+
|
|
272
|
+
Free to use in both personal and commercial projects.
|
|
273
|
+
|
|
274
|
+
## About us
|
|
275
|
+
|
|
276
|
+
[Wexample](https://wexample.com) stands as a cornerstone of the digital ecosystem — a collective of seasoned engineers, researchers, and creators driven by a relentless pursuit of technological excellence. More than a media platform, it has grown into a vibrant community where innovation meets craftsmanship, and where every line of code reflects a commitment to clarity, durability, and shared intelligence.
|
|
277
|
+
|
|
278
|
+
This packages suite embodies this spirit. Trusted by professionals and enthusiasts alike, it delivers a consistent, high-quality foundation for modern development — open, elegant, and battle-tested. Its reputation is built on years of collaboration, refinement, and rigorous attention to detail, making it a natural choice for those who demand both robustness and beauty in their tools.
|
|
279
|
+
|
|
280
|
+
Wexample cultivates a culture of mastery. Each package, each contribution carries the mark of a community that values precision, ethics, and innovation — a community proud to shape the future of digital craftsmanship.
|
|
281
|
+
|
|
282
|
+
## Known Limitations & Roadmap
|
|
283
|
+
|
|
284
|
+
Current limitations and planned features are tracked in the GitHub issues.
|
|
285
|
+
|
|
286
|
+
See the [project roadmap](https://github.com/wexample/python-wex_addon_dev_python/issues) for upcoming features and improvements.
|
|
287
|
+
|
|
288
|
+
## Status & Compatibility
|
|
289
|
+
|
|
290
|
+
**Maturity**: Production-ready
|
|
291
|
+
|
|
292
|
+
**Python Support**: >=3.10
|
|
293
|
+
|
|
294
|
+
**OS Support**: Linux, macOS, Windows
|
|
295
|
+
|
|
296
|
+
**Status**: Actively maintained
|
|
297
|
+
|
|
298
|
+
## Useful Links
|
|
299
|
+
|
|
300
|
+
- **Homepage**: https://github.com/wexample/python-wex-addon-dev-python
|
|
301
|
+
- **Documentation**: [docs.wexample.com](https://docs.wexample.com)
|
|
302
|
+
- **Issue Tracker**: https://github.com/wexample/python-wex-addon-dev-python/issues
|
|
303
|
+
- **Discussions**: https://github.com/wexample/python-wex-addon-dev-python/discussions
|
|
304
|
+
- **PyPI**: [pypi.org/project/wexample-wex-addon-dev-python](https://pypi.org/project/wexample-wex-addon-dev-python/)
|
|
305
|
+
|
|
306
|
+
## Migration Notes
|
|
307
|
+
|
|
308
|
+
When upgrading between major versions, refer to the migration guides in the documentation.
|
|
309
|
+
|
|
310
|
+
Breaking changes are clearly documented with upgrade paths and examples.
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# wex_addon_dev_python
|
|
2
|
+
|
|
3
|
+
Version: 13.2.0
|
|
4
|
+
|
|
5
|
+
`wex_addon_dev_python` extends the wex CLI with a `python::` command group that formats source files with isort and black (`python::code/format`), checks them with mypy, pylint, and pyright (`python::code/check`), and renames Python symbols — packages, modules, classes, functions, constants — while propagating every affected import statement across the workdir (`python::code/rename`). It also ships `PythonPackageWorkdir` and `PythonPackagesSuiteWorkdir`, two workdir types that let wex manage a single PDM-based package or a multi-package suite as a first-class project structure. The intended users are wex operators who develop and maintain Python packages within the wexample ecosystem.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [Quickstart](#quickstart)
|
|
11
|
+
- [Tests](#tests)
|
|
12
|
+
- [Architecture](#architecture)
|
|
13
|
+
- [Integration in the Suite](#integration-in-the-suite)
|
|
14
|
+
- [Dependencies](#dependencies)
|
|
15
|
+
- [Versioning & Compatibility Policy](#versioning--compatibility-policy)
|
|
16
|
+
- [License](#license)
|
|
17
|
+
- [About us](#about-us)
|
|
18
|
+
- [Known Limitations & Roadmap](#known-limitations--roadmap)
|
|
19
|
+
- [Status & Compatibility](#status--compatibility)
|
|
20
|
+
- [Useful Links](#useful-links)
|
|
21
|
+
- [Migration Notes](#migration-notes)
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install wexample-wex-addon-dev-python
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Requires Python >=3.10.
|
|
30
|
+
|
|
31
|
+
## Quickstart
|
|
32
|
+
|
|
33
|
+
Install from PyPI:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install wexample-wex-addon-dev-python
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
That makes the `python::` command group available to wex. Pass any file or directory to `--file`; the middleware expands globs and recurses automatically.
|
|
40
|
+
|
|
41
|
+
Format a source tree — isort sorts imports, black reformats the rest:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
wex python::code/format --file src/mypackage/
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Run the three static-analysis tools (mypy, pylint, pyright) against the same tree:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
wex python::code/check --file src/mypackage/
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Rename a Python symbol and rewrite every import statement that references it across the workdir. The `--dry_run` flag prints which files would change without touching them:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
wex python::code/rename \
|
|
57
|
+
--source mylib.helpers \
|
|
58
|
+
--target mylib.helper \
|
|
59
|
+
--kind package \
|
|
60
|
+
--dry_run
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Drop `--dry_run` to apply. Valid `--kind` values are `package`, `module`, `class`, `function`, and `constant`.
|
|
64
|
+
|
|
65
|
+
## Tests
|
|
66
|
+
|
|
67
|
+
This project uses `pytest` for testing and `pytest-cov` for code coverage analysis.
|
|
68
|
+
|
|
69
|
+
### Installation
|
|
70
|
+
|
|
71
|
+
First, install the required testing dependencies:
|
|
72
|
+
```bash
|
|
73
|
+
.venv/bin/python -m pip install pytest pytest-cov
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Basic Usage
|
|
77
|
+
|
|
78
|
+
Run all tests with coverage:
|
|
79
|
+
```bash
|
|
80
|
+
.venv/bin/python -m pytest --cov --cov-report=html
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Common Commands
|
|
84
|
+
```bash
|
|
85
|
+
# Run tests with coverage for a specific module
|
|
86
|
+
.venv/bin/python -m pytest --cov=your_module
|
|
87
|
+
|
|
88
|
+
# Show which lines are not covered
|
|
89
|
+
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing
|
|
90
|
+
|
|
91
|
+
# Generate an HTML coverage report
|
|
92
|
+
.venv/bin/python -m pytest --cov=your_module --cov-report=html
|
|
93
|
+
|
|
94
|
+
# Combine terminal and HTML reports
|
|
95
|
+
.venv/bin/python -m pytest --cov=your_module --cov-report=term-missing --cov-report=html
|
|
96
|
+
|
|
97
|
+
# Run specific test file with coverage
|
|
98
|
+
.venv/bin/python -m pytest tests/test_file.py --cov=your_module --cov-report=term-missing
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Viewing HTML Reports
|
|
102
|
+
|
|
103
|
+
After generating an HTML report, open `htmlcov/index.html` in your browser to view detailed line-by-line coverage information.
|
|
104
|
+
|
|
105
|
+
### Coverage Threshold
|
|
106
|
+
|
|
107
|
+
To enforce a minimum coverage percentage:
|
|
108
|
+
```bash
|
|
109
|
+
.venv/bin/python -m pytest --cov=your_module --cov-fail-under=80
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
This will cause the test suite to fail if coverage drops below 80%.
|
|
113
|
+
|
|
114
|
+
## Architecture
|
|
115
|
+
|
|
116
|
+
The package is a wex addon. Its single registration point is src/wexample_wex_addon_dev_python/python_addon_manager.py — a `PythonAddonManager` that inherits `AbstractAddonManager` and declares four contributions:
|
|
117
|
+
|
|
118
|
+
- **middlewares** — `EachPythonFileMiddleware`
|
|
119
|
+
- **selections** — `PythonCodePerformanceSelection`
|
|
120
|
+
- **workdir types** — `python`, `python-package`, `python-packages-suite`
|
|
121
|
+
- **configurable keys** — `PDM_BIN_DIR`, detected and applied by src/wexample_wex_addon_dev_python/helper/pdm.py
|
|
122
|
+
|
|
123
|
+
Everything else in the package implements one of those four surfaces.
|
|
124
|
+
|
|
125
|
+
### Middleware
|
|
126
|
+
|
|
127
|
+
src/wexample_wex_addon_dev_python/middleware/each_python_file_middleware.py extends `EachFileMiddleware`. It filters `.py` files by extension and refuses to recurse into `__pycache__`, `.git`, `.venv`, `.mypy_cache`, and similar directories. Commands that operate file-by-file declare `@middleware(name="each_python_file")` to let the kernel expand a path argument into individual files before calling the command function.
|
|
128
|
+
|
|
129
|
+
### Commands
|
|
130
|
+
|
|
131
|
+
All three live under `src/wexample_wex_addon_dev_python/commands/code/`.
|
|
132
|
+
|
|
133
|
+
**Format** — src/wexample_wex_addon_dev_python/commands/code/format.py runs isort then black in that order on one file. An optional `--tool` flag restricts execution to a single tool. The command returns `False` on the first failure when `--stop_on_failure` is set.
|
|
134
|
+
|
|
135
|
+
**Check** — src/wexample_wex_addon_dev_python/commands/code/check.py runs mypy, pylint, and pyright in sequence. Pylint is invoked with `--output-format=json`; only messages of type `error` or `fatal` cause a `False` return; warnings and conventions are reported but do not fail the check.
|
|
136
|
+
|
|
137
|
+
**Rename** — src/wexample_wex_addon_dev_python/commands/code/rename.py accepts `--source`, `--target`, and `--kind`. It resolves the `SymbolKind` enum, picks a handler class, delegates to `handler.run()`, and returns a `TableResponse` listing the changed files. A `--dry_run` flag stops the handler after the plan phase, touching nothing on disk.
|
|
138
|
+
|
|
139
|
+
### Refactor subsystem
|
|
140
|
+
|
|
141
|
+
The refactor package implements a three-phase rename pipeline.
|
|
142
|
+
|
|
143
|
+
src/wexample_wex_addon_dev_python/refactor/abstract_python_rename_handler.py defines the pipeline: `compute_plan()` (scan only, no writes) → `preflight()` (detect permission errors and missing parents) → `apply()` (hand the plan to a `RenameApplier`). Subclasses implement `compute_plan` and `_build_report`.
|
|
144
|
+
|
|
145
|
+
src/wexample_wex_addon_dev_python/refactor/rename_plan.py is the data structure. It carries:
|
|
146
|
+
- `rewrites` — per-file new source text
|
|
147
|
+
- `path_renames` — `(old, new)` pairs for files or directories
|
|
148
|
+
- `directories_to_create` — dirs that must exist before rewrites run
|
|
149
|
+
- `files_to_delete`, `directories_to_remove`, `directories_to_purge` — cleanup after moves
|
|
150
|
+
|
|
151
|
+
src/wexample_wex_addon_dev_python/refactor/applier.py defines `RenameApplier` (abstract strategy) and `NaiveRenameApplier` (direct `os`/`shutil` calls). The sequencing is: create dirs → write files → rename paths → delete files → purge artefact dirs → remove empty dirs.
|
|
152
|
+
|
|
153
|
+
src/wexample_wex_addon_dev_python/refactor/symbol_kind.py lists the supported kinds: `package`, `module`, `class`, `function`, `constant`. `method` is declared in the enum but not implemented; the comment explains why (dynamic typing makes safe method-rename impossible without a full type-inference pipeline).
|
|
154
|
+
|
|
155
|
+
The package handler adds merge logic: when the target directory already exists, each child of the source is moved in, identical `__init__.py` files are dropped, and the empty source dir is removed. Non-identical file conflicts abort with a descriptive error.
|
|
156
|
+
|
|
157
|
+
### Workdir hierarchy
|
|
158
|
+
|
|
159
|
+
**`PythonWorkdir`** — src/wexample_wex_addon_dev_python/workdir/python_workdir.py is the base for every Python project. It mixes in `WithAiWorkdirMixin`, `WithProfilingPythonWorkdirMixin`, and `CodeBaseWorkdir`. Responsibilities:
|
|
160
|
+
|
|
161
|
+
- venv path resolution (local `.venv` or a suite-level `python.venv_path` from runtime config)
|
|
162
|
+
- `app_install` — creates the venv, then calls `_install_dependencies_in_venv`
|
|
163
|
+
- test execution via `test_run` / `test_get_command` (pytest + pytest-cov, JSON report stored in `.wex/local/`)
|
|
164
|
+
- filestate layout declaration in `prepare_value`: `src/{vendor}_{name}/`, `tests/`, `helpers/`, plus the full set of Python file options (future annotations, sort imports, modernize typing, order class members, format, …)
|
|
165
|
+
- `get_app_config_file` — returns the managed `PythonPyprojectTomlFile`
|
|
166
|
+
- `update_dependencies` — updates `pyproject.toml` then re-pins `requirements.txt` via `uv pip compile` with retry logic for PyPI propagation races
|
|
167
|
+
|
|
168
|
+
**`PythonPackageWorkdir`** — src/wexample_wex_addon_dev_python/workdir/python_package_workdir.py extends `PythonWorkdir` for distributable packages. Additional responsibilities:
|
|
169
|
+
|
|
170
|
+
- publish via `pdm publish` (PyPI) or a git tag push (private GitLab registry when `pdm.repository.url` is set)
|
|
171
|
+
- `_wait_for_registry` — polls the PEP 503 Simple index through `PypiRegistryGateway` until the new version appears
|
|
172
|
+
- `_classify_version_bump` — uses `griffe` to compare the current AST against the previous git tag and determine major vs. intermediate bump
|
|
173
|
+
- suite-aware install in local env: external deps are pip-installed normally; suite packages are installed in editable mode, leaf-to-trunk order, skipping packages already editable at the right path
|
|
174
|
+
- `get_required_knowledge_pages` adds `usage/quickstart` to the pages the workdir expects to exist
|
|
175
|
+
|
|
176
|
+
**`PythonPackagesSuiteWorkdir`** — src/wexample_wex_addon_dev_python/workdir/python_packages_suite_workdir.py extends `FrameworkPackageSuiteWorkdir`. It treats any subdirectory of `pip/` that contains a `pyproject.toml` as a package. `build_dependencies_stack` builds a `networkx` directed graph from the local dependency map and returns the shortest path from one package to another as concrete `PythonPackageWorkdir` objects.
|
|
177
|
+
|
|
178
|
+
**`WithProfilingPythonWorkdirMixin`** — src/wexample_wex_addon_dev_python/workdir/mixin/with_profiling_python_workdir_mixin.py runs `pytest --benchmark-only` in the project's venv, writes a temporary JSON report, parses benchmark stats (min, mean, median, max in ms, rounds), and returns the result as a structured dict.
|
|
179
|
+
|
|
180
|
+
### File objects
|
|
181
|
+
|
|
182
|
+
src/wexample_wex_addon_dev_python/file/python_pyproject_toml_file.py wraps `pyproject.toml` as a managed filestate object. Its `dumps` method enforces canonical structure on every write: build-system pinned to `pdm-backend`, PDM build config derived from the workdir's `get_src_import_name()`, project metadata from wex config, dependencies sorted, dev group always containing `pytest` and `pytest-cov`, pytest and coverage tool config injected, and sections reordered (`build-system` → `project` → `tool`).
|
|
183
|
+
|
|
184
|
+
### Selection
|
|
185
|
+
|
|
186
|
+
src/wexample_wex_addon_dev_python/selection/abstract_python_code_selection.py establishes the Python-file baseline for AI agent selections: `.py` extension only, skip `__init__.py`, skip `__pycache__` / `/tests/` / `/build/` / `/dist/` / `/.venv/` / `/.pdm-build/`, 50-byte minimum.
|
|
187
|
+
|
|
188
|
+
src/wexample_wex_addon_dev_python/selection/python_code_performance_selection.py inherits that baseline and adds two constraints: the file must be under `/src/`, and its AST must contain at least one non-trivial function. Trivial is defined as: `pass`, `...`, docstring-only, `raise NotImplementedError`, a same-name `super()` pass-through, or any `@abstractmethod`.
|
|
189
|
+
|
|
190
|
+
### Supporting pieces
|
|
191
|
+
|
|
192
|
+
src/wexample_wex_addon_dev_python/common/pypi_registry_gateway.py is a thin HTTP client over the PEP 503 Simple index. It accepts optional Basic auth (`username` + `token`) and exposes `has_version(package, version) -> bool`.
|
|
193
|
+
|
|
194
|
+
src/wexample_wex_addon_dev_python/operation/generated_description_operation.py is a filestate operation that invokes a `ClaudeAgent` to produce a one-sentence `global.description` and writes it to the app config. The model is called only during `apply_operation`, not during dry-run, so a preview is always offline. Failures (network, model, length over 200 chars) leave the key unset and log a warning rather than aborting the rectification.
|
|
195
|
+
|
|
196
|
+
src/wexample_wex_addon_dev_python/services/python/app_service.py contributes the initial `pyproject.toml` and `src/app/` scaffolding when a new Python app service is set up.
|
|
197
|
+
|
|
198
|
+
src/wexample_wex_addon_dev_python/const/tags.py declares the `DomainTag` constants (`domain:format`, `domain:language-python`, `domain:lint`, `domain:service`) used in command `@command(tags=[…])` decorators.
|
|
199
|
+
|
|
200
|
+
### Call path for a rename
|
|
201
|
+
|
|
202
|
+
1. `python__code__rename` validates `--kind`, selects a handler class, calls `app_workdir.get_code_scope_paths(kernel)` for the set of roots.
|
|
203
|
+
2. The handler's `__attrs_post_init__` splits the dotted names and validates they are non-empty.
|
|
204
|
+
3. `handler.run()` calls `compute_plan()` — the handler scans every root for the source pattern, builds a `RenamePlan` (rewrites + path moves), returns it.
|
|
205
|
+
4. If not `dry_run`, `plan.preflight()` checks writability and parent existence. Any problem raises `RuntimeError` before a single file is touched.
|
|
206
|
+
5. `NaiveRenameApplier().apply(plan)` executes the six steps in sequence.
|
|
207
|
+
6. The command formats the report into a `TableResponse`.
|
|
208
|
+
|
|
209
|
+
## Integration in the Suite
|
|
210
|
+
|
|
211
|
+
This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.
|
|
212
|
+
|
|
213
|
+
### Related Packages
|
|
214
|
+
|
|
215
|
+
The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.
|
|
216
|
+
|
|
217
|
+
Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
|
|
218
|
+
|
|
219
|
+
## Dependencies
|
|
220
|
+
|
|
221
|
+
- attrs: >=23.1.0
|
|
222
|
+
- cattrs: >=23.1.0
|
|
223
|
+
- griffe: >=2.0.2
|
|
224
|
+
- networkx:
|
|
225
|
+
- pylint:
|
|
226
|
+
- pyright:
|
|
227
|
+
- wexample-api: >=6.8.0
|
|
228
|
+
- wexample-filestate-python: >=9.0.0
|
|
229
|
+
- wexample-wex-addon-ai: >=13.0.0
|
|
230
|
+
- wexample-wex-addon-app: >=30.0.0
|
|
231
|
+
|
|
232
|
+
## Versioning & Compatibility Policy
|
|
233
|
+
|
|
234
|
+
Wexample packages follow **Semantic Versioning** (SemVer):
|
|
235
|
+
|
|
236
|
+
- **MAJOR**: Breaking changes
|
|
237
|
+
- **MINOR**: New features, backward compatible
|
|
238
|
+
- **PATCH**: Bug fixes, backward compatible
|
|
239
|
+
|
|
240
|
+
We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
245
|
+
|
|
246
|
+
Free to use in both personal and commercial projects.
|
|
247
|
+
|
|
248
|
+
## About us
|
|
249
|
+
|
|
250
|
+
[Wexample](https://wexample.com) stands as a cornerstone of the digital ecosystem — a collective of seasoned engineers, researchers, and creators driven by a relentless pursuit of technological excellence. More than a media platform, it has grown into a vibrant community where innovation meets craftsmanship, and where every line of code reflects a commitment to clarity, durability, and shared intelligence.
|
|
251
|
+
|
|
252
|
+
This packages suite embodies this spirit. Trusted by professionals and enthusiasts alike, it delivers a consistent, high-quality foundation for modern development — open, elegant, and battle-tested. Its reputation is built on years of collaboration, refinement, and rigorous attention to detail, making it a natural choice for those who demand both robustness and beauty in their tools.
|
|
253
|
+
|
|
254
|
+
Wexample cultivates a culture of mastery. Each package, each contribution carries the mark of a community that values precision, ethics, and innovation — a community proud to shape the future of digital craftsmanship.
|
|
255
|
+
|
|
256
|
+
## Known Limitations & Roadmap
|
|
257
|
+
|
|
258
|
+
Current limitations and planned features are tracked in the GitHub issues.
|
|
259
|
+
|
|
260
|
+
See the [project roadmap](https://github.com/wexample/python-wex_addon_dev_python/issues) for upcoming features and improvements.
|
|
261
|
+
|
|
262
|
+
## Status & Compatibility
|
|
263
|
+
|
|
264
|
+
**Maturity**: Production-ready
|
|
265
|
+
|
|
266
|
+
**Python Support**: >=3.10
|
|
267
|
+
|
|
268
|
+
**OS Support**: Linux, macOS, Windows
|
|
269
|
+
|
|
270
|
+
**Status**: Actively maintained
|
|
271
|
+
|
|
272
|
+
## Useful Links
|
|
273
|
+
|
|
274
|
+
- **Homepage**: https://github.com/wexample/python-wex-addon-dev-python
|
|
275
|
+
- **Documentation**: [docs.wexample.com](https://docs.wexample.com)
|
|
276
|
+
- **Issue Tracker**: https://github.com/wexample/python-wex-addon-dev-python/issues
|
|
277
|
+
- **Discussions**: https://github.com/wexample/python-wex-addon-dev-python/discussions
|
|
278
|
+
- **PyPI**: [pypi.org/project/wexample-wex-addon-dev-python](https://pypi.org/project/wexample-wex-addon-dev-python/)
|
|
279
|
+
|
|
280
|
+
## Migration Notes
|
|
281
|
+
|
|
282
|
+
When upgrading between major versions, refer to the migration guides in the documentation.
|
|
283
|
+
|
|
284
|
+
Breaking changes are clearly documented with upgrade paths and examples.
|
{wexample_wex_addon_dev_python-13.1.0 → wexample_wex_addon_dev_python-13.2.0}/pyproject.toml
RENAMED
|
@@ -6,8 +6,8 @@ build-backend = "pdm.backend"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "wexample-wex-addon-dev-python"
|
|
9
|
-
version = "13.
|
|
10
|
-
description = "Python
|
|
9
|
+
version = "13.2.0"
|
|
10
|
+
description = "Extends wex with commands to format, lint, and rename Python symbols, plus workdir types for Python packages and suites"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name = "weeger", email = "contact@wexample.com" },
|
|
13
13
|
]
|
|
@@ -26,8 +26,8 @@ dependencies = [
|
|
|
26
26
|
"pyright",
|
|
27
27
|
"wexample-api>=6.8.0",
|
|
28
28
|
"wexample-filestate-python>=9.0.0",
|
|
29
|
-
"wexample-wex-addon-ai>=
|
|
30
|
-
"wexample-wex-addon-app>=
|
|
29
|
+
"wexample-wex-addon-ai>=13.0.0",
|
|
30
|
+
"wexample-wex-addon-app>=30.0.0",
|
|
31
31
|
]
|
|
32
32
|
|
|
33
33
|
[project.readme]
|
|
@@ -10,25 +10,28 @@ from wexample_wex_addon_app.config_value.app_readme_config_value import (
|
|
|
10
10
|
class PythonPackageReadmeContentConfigValue(AppReadmeConfigValue):
|
|
11
11
|
"""README generation for Python packages."""
|
|
12
12
|
|
|
13
|
-
def _get_app_description(self) -> str:
|
|
14
|
-
"""Extract description from pyproject.toml."""
|
|
15
|
-
|
|
13
|
+
def _get_app_description(self) -> str | None:
|
|
14
|
+
"""Extract description from pyproject.toml, else from the wex config."""
|
|
15
|
+
description = self._get_project_table().get("description")
|
|
16
|
+
return description or super()._get_app_description()
|
|
16
17
|
|
|
17
18
|
def _get_app_homepage(self) -> str:
|
|
18
19
|
"""Extract homepage URL from pyproject.toml."""
|
|
19
|
-
|
|
20
|
-
raw_urls = project.get("urls", {})
|
|
20
|
+
raw_urls = self._get_project_table().get("urls", {})
|
|
21
21
|
urls = raw_urls if isinstance(raw_urls, dict) else {}
|
|
22
22
|
return urls.get("homepage") or urls.get("Homepage") or ""
|
|
23
23
|
|
|
24
24
|
def _get_project_license(self) -> str | None:
|
|
25
25
|
"""Extract license information from pyproject.toml."""
|
|
26
|
-
|
|
27
|
-
license_field = project.get("license", {})
|
|
26
|
+
license_field = self._get_project_table().get("license", {})
|
|
28
27
|
if isinstance(license_field, dict):
|
|
29
28
|
return license_field.get("text", "") or license_field.get("file", "")
|
|
30
29
|
return str(license_field) if license_field else ""
|
|
31
30
|
|
|
31
|
+
def _get_project_table(self) -> dict:
|
|
32
|
+
"""The `[project]` table, which is where PEP 621 puts every field read here."""
|
|
33
|
+
return self.workdir.get_app_config().get("project", {})
|
|
34
|
+
|
|
32
35
|
def _get_template_context(self) -> dict:
|
|
33
36
|
"""Build template context with Python-specific variables.
|
|
34
37
|
|
|
@@ -36,9 +39,8 @@ class PythonPackageReadmeContentConfigValue(AppReadmeConfigValue):
|
|
|
36
39
|
"""
|
|
37
40
|
context = super()._get_template_context()
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
context["
|
|
41
|
-
|
|
42
|
-
)
|
|
42
|
+
project = self._get_project_table()
|
|
43
|
+
context["distribution_name"] = project.get("name", "")
|
|
44
|
+
context["python_version"] = project.get("requires-python", "")
|
|
43
45
|
|
|
44
46
|
return context
|