nwp500-python 9.3.0__tar.gz → 9.3.2__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 (227) hide show
  1. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/.github/workflows/ci.yml +33 -3
  2. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/CHANGELOG.rst +124 -0
  3. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/Makefile +4 -3
  4. {nwp500_python-9.3.0/src/nwp500_python.egg-info → nwp500_python-9.3.2}/PKG-INFO +1 -1
  5. nwp500_python-9.3.2/RELEASE.md +418 -0
  6. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/optimize-tou.rst +72 -57
  7. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/openapi.yaml +35 -19
  8. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/python_api/models.rst +55 -0
  9. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/python_api/mqtt_client.rst +4 -11
  10. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/firmware_payload_capture.py +18 -14
  11. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/tou_schedule.py +4 -4
  12. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/scripts/bump_version.py +4 -5
  13. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/__init__.py +4 -0
  14. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/cli/__main__.py +74 -15
  15. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/cli/handlers.py +9 -5
  16. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/models/__init__.py +4 -0
  17. nwp500_python-9.3.2/src/nwp500/models/device.py +104 -0
  18. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/models/feature.py +6 -1
  19. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/models/tou.py +6 -5
  20. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/_control_commands.py +0 -8
  21. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/_device_subscriptions.py +6 -5
  22. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/control.py +0 -32
  23. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/subscriptions.py +7 -6
  24. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/reservations.py +3 -1
  25. {nwp500_python-9.3.0 → nwp500_python-9.3.2/src/nwp500_python.egg-info}/PKG-INFO +1 -1
  26. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500_python.egg-info/SOURCES.txt +2 -0
  27. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500_python.egg-info/scm_file_list.json +176 -174
  28. nwp500_python-9.3.2/src/nwp500_python.egg-info/scm_version.json +8 -0
  29. nwp500_python-9.3.2/tests/test_cli_commands.py +441 -0
  30. nwp500_python-9.3.2/tests/test_device_rest_models.py +128 -0
  31. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_models.py +49 -0
  32. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_public_api.py +13 -0
  33. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_reservations.py +21 -0
  34. nwp500_python-9.3.2/uv.lock +3 -0
  35. nwp500_python-9.3.0/RELEASE.md +0 -393
  36. nwp500_python-9.3.0/src/nwp500/models/device.py +0 -57
  37. nwp500_python-9.3.0/src/nwp500_python.egg-info/scm_version.json +0 -8
  38. nwp500_python-9.3.0/tests/test_cli_commands.py +0 -220
  39. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/.coveragerc +0 -0
  40. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/.github/RESOLVING_PR_COMMENTS.md +0 -0
  41. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/.github/copilot-instructions.md +0 -0
  42. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/.github/workflows/release.yml +0 -0
  43. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/.gitignore +0 -0
  44. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/.pre-commit-config.yaml +0 -0
  45. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/.readthedocs.yml +0 -0
  46. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/AUTHORS.rst +0 -0
  47. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/CONTRIBUTING.rst +0 -0
  48. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/LICENSE.txt +0 -0
  49. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/README.rst +0 -0
  50. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/Makefile +0 -0
  51. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/_static/.gitignore +0 -0
  52. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/conf.py +0 -0
  53. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/explanation/advanced-features.rst +0 -0
  54. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/explanation/architecture.rst +0 -0
  55. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/explanation/index.rst +0 -0
  56. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/explanation/tank-energy.rst +0 -0
  57. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/explanation/unknown-values.rst +0 -0
  58. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/authenticate.rst +0 -0
  59. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/auto-recovery.rst +0 -0
  60. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/diagnose-mqtt.rst +0 -0
  61. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/home-assistant.rst +0 -0
  62. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/index.rst +0 -0
  63. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/maintenance.rst +0 -0
  64. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/manage-units.rst +0 -0
  65. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/monitor-status.rst +0 -0
  66. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/queue-commands.rst +0 -0
  67. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/schedule-operation.rst +0 -0
  68. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/how-to/track-energy.rst +0 -0
  69. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/index.rst +0 -0
  70. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/project/authors.rst +0 -0
  71. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/project/changelog.rst +0 -0
  72. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/project/contributing.rst +0 -0
  73. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/project/history.rst +0 -0
  74. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/project/license.rst +0 -0
  75. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/configuration.rst +0 -0
  76. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/enumerations.rst +0 -0
  77. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/index.rst +0 -0
  78. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/installation.rst +0 -0
  79. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/protocol/data_conversions.rst +0 -0
  80. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/protocol/device_features.rst +0 -0
  81. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/protocol/device_status.rst +0 -0
  82. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/protocol/error_codes.rst +0 -0
  83. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/protocol/mqtt_protocol.rst +0 -0
  84. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/protocol/quick_reference.rst +0 -0
  85. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/protocol/rest_api.rst +0 -0
  86. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/python_api/api_client.rst +0 -0
  87. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/python_api/auth_client.rst +0 -0
  88. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/python_api/cli.rst +0 -0
  89. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/python_api/events.rst +0 -0
  90. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/reference/python_api/exceptions.rst +0 -0
  91. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/requirements.txt +0 -0
  92. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/docs/tutorials/getting-started.rst +0 -0
  93. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/.ruff.toml +0 -0
  94. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/README.md +0 -0
  95. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/air_filter_reset.py +0 -0
  96. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/anti_legionella.py +0 -0
  97. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/auto_recovery.py +0 -0
  98. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/combined_callbacks.py +0 -0
  99. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/demand_response.py +0 -0
  100. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/device_capabilities.py +0 -0
  101. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/device_status_debug.py +0 -0
  102. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/energy_analytics.py +0 -0
  103. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/error_code_demo.py +0 -0
  104. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/mqtt_diagnostics.py +0 -0
  105. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/power_control.py +0 -0
  106. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/recirculation_control.py +0 -0
  107. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/reconnection_demo.py +0 -0
  108. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/reservation_schedule.py +0 -0
  109. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/simple_auto_recovery.py +0 -0
  110. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/token_restoration.py +0 -0
  111. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/tou_openei.py +0 -0
  112. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/advanced/water_reservation.py +0 -0
  113. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/beginner/01_authentication.py +0 -0
  114. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/beginner/02_list_devices.py +0 -0
  115. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/beginner/03_get_status.py +0 -0
  116. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/beginner/04_set_temperature.py +0 -0
  117. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/advanced_auth_patterns.py +0 -0
  118. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/command_queue.py +0 -0
  119. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/device_status_callback.py +0 -0
  120. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/error_handling.py +0 -0
  121. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/event_driven_control.py +0 -0
  122. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/improved_auth.py +0 -0
  123. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/legacy_auth_constructor.py +0 -0
  124. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/mqtt_realtime_monitoring.py +0 -0
  125. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/periodic_requests.py +0 -0
  126. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/set_mode.py +0 -0
  127. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/intermediate/vacation_mode.py +0 -0
  128. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/mask.py +0 -0
  129. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/testing/periodic_device_info.py +0 -0
  130. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/testing/simple_periodic_info.py +0 -0
  131. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/testing/test_api_client.py +0 -0
  132. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/testing/test_mqtt_connection.py +0 -0
  133. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/testing/test_mqtt_messaging.py +0 -0
  134. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/examples/testing/test_periodic_minimal.py +0 -0
  135. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/pyproject.toml +0 -0
  136. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/scripts/README.md +0 -0
  137. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/scripts/diagnose_mqtt_connection.py +0 -0
  138. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/scripts/extract_changelog.py +0 -0
  139. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/scripts/format.py +0 -0
  140. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/scripts/lint.py +0 -0
  141. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/scripts/setup-dev.py +0 -0
  142. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/scripts/validate_version.py +0 -0
  143. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/setup.cfg +0 -0
  144. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/setup.py +0 -0
  145. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/_base.py +0 -0
  146. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/api_client.py +0 -0
  147. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/auth.py +0 -0
  148. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/cli/__init__.py +0 -0
  149. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/cli/monitoring.py +0 -0
  150. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/cli/output_formatters.py +0 -0
  151. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/cli/presentation.py +0 -0
  152. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/cli/rich_output.py +0 -0
  153. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/cli/token_storage.py +0 -0
  154. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/command_decorators.py +0 -0
  155. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/config.py +0 -0
  156. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/converters.py +0 -0
  157. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/device_capabilities.py +0 -0
  158. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/device_info_cache.py +0 -0
  159. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/encoding.py +0 -0
  160. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/enums.py +0 -0
  161. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/events.py +0 -0
  162. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/exceptions.py +0 -0
  163. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/factory.py +0 -0
  164. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/field_factory.py +0 -0
  165. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/models/_converters.py +0 -0
  166. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/models/energy.py +0 -0
  167. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/models/mqtt_models.py +0 -0
  168. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/models/schedule.py +0 -0
  169. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/models/status.py +0 -0
  170. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/__init__.py +0 -0
  171. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/client.py +0 -0
  172. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/command_queue.py +0 -0
  173. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/connection.py +0 -0
  174. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/diagnostics.py +0 -0
  175. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/periodic.py +0 -0
  176. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/reconnection.py +0 -0
  177. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/state_tracker.py +0 -0
  178. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/types.py +0 -0
  179. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt/utils.py +0 -0
  180. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/mqtt_events.py +0 -0
  181. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/openei.py +0 -0
  182. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/py.typed +0 -0
  183. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/temperature.py +0 -0
  184. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/topic_builder.py +0 -0
  185. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/tou_schedule.py +0 -0
  186. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/unit_system.py +0 -0
  187. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500/utils.py +0 -0
  188. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500_python.egg-info/dependency_links.txt +0 -0
  189. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500_python.egg-info/entry_points.txt +0 -0
  190. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500_python.egg-info/not-zip-safe +0 -0
  191. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500_python.egg-info/requires.txt +0 -0
  192. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/src/nwp500_python.egg-info/top_level.txt +0 -0
  193. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/conftest.py +0 -0
  194. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_api_helpers.py +0 -0
  195. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_auth.py +0 -0
  196. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_auth_session_lifecycle.py +0 -0
  197. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_bug_fixes.py +0 -0
  198. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_canonical_schedule.py +0 -0
  199. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_cli_basic.py +0 -0
  200. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_cli_tristate_presentation.py +0 -0
  201. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_command_decorators.py +0 -0
  202. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_command_queue.py +0 -0
  203. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_device_capabilities.py +0 -0
  204. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_device_info_cache.py +0 -0
  205. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_events.py +0 -0
  206. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_exceptions.py +0 -0
  207. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_model_converters.py +0 -0
  208. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_mqtt_clean_session_resume.py +0 -0
  209. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_mqtt_client_init.py +0 -0
  210. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_mqtt_events.py +0 -0
  211. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_mqtt_hypothesis.py +0 -0
  212. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_mqtt_reconnection.py +0 -0
  213. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_mqtt_reconnection_storm.py +0 -0
  214. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_mqtt_reliability.py +0 -0
  215. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_multi_device.py +0 -0
  216. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_openei.py +0 -0
  217. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_protocol_correctness.py +0 -0
  218. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_temperature_converters.py +0 -0
  219. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_threading_model.py +0 -0
  220. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_token_storage.py +0 -0
  221. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_tou_api.py +0 -0
  222. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_tou_schedule.py +0 -0
  223. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_unit_switching.py +0 -0
  224. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_unit_system_process_wide.py +0 -0
  225. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_utility_modules.py +0 -0
  226. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tests/test_utils.py +0 -0
  227. {nwp500_python-9.3.0 → nwp500_python-9.3.2}/tox.ini +0 -0
