wexample-wex-addon-dev-python 8.10.0__tar.gz → 9.0.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.
Files changed (70) hide show
  1. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/PKG-INFO +4 -4
  2. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/README.md +2 -2
  3. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/pyproject.toml +2 -2
  4. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/workdir/python_workdir.py +51 -9
  5. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/__init__.py +0 -0
  6. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/__pycache__/__init__.py +0 -0
  7. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/__init__.py +0 -0
  8. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/__init__.py +0 -0
  9. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/check/__init__.py +0 -0
  10. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/check/mypy.py +0 -0
  11. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/check/pylint.py +0 -0
  12. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/check/pyright.py +0 -0
  13. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/check.py +0 -0
  14. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/format/__init__.py +0 -0
  15. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/format/black.py +0 -0
  16. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/format/isort.py +0 -0
  17. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/code/format.py +0 -0
  18. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/examples/__init__.py +0 -0
  19. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/examples/utils/__init__.py +0 -0
  20. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/examples/utils/some_example_type.py +0 -0
  21. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/examples/validate.py +0 -0
  22. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/commands/release/__init__.py +0 -0
  23. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/common/__init__.py +0 -0
  24. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/common/pypi_registry_gateway.py +0 -0
  25. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/config_value/__init__.py +0 -0
  26. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/config_value/__pycache__/__init__.py +0 -0
  27. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/config_value/python_package_readme_config_value.py +0 -0
  28. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/const/__init__.py +0 -0
  29. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/const/__pycache__/__init__.py +0 -0
  30. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/const/package.py +0 -0
  31. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/const/python.py +0 -0
  32. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/const/tags.py +0 -0
  33. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/file/__init__.py +0 -0
  34. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/file/__pycache__/__init__.py +0 -0
  35. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/file/python_app_iml_file.py +0 -0
  36. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/file/python_pyproject_toml_file.py +0 -0
  37. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/helpers/__init__.py +0 -0
  38. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/helpers/pdm.py +0 -0
  39. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/middleware/__init__.py +0 -0
  40. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/middleware/__pycache__/__init__.py +0 -0
  41. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/middleware/each_python_file_middleware.py +0 -0
  42. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/py.typed +0 -0
  43. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/python_addon_manager.py +0 -0
  44. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/resources/.wex.yml +0 -0
  45. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/resources/docker/Dockerfile.python-profiling +0 -0
  46. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/resources/package_publish_gitlab.yml +0 -0
  47. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/resources/readme_templates/tests.md.j2 +0 -0
  48. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/__init__.py +0 -0
  49. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/__init__.py +0 -0
  50. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/app_service.py +0 -0
  51. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/commands/__init__.py +0 -0
  52. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/commands/service/__init__.py +0 -0
  53. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/commands/service/install.py +0 -0
  54. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/commands/service/setup.py +0 -0
  55. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/docker/.wex.yml +0 -0
  56. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/docker/docker-compose.yml +0 -0
  57. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/samples/__init__.py +0 -0
  58. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/__init__.py +0 -0
  59. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/docker-compose.yml +0 -0
  60. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/entrypoint.sh +0 -0
  61. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/images/Dockerfile.base +0 -0
  62. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/images/Dockerfile.develop +0 -0
  63. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/samples/docker/images/__init__.py +0 -0
  64. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/services/python/service.yml +0 -0
  65. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/workdir/__init__.py +0 -0
  66. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/workdir/__pycache__/__init__.py +0 -0
  67. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/workdir/mixin/__init__.py +0 -0
  68. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/workdir/mixin/with_profiling_python_workdir_mixin.py +0 -0
  69. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/workdir/python_package_workdir.py +0 -0
  70. {wexample_wex_addon_dev_python-8.10.0 → wexample_wex_addon_dev_python-9.0.0}/src/wexample_wex_addon_dev_python/workdir/python_packages_suite_workdir.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wexample-wex-addon-dev-python
3
- Version: 8.10.0
3
+ Version: 9.0.0
4
4
  Summary: Python dev addon for wex
5
5
  Author-Email: weeger <contact@wexample.com>
6
6
  License: MIT
@@ -18,7 +18,7 @@ Requires-Dist: pyright
18
18
  Requires-Dist: wexample-api>=6.3.0
