wexample-wex-addon-dev-python 0.0.48__tar.gz → 0.0.53__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.
Files changed (50) hide show
  1. wexample_wex_addon_dev_python-0.0.53/PKG-INFO +192 -0
  2. wexample_wex_addon_dev_python-0.0.53/README.md +167 -0
  3. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/pyproject.toml +15 -4
  4. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/code/check.py +1 -0
  5. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/config_value/python_package_readme_config_value.py +249 -0
  6. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/file/__pycache__/__init__.py +0 -0
  7. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/file/python_package_toml_file.py +400 -0
  8. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/middleware/__init__.py +0 -0
  9. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/middleware/__pycache__/__init__.py +0 -0
  10. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/py.typed +0 -0
  11. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/resources/__init__.py +0 -0
  12. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/resources/readme_templates/__init__.py +0 -0
  13. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/resources/readme_templates/tests.md.j2 +48 -0
  14. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/resources/readme_templates/title.md.j2 +5 -0
  15. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/workdir/__init__.py +0 -0
  16. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/workdir/__pycache__/__init__.py +0 -0
  17. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/workdir/python_package_workdir.py +381 -0
  18. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/workdir/python_packages_suite_workdir.py +24 -14
  19. wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/workdir/python_workdir.py +382 -0
  20. wexample_wex_addon_dev_python-0.0.48/PKG-INFO +0 -60
  21. wexample_wex_addon_dev_python-0.0.48/README.md +0 -38
  22. wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/config_value/python_package_readme_config_value.py +0 -92
  23. wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/file/python_package_toml_file.py +0 -303
  24. wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/workdir/python_package_workdir.py +0 -214
  25. wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/workdir/python_workdir.py +0 -260
  26. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/__init__.py +0 -0
  27. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/commands → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/__pycache__}/__init__.py +0 -0
  28. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/commands/code → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/commands}/__init__.py +0 -0
  29. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/commands/code/check → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/commands/code}/__init__.py +0 -0
  30. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/commands/examples → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/commands/code/check}/__init__.py +0 -0
  31. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/code/check/mypy.py +0 -0
  32. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/code/check/pylint.py +0 -0
  33. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/code/check/pyright.py +0 -0
  34. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/code/format/__init__.py +0 -0
  35. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/code/format/black.py +0 -0
  36. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/code/format/isort.py +0 -0
  37. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/code/format.py +0 -0
  38. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/commands/examples/utils → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/commands/examples}/__init__.py +0 -0
  39. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/commands/release → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/commands/examples/utils}/__init__.py +0 -0
  40. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/examples/utils/some_example_type.py +0 -0
  41. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/commands/examples/validate.py +0 -0
  42. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/config_value → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/commands/release}/__init__.py +0 -0
  43. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/const → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/config_value}/__init__.py +0 -0
  44. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/file → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/config_value/__pycache__}/__init__.py +0 -0
  45. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/middleware → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/const}/__init__.py +0 -0
  46. {wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/workdir → wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/const/__pycache__}/__init__.py +0 -0
  47. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/const/package.py +0 -0
  48. /wexample_wex_addon_dev_python-0.0.48/src/wexample_wex_addon_dev_python/py.typed → /wexample_wex_addon_dev_python-0.0.53/src/wexample_wex_addon_dev_python/file/__init__.py +0 -0
  49. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/middleware/each_python_file_middleware.py +0 -0
  50. {wexample_wex_addon_dev_python-0.0.48 → wexample_wex_addon_dev_python-0.0.53}/src/wexample_wex_addon_dev_python/python_addon_manager.py +0 -0