@@ -69,15 +69,45 @@ jobs:
69
69
 
70
70
  - name: Run tox tests
71
71
  run: tox -e default
72
- - name: Install project testing extras (ensure pytest-asyncio present)
72
+
73
+ test-without-cli-extras:
74
+ # tox installs the cli extra, so the job above never exercises an
75
+ # install without click or rich. release.yml installs
76
+ # -e ".[testing]", which has neither, and a test module importing
77
+ # click above its ImportError guard failed there and nowhere else,
78
+ # after the release tag was already pushed. This job runs the
79
+ # release workflow's install so that failure surfaces on the pull
80
+ # request instead.
81
+ name: Test without CLI extras
82
+ runs-on: ubuntu-latest
83
+
84
+ steps:
85
+ - uses: actions/checkout@v4
86
+
87
+ - name: Set up Python
88
+ uses: actions/setup-python@v5
89
+ with:
90
+ python-version: '3.14'
91
+
92
+ - name: Install project with testing extras only
73
93
  run: |
74
94
  python -m pip install --upgrade pip
75
- python -m pip install '.[testing]'
95
+ python -m pip install -e ".[testing]"
96
+
97
+ - name: Verify the CLI extras really are absent
98
+ run: |
99
+ if python -c 'import click' 2>/dev/null; then
100
+ echo "click is installed; this job no longer tests what it claims to"
101
+ exit 1
102
+ fi
103
+
104
+ - name: Run tests
105
+ run: python -m pytest
76
106
 