19
19
  Requires-Dist: wexample-filestate-python>=6.8.0
20
20
  Requires-Dist: wexample-wex-addon-ai>=9.0.0
21
- Requires-Dist: wexample-wex-addon-app>=24.0.0
21
+ Requires-Dist: wexample-wex-addon-app>=25.0.0
22
22
  Provides-Extra: dev
23
23
  Requires-Dist: pytest; extra == "dev"
24
24
  Requires-Dist: pytest-cov; extra == "dev"
@@ -26,7 +26,7 @@ Description-Content-Type: text/markdown
26
26
 
27
27
  # wex_addon_dev_python
28
28
 
29
- Version: 8.10.0
29
+ Version: 9.0.0
30
30
 
31
31
  Python dev addon for wex
32
32
 
@@ -115,7 +115,7 @@ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the comp
115
115
  - wexample-api: >=6.3.0
116
116
  - wexample-filestate-python: >=6.8.0
117
117
  - wexample-wex-addon-ai: >=9.0.0
118
- - wexample-wex-addon-app: >=24.0.0
118
+ - wexample-wex-addon-app: >=25.0.0
119
119
 
120
120
  ## Versioning & Compatibility Policy
121
121
 
@@ -1,6 +1,6 @@
1
1
  # wex_addon_dev_python
2
2
 
3
- Version: 8.10.0
3
+ Version: 9.0.0
4
4
 
5
5
  Python dev addon for wex
6
6
 
@@ -89,7 +89,7 @@ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the comp
89
89
  - wexample-api: >=6.3.0
90
90
  - wexample-filestate-python: >=6.8.0
91
91
  - wexample-wex-addon-ai: >=9.0.0
92
- - wexample-wex-addon-app: >=24.0.0
92
+ - wexample-wex-addon-app: >=25.0.0
93
93
 
94
94
  ## Versioning & Compatibility Policy
95
95
 
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "wexample-wex-addon-dev-python"
9
- version = "8.10.0"
9
+ version = "9.0.0"
10
10
  description = "Python dev addon for wex"