@@ -0,0 +1,192 @@
1
+ Metadata-Version: 2.1
2
+ Name: wexample-wex-addon-dev-python
3
+ Version: 0.0.53
4
+ Summary: Python dev addon for wex
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: jinja2
15
+ Requires-Dist: networkx
16
+ Requires-Dist: pylint
17
+ Requires-Dist: pyright
18
+ Requires-Dist: wexample-filestate-python==0.0.48
19
+ Requires-Dist: wexample-wex-addon-app==0.0.49
20
+ Requires-Dist: wexample-wex-core==6.0.55
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest; extra == "dev"
23
+ Requires-Dist: pytest-cov; extra == "dev"
24
+ Description-Content-Type: text/markdown
25
+
26
+ # wexample-wex-addon-dev-python
27
+
28
+ Version: 0.0.53
29
+
30
+ Python dev addon for wex
31
+
32
+ ## Tests
33
+
34
+ This project uses `pytest` for testing and `pytest-cov` for code coverage analysis.
35
+
36
+ ### Installation
37
+
38
+ First, install the required testing dependencies:
39
+ ```bash
40
+ .venv/bin/python -m pip install pytest pytest-cov
41
+ ```
42
+
43
+ ### Basic Usage
44
+
45
+ Run all tests with coverage:
46
+ ```bash
47
+ .venv/bin/python -m pytest --cov
48
+ ```
49
+
50
+ ### Common Commands
51
+ ```bash
52
+ # Run tests with coverage for a specific module
53
+ .venv/bin/python -m pytest --cov=your_module
54
+
55
+ # Show which lines are not covered
56
+ .venv/bin/python -m pytest --cov=your_module --cov-report=term-missing
57
+
58
+ # Generate an HTML coverage report
59
+ .venv/bin/python -m pytest --cov=your_module --cov-report=html
60
+
61
+ # Combine terminal and HTML reports
62
+ .venv/bin/python -m pytest --cov=your_module --cov-report=term-missing --cov-report=html
63
+
64
+ # Run specific test file with coverage
65
+ .venv/bin/python -m pytest tests/test_file.py --cov=your_module --cov-report=term-missing
66
+ ```
67
+
68
+ ### Viewing HTML Reports
69
+
70
+ After generating an HTML report, open `htmlcov/index.html` in your browser to view detailed line-by-line coverage information.
71
+
72
+ ### Coverage Threshold
73
+
74
+ To enforce a minimum coverage percentage:
75
+ ```bash
76
+ .venv/bin/python -m pytest --cov=your_module --cov-fail-under=80
77
+ ```
78
+
79
+ This will cause the test suite to fail if coverage drops below 80%.
80
+
81
+ ## Code Quality & Typing
82
+
83
+ All the suite packages follow strict quality standards:
84
+
85
+ - **Type hints**: Full type coverage with mypy validation
86
+ - **Code formatting**: Enforced with black and isort
87
+ - **Linting**: Comprehensive checks with custom scripts and tools
88
+ - **Testing**: High test coverage requirements
89
+
90
+ These standards ensure reliability and maintainability across the suite.
91
+
92
+ ## Versioning & Compatibility Policy
93
+
94
+ Wexample packages follow **Semantic Versioning** (SemVer):
95
+
96
+ - **MAJOR**: Breaking changes
97
+ - **MINOR**: New features, backward compatible
98
+ - **PATCH**: Bug fixes, backward compatible
99
+
100
+ We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
101
+
102
+ ## Changelog
103
+
104
+ See [CHANGELOG.md](CHANGELOG.md) for detailed version history and release notes.
105
+
106
+ Major changes are documented with migration guides when applicable.
107
+
108
+ ## Migration Notes
109
+
110
+ When upgrading between major versions, refer to the migration guides in the documentation.
111
+
112
+ Breaking changes are clearly documented with upgrade paths and examples.
113
+
114
+ ## Known Limitations & Roadmap
115
+
116
+ Current limitations and planned features are tracked in the GitHub issues.
117
+
118
+ See the [project roadmap](https://github.com/wexample/python-wex-dev-python/issues) for upcoming features and improvements.
119
+
120
+ ## Security Policy
121
+
122
+ ### Reporting Vulnerabilities
123
+
124
+ If you discover a security vulnerability, please email security@wexample.com.
125
+
126
+ **Do not** open public issues for security vulnerabilities.
127
+
128
+ We take security seriously and will respond promptly to verified reports.
129
+
130
+ ## Privacy & Telemetry
131
+
132
+ This package does **not** collect any telemetry or usage data.
133
+
134
+ Your privacy is respected — no data is transmitted to external services.
135
+
136
+ ## Support Channels
137
+
138
+ - **GitHub Issues**: Bug reports and feature requests
139
+ - **GitHub Discussions**: Questions and community support
140
+ - **Documentation**: Comprehensive guides and API reference
141
+ - **Email**: contact@wexample.com for general inquiries
142
+
143
+ Community support is available through GitHub Discussions.
144
+
145
+ ## Contribution Guidelines
146
+
147
+ We welcome contributions to the Wexample suite!
148
+
149
+ ### How to Contribute
150
+
151
+ 1. **Fork** the repository
152
+ 2. **Create** a feature branch
153
+ 3. **Make** your changes
154
+ 4. **Test** thoroughly
155
+ 5. **Submit** a pull request
156
+
157
+ ## Maintainers & Authors
158
+
159
+ Maintained by the Wexample team and community contributors.
160
+
161
+ See [CONTRIBUTORS.md](CONTRIBUTORS.md) for the full list of contributors.
162
+
163
+ ## License
164
+
165
+ MIT
166
+
167
+ ## Useful Links
168
+
169
+ - **Homepage**: https://github.com/wexample/python-wex-dev-python
170
+ - **Documentation**: [docs.wexample.com](https://docs.wexample.com)
171
+ - **Issue Tracker**: https://github.com/wexample/python-wex-dev-python/issues
172
+ - **Discussions**: https://github.com/wexample/python-wex-dev-python/discussions
173
+ - **PyPI**: [pypi.org/project/wexample-wex-addon-dev-python](https://pypi.org/project/wexample-wex-addon-dev-python/)
174
+
175
+ ## Integration in the Suite
176
+
177
+ This package is part of the **Wexample Suite** — a collection of high-quality Python packages designed to work seamlessly together.
178
+
179
+ ### Related Packages
180
+
181
+ 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.
182
+
183
+ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
184
+
185
+ # About us
186
+
187
+ Wexample 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.
188
+
189
+ 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.
190
+
191
+ 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.
192
+
@@ -0,0 +1,167 @@
1
+ # wexample-wex-addon-dev-python
2
+
3
+ Version: 0.0.53
4
+
5
+ Python dev addon for wex
6
+
7
+ ## Tests
8
+
9
+ This project uses `pytest` for testing and `pytest-cov` for code coverage analysis.
10
+
11
+ ### Installation
12
+
13
+ First, install the required testing dependencies:
14
+ ```bash
15
+ .venv/bin/python -m pip install pytest pytest-cov
16
+ ```
17
+
18
+ ### Basic Usage
19
+
20
+ Run all tests with coverage:
21
+ ```bash
22
+ .venv/bin/python -m pytest --cov
23
+ ```
24
+
25
+ ### Common Commands
26
+ ```bash
27
+ # Run tests with coverage for a specific module
28
+ .venv/bin/python -m pytest --cov=your_module
29
+
30
+ # Show which lines are not covered
31
+ .venv/bin/python -m pytest --cov=your_module --cov-report=term-missing
32
+
33
+ # Generate an HTML coverage report
34
+ .venv/bin/python -m pytest --cov=your_module --cov-report=html
35
+
36
+ # Combine terminal and HTML reports
37
+ .venv/bin/python -m pytest --cov=your_module --cov-report=term-missing --cov-report=html
38
+
39
+ # Run specific test file with coverage
40
+ .venv/bin/python -m pytest tests/test_file.py --cov=your_module --cov-report=term-missing
41
+ ```
42
+
43
+ ### Viewing HTML Reports
44
+
45
+ After generating an HTML report, open `htmlcov/index.html` in your browser to view detailed line-by-line coverage information.
46
+
47
+ ### Coverage Threshold
48
+
49
+ To enforce a minimum coverage percentage:
50
+ ```bash
51
+ .venv/bin/python -m pytest --cov=your_module --cov-fail-under=80
52
+ ```
53
+
54
+ This will cause the test suite to fail if coverage drops below 80%.
55
+
56
+ ## Code Quality & Typing
57
+
58
+ All the suite packages follow strict quality standards:
59
+
60
+ - **Type hints**: Full type coverage with mypy validation
61
+ - **Code formatting**: Enforced with black and isort
62
+ - **Linting**: Comprehensive checks with custom scripts and tools
63
+ - **Testing**: High test coverage requirements
64
+
65
+ These standards ensure reliability and maintainability across the suite.
66
+
67
+ ## Versioning & Compatibility Policy
68
+
69
+ Wexample packages follow **Semantic Versioning** (SemVer):
70
+
71
+ - **MAJOR**: Breaking changes
72
+ - **MINOR**: New features, backward compatible
73
+ - **PATCH**: Bug fixes, backward compatible
74
+
75
+ We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
76
+
77
+ ## Changelog
78
+
79
+ See [CHANGELOG.md](CHANGELOG.md) for detailed version history and release notes.
80
+
81
+ Major changes are documented with migration guides when applicable.
82
+
83
+ ## Migration Notes
84
+
85
+ When upgrading between major versions, refer to the migration guides in the documentation.
86
+
87
+ Breaking changes are clearly documented with upgrade paths and examples.
88
+
89
+ ## Known Limitations & Roadmap
90
+
91
+ Current limitations and planned features are tracked in the GitHub issues.
92
+
93
+ See the [project roadmap](https://github.com/wexample/python-wex-dev-python/issues) for upcoming features and improvements.
94
+
95
+ ## Security Policy
96
+
97
+ ### Reporting Vulnerabilities
98
+
99
+ If you discover a security vulnerability, please email security@wexample.com.
100
+
101
+ **Do not** open public issues for security vulnerabilities.
102
+
103
+ We take security seriously and will respond promptly to verified reports.
104
+
105
+ ## Privacy & Telemetry
106
+
107
+ This package does **not** collect any telemetry or usage data.
108
+
109
+ Your privacy is respected — no data is transmitted to external services.
110
+
111
+ ## Support Channels
112
+
113
+ - **GitHub Issues**: Bug reports and feature requests
114
+ - **GitHub Discussions**: Questions and community support
115
+ - **Documentation**: Comprehensive guides and API reference
116
+ - **Email**: contact@wexample.com for general inquiries
117
+
118
+ Community support is available through GitHub Discussions.
119
+
120
+ ## Contribution Guidelines
121
+
122
+ We welcome contributions to the Wexample suite!
123
+
124
+ ### How to Contribute
125
+
126
+ 1. **Fork** the repository
127
+ 2. **Create** a feature branch
128
+ 3. **Make** your changes
129
+ 4. **Test** thoroughly
130
+ 5. **Submit** a pull request
131
+
132
+ ## Maintainers & Authors
133
+
134
+ Maintained by the Wexample team and community contributors.
135
+
136
+ See [CONTRIBUTORS.md](CONTRIBUTORS.md) for the full list of contributors.
137
+
138
+ ## License
139
+
140
+ MIT
141
+
142
+ ## Useful Links
143
+
144
+ - **Homepage**: https://github.com/wexample/python-wex-dev-python
145
+ - **Documentation**: [docs.wexample.com](https://docs.wexample.com)
146
+ - **Issue Tracker**: https://github.com/wexample/python-wex-dev-python/issues
147
+ - **Discussions**: https://github.com/wexample/python-wex-dev-python/discussions
148
+ - **PyPI**: [pypi.org/project/wexample-wex-addon-dev-python](https://pypi.org/project/wexample-wex-addon-dev-python/)
149
+
150
+ ## Integration in the Suite
151
+
152
+ This package is part of the **Wexample Suite** — a collection of high-quality Python packages designed to work seamlessly together.
153
+
154
+ ### Related Packages
155
+
156
+ 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.
157
+
158
+ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
159
+
160
+ # About us
161
+
162
+ Wexample 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.
163
+
164
+ 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.
165
+
166
+ 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.
167
+
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "wexample-wex-addon-dev-python"
9
- version = "0.0.48"
9
+ version = "0.0.53"
10
10
  description = "Python dev addon for wex"
11
11
  authors = [
12
12
  { name = "weeger", email = "contact@wexample.com" },
@@ -20,11 +20,13 @@ classifiers = [
20
20
  dependencies = [
21
21
  "attrs>=23.1.0",
22
22
  "cattrs>=23.1.0",
23
+ "jinja2",
24
+ "networkx",
23
25
  "pylint",
24
26
  "pyright",
25
- "wexample-filestate-python==0.0.44",
26
- "wexample-wex-addon-app==0.0.46",
27
- "wexample-wex-core==6.0.48",
27
+ "wexample-filestate-python==0.0.48",
28
+ "wexample-wex-addon-app==0.0.49",
29
+ "wexample-wex-core==6.0.55",
28
30
  ]
29
31
 
30
32
  [project.readme]
@@ -40,6 +42,7 @@ homepage = "https://github.com/wexample/python-wex-dev-python"
40
42
  [project.optional-dependencies]
41
43
  dev = [
42
44
  "pytest",
45
+ "pytest-cov",
43
46
  ]
44
47
 
45
48
  [tool.pdm]
@@ -50,3 +53,11 @@ package-dir = "src"
50
53
  packages = [
51
54
  { include = "wexample_wex_addon_dev_python", from = "src" },
52
55
  ]
56
+
57
+ [tool.setuptools.packages.find]
58
+ include = [
59
+ "*",
60
+ ]
61
+ exclude = [
62
+ "wexample_wex_addon_dev_python.testing*",
63
+ ]
@@ -44,6 +44,7 @@ def python__code__check(
44
44
  ) -> bool:
45
45
  """Check a Python file using various code quality tools."""
46
46
  from wexample_app.response.failure_response import FailureResponse
47
+
47
48
  from wexample_wex_addon_dev_python.commands.code.check.mypy import _code_check_mypy
48
49
  from wexample_wex_addon_dev_python.commands.code.check.pylint import (
49
50
  _code_check_pylint,
@@ -0,0 +1,249 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING
4
+
5
+ from wexample_filestate.config_value.readme_content_config_value import (
6
+ ReadmeContentConfigValue,
7
+ )
8
+ from wexample_helpers.classes.field import public_field
9
+ from wexample_helpers.decorator.base_class import base_class
10
+
11
+ if TYPE_CHECKING:
12
+ from wexample_wex_addon_dev_python.workdir.python_package_workdir import (
13
+ PythonPackageWorkdir,
14
+ )
15
+
16
+
17
+ @base_class
18
+ class PythonPackageReadmeContentConfigValue(ReadmeContentConfigValue):
19
+ workdir: PythonPackageWorkdir = public_field(
20
+ description="The python package workdir"
21
+ )
22
+
23
+ def get_templates(self) -> list[str] | None:
24
+ # Prepare context for Jinja2 rendering
25
+ context = self._get_template_context()
26
+
27
+ # Define fixed order of README sections
28
+ section_names = [
29
+ "title",
30
+ "table-of-contents",
31
+ "status-compatibility",
32
+ "prerequisites",
33
+ "installation",
34
+ "quickstart",
35
+ "basic-usage",
36
+ "configuration",
37
+ "logging",
38
+ "api-reference",
39
+ "examples",
40
+ "tests",
41
+ "code-quality",
42
+ "versioning",
43
+ "changelog",
44
+ "migration-notes",
45
+ "roadmap",
46
+ "troubleshooting",
47
+ "security",
48
+ "privacy",
49
+ "support",
50
+ "contribution-guidelines",
51
+ "maintainers",
52
+ "license",
53
+ "useful-links",
54
+ "suite-integration",
55
+ "compatibility-matrix",
56
+ "requirements",
57
+ "dependencies",
58
+ "links",
59
+ "suite-signature",
60
+ ]
61
+
62
+ # First pass: collect available sections (excluding title and table-of-contents)
63
+ available_sections = []
64
+ for section_name in section_names:
65
+ if section_name not in ["title", "table-of-contents"]:
66
+ # Check if section exists
67
+ if self._section_exists(section_name):
68
+ available_sections.append(
69
+ {
70
+ "name": section_name,
71
+ "title": self._section_name_to_title(section_name),
72
+ "anchor": section_name.replace("_", "-"),
73
+ }
74
+ )
75
+
76
+ # Add available sections to context for table-of-contents
77
+ context["available_sections"] = available_sections
78
+
79
+ # Render ordered sections (supports both .md and .md.j2)
80
+ rendered_content = ""
81
+ for section_name in section_names:
82
+ section_content = self._render_readme_section(section_name, context)
83
+ if section_content:
84
+ rendered_content += f"{section_content}\n\n"
85
+
86
+ return [rendered_content]
87
+
88
+ def _get_template_context(self) -> dict:
89
+ # Use TOMLDocument from the workdir
90
+ doc = self.workdir.get_project_config()
91
+ project = doc.get("project", {}) if isinstance(doc, dict) else {}
92
+
93
+ # Extract information
94
+ description = project.get("description", "")
95
+ python_version = project.get("requires-python", "")
96
+ dependencies = project.get("dependencies", [])
97
+ urls = (
98
+ project.get("urls", {}) if isinstance(project.get("urls", {}), dict) else {}
99
+ )
100
+ # Accept both lowercase and capitalized homepage key variants
101
+ homepage = urls.get("homepage") or urls.get("Homepage") or ""
102
+ license_field = project.get("license", {})
103
+ if isinstance(license_field, dict):
104
+ license_info = license_field.get("text", "") or license_field.get(
105
+ "file", ""
106
+ )
107
+ else:
108
+ license_info = str(license_field) if license_field else ""
109
+
110
+ # Format dependencies list
111
+ deps_list = "\n".join([f"- {dep}" for dep in dependencies])
112
+
113
+ return {
114
+ "package_name": self.workdir.get_package_name(),
115
+ "version": self.workdir.get_project_version(),
116
+ "description": description,
117
+ "python_version": python_version,
118
+ "dependencies": dependencies,
119
+ "deps_list": deps_list,
120
+ "homepage": homepage,
121
+ "license_info": license_info,
122
+ "workdir": self.workdir,
123
+ }
124
+
125
+ def _render_readme_section(self, section_name: str, context: dict) -> str | None:
126
+ """
127
+ Render a README section from .md or .md.j2 file with Jinja2 support.
128
+
129
+ Searches in three levels (in order):
130
+ 1. Package-level templates
131
+ 2. Suite-level templates
132
+ 3. Default templates (bundled with the module)
133
+
134
+ Tries .md.j2 first, then .md. Both formats support Jinja2 variables.
135
+
136
+ Args:
137
+ section_name: Name of the section (without extension)
138
+ context: Jinja2 context variables for rendering
139
+
140
+ Returns:
141
+ Rendered content or None if section file not found
142
+ """
143
+ from pathlib import Path
144
+
145
+ from jinja2 import Environment, FileSystemLoader, TemplateNotFound
146
+ from wexample_app.const.globals import WORKDIR_SETUP_DIR
147
+
148
+ workdir_path = self.workdir.get_path()
149
+
150
+ search_paths = [
151
+ workdir_path / WORKDIR_SETUP_DIR / "knowledge" / "readme", # Package-level
152
+ ]
153
+
154
+ # Package may have a suite.
155
+ suite_path = self.workdir.find_suite_workdir_path()
156
+ if suite_path is not None:
157
+ search_paths.append(
158
+ suite_path
159
+ / WORKDIR_SETUP_DIR
160
+ / "knowledge"
161
+ / "package-readme", # Suite-level
162
+ )
163
+
164
+ # Add default templates path (bundled with the module)
165
+ default_templates_path = (
166
+ Path(__file__).parent.parent / "resources" / "readme_templates"
167
+ )
168
+ search_paths.append(default_templates_path)
169
+
170
+ # Try .md.j2 first (Jinja2 template)
171
+ for search_path in search_paths:
172
+ if not search_path.exists():
173
+ continue
174
+
175
+ env = Environment(loader=FileSystemLoader(str(search_path)))
176
+ try:
177
+ template = env.get_template(f"{section_name}.md.j2")
178
+ return template.render(context)
179
+ except TemplateNotFound:
180
+ pass
181
+
182
+ # Try .md (static markdown, still rendered with Jinja2)
183
+ for search_path in search_paths:
184
+ md_path = search_path / f"{section_name}.md"
185
+ if md_path.exists():
186
+ content = md_path.read_text(encoding="utf-8")
187
+ env = Environment(loader=FileSystemLoader(str(search_path)))
188
+ template = env.from_string(content)
189
+ return template.render(context)
190
+
191
+ return None
192
+
193
+ def _section_exists(self, section_name: str) -> bool:
194
+ """
195
+ Check if a section file exists (.md or .md.j2).
196
+
197
+ Searches in three levels:
198
+ 1. Package-level templates
199
+ 2. Suite-level templates
200
+ 3. Default templates (bundled with the module)
201
+
202
+ Args:
203
+ section_name: Name of the section (without extension)
204
+
205
+ Returns:
206
+ True if section file exists, False otherwise
207
+ """
208
+ from pathlib import Path
209
+
210
+ from wexample_app.const.globals import WORKDIR_SETUP_DIR
211
+
212
+ workdir_path = self.workdir.get_path()
213
+
214
+ search_paths = [
215
+ workdir_path / WORKDIR_SETUP_DIR / "knowledge" / "readme",
216
+ ]
217
+
218
+ # Package may have a suite.
219
+ suite_path = self.workdir.find_suite_workdir_path()
220
+ if suite_path is not None:
221
+ search_paths.append(
222
+ suite_path / WORKDIR_SETUP_DIR / "knowledge" / "package-readme",
223
+ )
224
+
225
+ # Add default templates path (bundled with the module)
226
+ default_templates_path = (
227
+ Path(__file__).parent.parent / "resources" / "readme_templates"
228
+ )
229
+ search_paths.append(default_templates_path)
230
+
231
+ for search_path in search_paths:
232
+ if (search_path / f"{section_name}.md.j2").exists():
233
+ return True
234
+ if (search_path / f"{section_name}.md").exists():
235
+ return True
236
+
237
+ return False
238
+
239
+ def _section_name_to_title(self, section_name: str) -> str:
240
+ """
241
+ Convert section name to human-readable title.
242
+
243
+ Args:
244
+ section_name: Section name (e.g., "basic-usage")
245
+
246
+ Returns:
247
+ Human-readable title (e.g., "Basic Usage")
248
+ """
249
+ return section_name.replace("-", " ").replace("_", " ").title()