77
107
  build:
78
108
  name: Build Distribution
79
109
  runs-on: ubuntu-latest
80
- needs: [lint, test]
110
+ needs: [lint, test, test-without-cli-extras]
81
111
 
82
112
  steps:
83
113
  - uses: actions/checkout@v4
@@ -5,6 +5,130 @@ Changelog
5
5
  Unreleased
6
6
  ==========
7
7
 
8
+ Version 9.3.2 (2026-09-01)
9
+ ==========================
10
+
11
+ Fixed
12
+ -----
13
+ - **A null ``errorCode`` no longer makes ``/device/list`` unparseable.**
14
+ The cloud returns ``"error": {"errorCode": null}`` on some devices.
15
+ :class:`~nwp500.models.DeviceErrorSummary` typed the field
16
+ ``ErrorCode | int``, so validation of the whole listing failed and every
17
+ caller - including the Home Assistant integration, which could no longer
18
+ set up - lost the device entirely. ``error_code`` is now
19
+ ``ErrorCode | int | None`` and defaults to ``None``: a null means the
20
+ cloud reported no code, which is not the same claim as ``NO_ERROR``.
21
+ Callers that treated the field as always-present should handle ``None``.
22
+
23
+ Security
24
+ --------
25
+ - **MAC address no longer logged in the clear when a reservations
26
+ unsubscribe fails.** ``fetch_reservations`` logged
27
+ ``device_info.mac_address`` unredacted in its cleanup warning, while the
28
+ identical warning in ``update_reservations_confirmed`` a few lines below
29
+ passed it through ``redact_mac``. CodeQL flagged it as
30
+ ``py/clear-text-logging-sensitive-data`` (high). Both call sites now
31
+ redact.
32
+
33
+ Version 9.3.1 (2026-08-29)
34
+ ==========================
35
+
36
+ ``NavienMqttClient.request_tou_settings()`` is removed. Not a breaking
37
+ change in practice: the device never answered it, so no caller can have
38
+ been getting a schedule out of it. Code that still names the method will
39
+ now fail with ``AttributeError`` rather than time out. See Removed below.
40
+
41
+ Added
42
+ -----
43
+ - **REST fields the cloud added since the models were written.**
44
+ ``/device/list`` now returns an ``error`` block (``errorCode``,
45
+ ``errorOccuredTime``) and the ``descaling`` block previously seen only
46
+ on ``/device/info``, and ``deviceInfo`` gained ``modelTypeCode`` and
47
+ ``installerId``. None of these were modelled, and ``NavienBaseModel``
48
+ ignores unknown keys, so all of them were silently discarded.
49
+ :class:`~nwp500.models.Device` gains optional ``error``
50
+ (:class:`~nwp500.models.DeviceErrorSummary`) and ``descaling``
51
+ (:class:`~nwp500.models.DescalingInfo`) sections, and
52
+ :class:`~nwp500.models.DeviceInfo` gains ``model_type_code`` and
53
+ ``installer_id``. ``error`` makes the device's last recorded fault
54
+ readable without an MQTT connection, including while the device is
55
+ offline. Every new field is optional, so responses that omit them - such
56
+ as ``/device/info``, which carries no ``error`` block - parse unchanged.
57
+ ``error_code`` is typed ``ErrorCode | int`` (validated left to right, so a
58
+ known code becomes an ``ErrorCode`` member and only an unknown one stays a
59
+ plain int) so an unrecognised code cannot make a whole listing unparseable. ``docs/openapi.yaml`` is
60
+ updated to match.
61
+
62
+ Removed
63
+ -------
64
+ - **``request_tou_settings()`` removed - the device has no MQTT read for its
65
+ TOU schedule.** The method published a ``CommandCode.TOU_RESERVATION``
66
+ message to ``ctrl/tou/rd`` carrying only ``controllerSerialNumber``, then
67
+ waited for a reply on ``res/tou/rd``. No reply ever comes: a live device
68
+ with TOU provisioned (``program_reservation_use`` true, a valid controller
69
+ serial, and a plan the REST API returns in full) stayed silent for 45
70
+ seconds. ``ctrl/tou/rd`` with that command code is the *write* - it is what
71
+ :meth:`~nwp500.NavienMqttClient.configure_tou_schedule` publishes and what
72
+ the vendor app publishes from its TOU editor
73
+ (``TouScheduleViewmodel.setPublishMgppControlTou``) - and the device answers
74
+ on ``res/tou/rd`` only to confirm such a write. The vendor app reads TOU
75
+ over REST, which is the only TOU read the protocol has.
76
+
77
+ Beyond returning nothing, the call published a write-shaped command with no
78
+ schedule attached. This device ignored it - ``touStatus`` was unchanged
79
+ across repeated calls - but a firmware that took it at face value could read
80
+ it as "store an empty TOU schedule".
81
+
82
+ **Migration**: use :meth:`~nwp500.NavienAPIClient.get_tou_info`, which
83
+ returns the stored plan - rate name, utility, ZIP code and the seasonal
84
+ pricing intervals. The read itself is pure REST; it is keyed by the
85
+ controller serial number, which only the MQTT device-info response
86
+ publishes, so fetch that once and cache it.
87
+ :meth:`~nwp500.NavienMqttClient.subscribe_tou_response` is unaffected and
88
+ still delivers write confirmations. Enabling and disabling TOU
89
+ (:meth:`~nwp500.NavienMqttClient.set_tou_enabled`, command codes
90
+ ``TOU_ON``/``TOU_OFF``) is a separate path and is unaffected.
91
+
92
+ Fixed
93
+ -----
94
+ - **CLI ``energy --months`` no longer duplicates ``--month`` output.**
95
+ ``handle_get_energy_request`` picked the view from the length of the
96
+ month list, so ``--months 5`` took the single-month branch and printed
97
+ the same daily breakdown as ``--month 5`` instead of the monthly
98
+ summary. The handler now takes an explicit ``daily`` flag set by the
99
+ option the user actually passed. ``energy`` also rejects ``--month``
100
+ and ``--months`` together rather than silently preferring ``--month``,
101
+ and validates the ``--months`` range and format the way ``--month``
102
+ already did. All of that validation now happens while Click parses the
103
+ arguments, so a bad invocation is a usage error (exit code 2) before any
104
+ authentication or MQTT connection is attempted - previously the command
105
+ body raised ``ClickException`` after connecting, where ``async_command``'s
106
+ catch-all reported it as an "Unexpected Error" with a traceback, and
107
+ anyone without working credentials saw an authentication failure instead
108
+ of the usage error. That catch-all now re-raises ``ClickException`` so any
109
+ command can report a usage error as itself.
110
+ - **``DeviceFeature.mixing_valve_use`` now reads the device's actual key.**
111
+ The field was aliased to ``mixingValveUse``, but the device sends
112
+ ``mixingValueUse`` - "Value", not "Valve" - and the base model ignores
113
+ unknown keys, so the field silently reported its ``False`` default on
114
+ every device regardless of whether a thermostatic mixing valve was
115
+ supported. The CLI's "Mixing Valve" capability row was wrong for the
116
+ same reason. The misspelling is Navien's own: it appears in the vendor
117
+ app's ``KDResponseMgppDid$Feature`` class and in
118
+ ``docs/reference/protocol/device_features.rst``, which documented the
119
+ wire spelling correctly all along.
120
+
121
+ - **``firmware_payload_capture.py`` captured almost nothing.** Its wildcards
122
+ covered ``cmd/{type}/{client_id}/res/#`` and the event topic, but the device
123
+ acknowledges control and query commands on
124
+ ``cmd/{type}/navilink-{mac}/{client_id}/res`` - which neither pattern
125
+ matches - so the device status and device info responses were missed, along
126
+ with every request published on the device path. A capture run recorded 2
127
+ payloads where it should have recorded 11. It now also subscribes to
128
+ ``cmd/{type}/navilink-{mac}/#``, which additionally picks up traffic from
129
+ other clients on the same device. Query results the device routes back to a
130
+ client-keyed topic, such as reservations and energy usage, were already
131
+ covered by the existing response wildcard.
8
132
  Version 9.3.0 (2026-08-03)
9
133
  ==========================
10
134
 
@@ -53,10 +53,11 @@ build: clean ## Build distribution packages
53
53
  check-release: lint format-check test validate-version ## Run all checks before release (lint, format check, tests, version validation)
54
54
  @echo "✓ All checks passed! Ready for release."
55
55
 
56
- release: check-release build ## Prepare and build a release (run checks, then build)
56
+ release: check-release build ## Run the release checks and build locally (does not publish)
57
57
  @echo "✓ Release build complete!"
58
- @echo "To publish to TestPyPI: make publish-test"
59
- @echo "To publish to PyPI: make publish"
58
+ @echo "This built locally and published nothing."
59
+ @echo "To release: make version-bump BUMP=patch, then push main and the tag."
60
+ @echo "Pushing the tag is what publishes to PyPI. See RELEASE.md."
60
61
 
61
62
  publish-test: ## Publish to TestPyPI
62
63
  python -m twine check dist/*
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nwp500-python
3
- Version: 9.3.0
3
+ Version: 9.3.2
4
4
  Summary: A library for controlling Navien NWP500 Water Heaters via NaviLink
5
5
  Home-page: https://github.com/eman/nwp500-python
6
6
  Author: Emmanuel Levijarvi
@@ -0,0 +1,418 @@
1
+ # Release Process
2
+
3
+ This document describes the release process for nwp500-python, including code quality checks, formatting, and publishing.
4
+
5
+ ## Prerequisites
6
+
7
+ Install development dependencies:
8
+
9
+ ```bash
10
+ pip install -e ".[dev]"
11
+ # or
12
+ make install-dev
13
+ ```
14
+
15
+ ## Quick Release
16
+
17
+ Despite the name, this does not release anything - it runs the checks and
18
+ builds locally so you can see the release is in a fit state:
19
+
20
+ ```bash
21
+ make release
22
+ ```
23
+
24
+ This will:
25
+ 1. Run linting checks
26
+ 2. Verify code formatting
27
+ 3. Run all tests
28
+ 4. Validate the version configuration
29
+ 5. Clean build artifacts
30
+ 6. Build distribution packages
31
+
32
+ Releasing is `make version-bump` followed by pushing the tag, which hands off
33
+ to CI. See [The Release Runs Itself](#5-the-release-runs-itself).
34
+
35
+ ## Step-by-Step Release Process
36
+
37
+ ### 1. Code Quality Checks
38
+
39
+ #### Format Code
40
+
41
+ Format all code with ruff:
42
+
43
+ ```bash
44
+ make format
45
+ # or
46
+ tox -e format
47
+ ```
48
+
49
+ This will:
50
+ - Automatically fix linting issues where possible
51
+ - Format code to comply with PEP 8 and project standards
52
+ - Sort imports according to isort rules
53
+
54
+ #### Check Linting
55
+
56
+ Check code without making changes:
57
+
58
+ ```bash
59
+ make lint
60
+ # or
61
+ tox -e lint
62
+ ```
63
+
64
+ #### Verify Formatting
65
+
66
+ Check that code is properly formatted:
67
+
68
+ ```bash
69
+ make format-check
70
+ ```
71
+
72
+ ### 2. Run Tests
73
+
74
+ Run the test suite:
75
+
76
+ ```bash
77
+ make test
78
+ # or
79
+ pytest
80
+ ```
81
+
82
+ Run tests with coverage report:
83
+
84
+ ```bash
85
+ make test-cov
86
+ ```
87
+
88
+ ### 3. Run All Checks
89
+
90
+ Run all quality checks at once:
91
+
92
+ ```bash
93
+ make check-release
94
+ ```
95
+
96
+ This runs:
97
+ - Linting checks
98
+ - Format verification
99
+ - Full test suite
100
+
101
+ ### 4. Update Version and Changelog
102
+
103
+ #### Understanding Version Management
104
+
105
+ **IMPORTANT**: This project uses `setuptools_scm` to manage versions from git tags.
106
+ The version is **NOT** stored in any Python files or config files.
107
+
108
+ **DO NOT** edit the `version` field in `setup.cfg`'s `[pyscaffold]` section!
109
+ That field stores the PyScaffold tool version (4.6), not the package version.
110
+
111
+ #### Version Bump Process
112
+
113
+ The bump script owns the version heading, the changelog commit and the tag.
114
+ Do not write any of them by hand - `scripts/extract_changelog.py` parses the
115
+ heading it produces to build the GitHub release notes, and a hand-written
116
+ duplicate silently breaks that.
117
+
118
+ 1. Make sure `CHANGELOG.rst` describes the release under `Unreleased`.
119
+
120
+ Add entries only - no `Version X.Y.Z` heading, no date. Normally each PR
121
+ has already added its own entry, so this is a review rather than a write:
122
+
123
+ ```rst
124
+ Unreleased
125
+ ==========
126
+
127
+ Fixed
128
+ -----
129
+ - **Something was broken.** It is no longer broken.
130
+ ```
131
+
132
+ If you edit anything here, commit it before continuing: the script
133
+ refuses to run on a dirty working directory.
134
+
135
+ 2. Run the bump script:
136
+
137
+ ```bash
138
+ # For a patch release (X.Y.Z -> X.Y.Z+1)
139
+ make version-bump BUMP=patch
140
+
141
+ # For a minor release (X.Y.Z -> X.Y+1.0)
142
+ make version-bump BUMP=minor
143
+
144
+ # For a major release (X.Y.Z -> X+1.0.0)
145
+ make version-bump BUMP=major
146
+
147
+ # Or specify an explicit version
148
+ make version-bump BUMP=3.1.5
149
+ ```
150
+
151
+ The script will:
152
+ - Refuse to run unless the working directory is clean
153
+ - Refuse to run if the branch is behind its upstream (it warns, but
154
+ continues, if the branch is ahead or has no upstream)
155
+ - Get the current version from git tags
156
+ - Calculate the new version and validate the progression (prevents large
157
+ jumps)
158
+ - Insert `Version X.Y.Z (YYYY-MM-DD)` under `Unreleased` in `CHANGELOG.rst`
159
+ - Commit that as `Update changelog for vX.Y.Z`
160
+ - Create the annotated tag `vX.Y.Z`
161
+
162
+ 3. Push the commit, then the tag:
163
+
164
+ ```bash
165
+ git push origin main
166
+ git push origin vX.Y.Z
167
+ ```
168
+
169
+ Push the commit first. The tag triggers the release, and the release notes
170
+ come from the changelog at that commit.
171
+
172
+ #### Manual Version Tagging (Not Recommended)
173
+
174
+ If you need to create a tag manually:
175
+
176
+ ```bash
177
+ git tag -a vX.Y.Z -m "Release version X.Y.Z"
178
+ git push origin vX.Y.Z
179
+ ```
180
+
181
+ **Warning**: Manual tagging bypasses the clean-tree, not-behind-upstream and
182
+ version progression checks, and does not touch the changelog - so unless you
183
+ added the `Version X.Y.Z (YYYY-MM-DD)` heading yourself,
184
+ `scripts/extract_changelog.py` finds no matching section and the GitHub release
185
+ notes fall back to the bare line `Release X.Y.Z`. Use the version bump script
186
+ instead.
187
+
188
+ ### 5. The Release Runs Itself
189
+
190
+ Pushing a `v*` tag starts `.github/workflows/release.yml`, which is the only
191
+ thing that publishes. In order, it:
192
+
193
+ 1. **Pre-release Checks** - `ruff check`, `ruff format --check`, and `pytest`
194
+ against an install of `-e ".[testing]"`
195
+ 2. **Build and Publish to PyPI** - `python -m build`, `twine check`, then
196
+ `pypa/gh-action-pypi-publish` via PyPI trusted publishing (no API tokens
197
+ are stored anywhere)
198
+ 3. **Create GitHub Release** - release notes extracted from the `Version
199
+ X.Y.Z` section of `CHANGELOG.rst`
200
+
201
+ Each job depends on the one before it, so a failing check publishes nothing.
202
+
203
+ Watch it:
204
+
205
+ ```bash
206
+ gh run watch $(gh run list --workflow=release.yml --limit 1 --json databaseId --jq '.[0].databaseId')
207
+ ```
208
+
209
+ Then confirm the result:
210
+
211
+ ```bash
212
+ gh release view vX.Y.Z
213
+ pip index versions nwp500-python
214
+ ```
215
+
216
+ #### Do Not Publish By Hand
217
+
218
+ `make publish` and `make publish-test` still exist as an emergency fallback,
219
+ but a normal release must not use them. The workflow has already uploaded the
220
+ artifacts by the time you could, and PyPI refuses to accept a version twice -
221
+ so running them after a successful release fails, and running them before it
222
+ makes the workflow fail instead. Publishing is CI's job.
223
+
224
+ #### If the Release Fails After You Pushed the Tag
225
+
226
+ The tag is the trigger, so a failing pre-release check leaves a tag on the
227
+ remote pointing at a commit that was never released. Nothing was published -
228
+ the publish job is gated behind the checks - so the version number is still
229
+ free. Fix the problem, then move the tag:
230
+
231
+ ```bash
232
+ # after committing the fix and pushing main
233
+ git tag -d vX.Y.Z
234
+ git push origin :refs/tags/vX.Y.Z
235
+ git tag -a vX.Y.Z -m "Release version X.Y.Z"
236
+ git push origin vX.Y.Z
237
+ ```
238
+
239
+ Confirm first that nothing was published - if the publish job did succeed,
240
+ that version is gone for good and you need a new patch version instead:
241
+
242
+ ```bash
243
+ gh run view <run-id> --json jobs --jq '.jobs[] | "\(.name): \(.conclusion)"'
244
+ pip index versions nwp500-python
245
+ ```
246
+
247
+ ### 6. Building Locally (Optional)
248
+
249
+ Building locally is a sanity check, not part of publishing:
250
+
251
+ ```bash
252
+ make build
253
+ ```
254
+
255
+ This creates:
256
+ - `dist/nwp500_python-X.Y.Z.tar.gz` (source distribution)
257
+ - `dist/nwp500_python-X.Y.Z-py3-none-any.whl` (wheel)
258
+
259
+ The version comes from `git describe`, so building on an untagged commit
260
+ produces a development version like `9.3.1.dev3+g1a2b3c4` - that is expected,
261
+ and it is a quick way to confirm the tag you just created is what
262
+ `setuptools_scm` sees.
263
+
264
+ ## Using Tox
265
+
266
+ You can also use tox directly for all steps:
267
+
268
+ ```bash
269
+ # Run lint checks
270
+ tox -e lint
271
+
272
+ # Format code
273
+ tox -e format
274
+
275
+ # Run tests
276
+ tox
277
+
278
+ # Build package
279
+ tox -e build
280
+
281
+ # Clean artifacts
282
+ tox -e clean
283
+ ```
284
+
285
+ ## Ruff Configuration
286
+
287
+ Ruff is configured in `pyproject.toml` with the following rules:
288
+
289
+ - **Line length**: 88 characters (Black-compatible)
290
+ - **Target version**: Python 3.7+
291
+ - **Enabled rules**:
292
+ - `E`, `W`: pycodestyle errors and warnings
293
+ - `F`: Pyflakes
294
+ - `I`: isort (import sorting)
295
+ - `UP`: pyupgrade (Python version upgrades)
296
+ - `B`: flake8-bugbear (common bugs)
297
+ - `C4`: flake8-comprehensions
298
+ - `SIM`: flake8-simplify
299
+
300
+ ### Checking Specific Files
301
+
302
+ ```bash
303
+ # Check specific file
304
+ ruff check src/nwp500/auth.py
305
+
306
+ # Format specific file
307
+ ruff format src/nwp500/auth.py
308
+
309
+ # Check and fix specific directory
310
+ ruff check --fix src/nwp500/
311
+ ```
312
+
313
+ ## Troubleshooting
314
+
315
+ ### Linting Errors
316
+
317
+ If you encounter linting errors:
318
+
319
+ 1. Try auto-fixing: `make format`
320
+ 2. Review remaining errors: `make lint`
321
+ 3. Manually fix any errors that can't be auto-fixed
322
+ 4. Re-run checks: `make check-release`
323
+
324
+ ### Test Failures
325
+
326
+ If tests fail:
327
+
328
+ 1. Review the test output
329
+ 2. Fix the issues in the code
330
+ 3. Re-run tests: `make test`
331
+ 4. Ensure all tests pass before release
332
+
333
+ ### Build Errors
334
+
335
+ If build fails:
336
+
337
+ 1. Clean build artifacts: `make clean`
338
+ 2. Verify dependencies are installed: `pip install -e ".[dev]"`
339
+ 3. Try building again: `make build`
340
+
341
+ ## Pre-Release Checklist
342
+
343
+ Before releasing, ensure:
344
+
345
+ - [ ] Everything intended for the release is merged to `main`
346
+ - [ ] `CHANGELOG.rst` describes it all under `Unreleased`, with no
347
+ hand-written `Version X.Y.Z` heading
348
+ - [ ] All code is formatted: `make format`
349
+ - [ ] Linting passes: `make lint`
350
+ - [ ] All tests pass: `make test`
351
+ - [ ] Version configuration is valid: `make validate-version`
352
+ - [ ] Documentation is up to date
353
+ - [ ] Examples work correctly
354
+ - [ ] Working directory is clean and `main` is in sync with the remote
355
+ (the bump script enforces both)
356
+ - [ ] Build succeeds: `make build`
357
+
358
+ Then bump, push, and let the workflow publish - see
359
+ [The Release Runs Itself](#5-the-release-runs-itself).
360
+
361
+ ## Publishing Credentials
362
+
363
+ There are none to set up. The release workflow publishes through
364
+ [PyPI trusted publishing](https://docs.pypi.org/trusted-publishers/): PyPI is
365
+ configured to trust `release.yml` in this repository, and the job mints a
366
+ short-lived token through the `pypi` GitHub environment using its
367
+ `id-token: write` permission. No API token is stored in the repository, in
368
+ GitHub secrets, or on your machine.
369
+
370
+ `TWINE_USERNAME`/`TWINE_PASSWORD` and `~/.pypirc` are only relevant if you
371
+ ever need the emergency `make publish` fallback, which a normal release must
372
+ not use.
373
+
374
+ ## Continuous Integration
375
+
376
+ Two workflows already cover this:
377
+
378
+ **`.github/workflows/ci.yml`** - on pushes and pull requests:
379
+
380
+ | Job | What it does |
381
+ |-----|--------------|
382
+ | Lint and Format Check | `tox -e lint` (`ruff check` and `ruff format --check`) |
383
+ | Security Check | `ruff check --select S src/` |
384
+ | Test on Python 3.14 | `tox -e default` - pytest and pyright, with the `cli` and `testing` extras |
385
+ | Test without CLI extras | pytest against an `-e ".[testing]"` install, matching what `release.yml` does |
386
+ | Build Distribution | `python -m build` plus `twine check` |
387
+
388
+ **`.github/workflows/release.yml`** - on a `v*` tag: pre-release checks, then
389
+ build and publish to PyPI, then create the GitHub release.
390
+
391
+ `Test without CLI extras` exists because `tox` installs the `cli` extra while
392
+ `release.yml` does not. Without it, a test module that imports `click` outside
393
+ its `ImportError` guard passes every pull request and fails only once the
394
+ release tag has been pushed.
395
+
396
+ ## Quick Commands Reference
397
+
398
+ | Command | Description |
399
+ |---------|-------------|
400
+ | `make version-bump` | Bump version (requires BUMP=patch/minor/major/X.Y.Z) |
401
+ | `make help` | Show all available commands |
402
+ | `make install-dev` | Install with dev dependencies |
403
+ | `make format` | Format code with ruff |
404
+ | `make lint` | Check code with ruff |
405
+ | `make test` | Run tests |
406
+ | `make check-release` | Run all pre-release checks |
407
+ | `make release` | Full release build process |
408
+ | `make build` | Build distribution packages locally (CI builds what is published) |
409
+ | `make clean` | Remove build artifacts |
410
+ | `make publish-test` | Emergency fallback only - upload to TestPyPI by hand |
411
+ | `make publish` | Emergency fallback only - upload to PyPI by hand |
412
+
413
+ ## More Information
414
+
415
+ - [Ruff Documentation](https://docs.astral.sh/ruff/)
416
+ - [Python Packaging User Guide](https://packaging.python.org/)
417
+ - [Twine Documentation](https://twine.readthedocs.io/)
418
+ - [Semantic Versioning](https://semver.org/)