11
11
  authors = [
12
12
  { name = "weeger", email = "contact@wexample.com" },
@@ -27,7 +27,7 @@ dependencies = [
27
27
  "wexample-api>=6.3.0",
28
28
  "wexample-filestate-python>=6.8.0",
29
29
  "wexample-wex-addon-ai>=9.0.0",
30
- "wexample-wex-addon-app>=24.0.0",
30
+ "wexample-wex-addon-app>=25.0.0",
31
31
  ]
32
32
 
33
33
  [project.readme]
@@ -82,6 +82,22 @@ class PythonWorkdir(
82
82
  # Use standard PDM install
83
83
  return venv_path
84
84
 
85
+ def count_tests(self) -> int:
86
+ import re
87
+
88
+ tests_path = self.get_path() / "tests"
89
+ if not tests_path.is_dir():
90
+ return 0
91
+
92
+ count = 0
93
+ for file in tests_path.rglob("test_*.py"):
94
+ count += len(
95
+ re.findall(
96
+ r"^\s*(?:async )?def test_", file.read_text(), flags=re.MULTILINE
97
+ )
98
+ )
99
+ return count
100
+
85
101
  def get_app_config_file(self, reload: bool = True) -> PythonPyprojectTomlFile:
86
102
  from wexample_wex_addon_dev_python.file.python_pyproject_toml_file import (
87
103
  PythonPyprojectTomlFile,
@@ -123,7 +139,7 @@ class PythonWorkdir(
123
139
  return string_to_kebab_case(self.get_package_import_name())
124
140
 
125
141
  def get_python_exec_module_command(self, module_name: str) -> list[str]:
126
- return [self.get_python_path(), "-m", module_name]
142
+ return [str(self.get_python_path()), "-m", module_name]
127
143
 
128
144
  def get_python_path(self) -> Path:
129
145
  return self.get_venv_bin_path() / "python"
@@ -132,7 +148,13 @@ class PythonWorkdir(
132
148
  return self.get_venv_path() / "bin"
133
149
 
134
150
  def get_venv_path(self) -> Path:
135
- return self.get_path() / ".venv"
151
+ # The suite/app config may point every package to a single shared
152
+ # venv (python.venv_path); the local .venv is only the standalone
153
+ # fallback.
154
+ venv_path_config = self.search_app_or_suite_runtime_config("python.venv_path")
155
+ if venv_path_config.is_none():
156
+ return self.get_path() / ".venv"
157
+ return Path(venv_path_config.get_str())
136
158
 
137
159
  def has_coverage_changes_since_last_report(self) -> bool:
138
160
  """Return True if coverage has changed since last saved report."""
@@ -149,6 +171,14 @@ class PythonWorkdir(
149
171
 
150
172
  return current_coverage != last_report.get("percent")
151
173
 
174
+ def has_tests(self) -> bool:
175
+ # The tests/ directory itself is filestate-managed scaffolding and
176
+ # exists for every Python package; only actual test files count.
177
+ tests_path = self.get_path() / "tests"
178
+ if not tests_path.is_dir():
179
+ return False
180
+ return any(tests_path.rglob("test_*.py"))
181
+
152
182
  def operation_add_event_listener(
153
183
  self,
154
184
  operation: AbstractOperation | type[AbstractOperation],
@@ -274,16 +304,21 @@ class PythonWorkdir(
274
304
  self, format: str = PYTHON_PYTEST_COV_FORMAT_JSON
275
305
  ) -> list[str]:
276
306
  cmd = self.get_python_exec_module_command("pytest")
307
+ # The json report is always produced: it feeds test.coverage.last_report.
308
+ # The requested format is added as an extra view when it differs.
277
309
  cmd.extend(
278
310
  [
279
311
  "--cov",
280
- f"--cov-report={format}",
312
+ f"--cov-report={PYTHON_PYTEST_COV_FORMAT_JSON}",
281
313
  ]
282
314
  )
315
+ if format != PYTHON_PYTEST_COV_FORMAT_JSON:
316
+ cmd.append(f"--cov-report={format}")
283
317
 
284
318
  return cmd
285
319
 
286
- def test_run(self, format: str = PYTHON_PYTEST_COV_FORMAT_JSON) -> None:
320
+ def test_run(self, format: str | None = None) -> None:
321
+ format = format or PYTHON_PYTEST_COV_FORMAT_JSON
287
322
  self.shell_run_for_app(cmd=self.test_get_command(format=format))
288
323
 
289
324
  json_file = JsonFile.create_from_path(
@@ -291,11 +326,14 @@ class PythonWorkdir(
291
326
  )
292
327
  totals = json_file.read_config().search("totals", default={}).get_dict()
293
328
 
329
+ from wexample_helpers_git.helpers.git import git_get_current_commit_hash
330
+
294
331
  config_file = self.get_config_file()
295
332
  config = config_file.read_config()
296
333
  config.set_by_path(
297
334
  "test.coverage.last_report",
298
335
  {
336
+ "commit_hash": git_get_current_commit_hash(cwd=self.get_path()),
299
337
  "covered": totals.get("covered_lines", 0),
300
338
  "excluded": totals.get("excluded_lines", 0),
301
339
  "missing": totals.get("missing_lines", 0),
@@ -541,13 +579,17 @@ class PythonWorkdir(
541
579
  self, venv_path: Path, env: str | None = None, force: bool = False
542
580
  ) -> None:
543
581
  from wexample_wex_addon_app.helpers.python import (
544
- python_install_dependencies_in_venv,
582
+ python_install_dependency_in_venv,
545
583
  )
546
584
 
547
- toml_file = self.get_app_config_file()
548
- # Get all dependencies from pyproject.toml
549
- python_install_dependencies_in_venv(
550
- venv_path=venv_path, names=toml_file.get_dependencies_versions().keys()
585
+ # Installing the package itself (editable, with dev extras) pulls
586
+ # runtime and test dependencies while honoring the version
587
+ # constraints of pyproject.toml — pytest must be present for the
588
+ # publication test phase.
589
+ python_install_dependency_in_venv(
590
+ venv_path=venv_path,
591
+ name=f"{self.get_path()}[dev]",
592
+ editable=True,
551
593
  )
552
594
 
553
595
  def _on_test_event(self, event: Event) -> None: