wexample-filestate-python 0.0.44__tar.gz → 0.0.45__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 (99) hide show
  1. wexample_filestate_python-0.0.45/PKG-INFO +141 -0
  2. wexample_filestate_python-0.0.45/README.md +118 -0
  3. {wexample_filestate_python-0.0.44 → wexample_filestate_python-0.0.45}/pyproject.toml +15 -3
  4. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python/config_option/mixin}/__init__.py +0 -0
  5. wexample_filestate_python-0.0.45/src/wexample_filestate_python/config_option/mixin/with_stdout_wrapping_mixin.py +46 -0
  6. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operations_provider → wexample_filestate_python-0.0.45/src/wexample_filestate_python/config_value}/__init__.py +0 -0
  7. wexample_filestate_python-0.0.45/src/wexample_filestate_python/config_value/python_config_value.py +195 -0
  8. wexample_filestate_python-0.0.45/src/wexample_filestate_python/helpers/__init__.py +0 -0
  9. wexample_filestate_python-0.0.45/src/wexample_filestate_python/helpers/__pycache__/__init__.py +0 -0
  10. {wexample_filestate_python-0.0.44 → wexample_filestate_python-0.0.45}/src/wexample_filestate_python/helpers/package.py +0 -19
  11. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/__init__.py +0 -0
  12. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/__pycache__/__init__.py +0 -0
  13. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/abstract_python_file_content_option.py +45 -0
  14. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_add_future_annotations_operation.py → wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/add_future_annotations_option.py +14 -40
  15. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_add_return_types_operation.py → wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/add_return_types_option.py +12 -32
  16. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/fix_attrs_option.py +37 -0
  17. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/fix_blank_lines_option.py +47 -0
  18. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/format_option.py +34 -0
  19. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/fstringify_option.py +34 -0
  20. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/modernize_typing_option.py +25 -0
  21. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_class_attributes_option.py +34 -0
  22. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_class_docstring_option.py +36 -0
  23. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_class_methods_option.py +37 -0
  24. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_constants_option.py +35 -0
  25. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_iterable_items_option.py +31 -0
  26. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_main_guard_option.py +44 -0
  27. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_module_docstring_operation.py → wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_module_docstring_option.py +18 -32
  28. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_module_functions_option.py +42 -0
  29. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_module_metadata_operation.py → wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_module_metadata_option.py +18 -32
  30. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/order_type_checking_block_option.py +51 -0
  31. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/python_option.py +164 -0
  32. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_relocate_imports_operation.py → wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/relocate_imports_option.py +32 -46
  33. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_remove_unused_imports_operation.py → wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/remove_unused_option.py +11 -27
  34. wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/sort_imports_option.py +26 -0
  35. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_unquote_annotations_operation.py → wexample_filestate_python-0.0.45/src/wexample_filestate_python/option/unquote_annotations_option.py +10 -26
  36. wexample_filestate_python-0.0.45/src/wexample_filestate_python/options_provider/__init__.py +0 -0
  37. wexample_filestate_python-0.0.45/src/wexample_filestate_python/options_provider/__pycache__/__init__.py +0 -0
  38. {wexample_filestate_python-0.0.44 → wexample_filestate_python-0.0.45}/src/wexample_filestate_python/options_provider/python_options_provider.py +3 -3
  39. wexample_filestate_python-0.0.45/src/wexample_filestate_python/py.typed +0 -0
  40. wexample_filestate_python-0.0.45/src/wexample_filestate_python/utils/__init__.py +0 -0
  41. wexample_filestate_python-0.0.45/src/wexample_filestate_python/utils/__pycache__/__init__.py +0 -0
  42. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_blank_lines_utils.py +51 -80
  43. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_class_attributes_utils.py +18 -4
  44. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_constants_utils.py +22 -19
  45. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_module_metadata_utils.py +2 -1
  46. wexample_filestate_python-0.0.45/src/wexample_filestate_python/utils/relocate_imports/__pycache__/__init__.py +0 -0
  47. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/relocate_imports/python_import_rewriter.py +14 -1
  48. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/relocate_imports/python_localize_runtime_imports.py +79 -4
  49. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/relocate_imports/python_parser_import_index.py +27 -1
  50. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/relocate_imports/python_usage_collector.py +59 -9
  51. wexample_filestate_python-0.0.45/src/wexample_filestate_python/workdir/__init__.py +0 -0
  52. wexample_filestate_python-0.0.45/src/wexample_filestate_python/workdir/__pycache__/__init__.py +0 -0
  53. wexample_filestate_python-0.0.45/tests/tests/__init__.py +0 -0
  54. wexample_filestate_python-0.0.45/tests/wexample_tests/__init__.py +0 -0
  55. wexample_filestate_python-0.0.44/PKG-INFO +0 -54
  56. wexample_filestate_python-0.0.44/README.md +0 -35
  57. wexample_filestate_python-0.0.44/src/wexample_filestate_python/config_option/python_config_option.py +0 -49
  58. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/abstract_python_file_operation.py +0 -84
  59. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_fix_attrs_operation.py +0 -53
  60. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_fix_blank_lines_operation.py +0 -62
  61. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_format_operation.py +0 -50
  62. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_fstringify_operation.py +0 -49
  63. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_modernize_typing_operation.py +0 -44
  64. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_class_attributes_operation.py +0 -50
  65. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_class_docstring_operation.py +0 -54
  66. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_class_methods_operation.py +0 -53
  67. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_constants_operation.py +0 -51
  68. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_iterable_items_operation.py +0 -48
  69. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_main_guard_operation.py +0 -58
  70. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_module_functions_operation.py +0 -58
  71. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_order_type_checking_block_operation.py +0 -65
  72. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/python_sort_imports_operation.py +0 -42
  73. wexample_filestate_python-0.0.44/src/wexample_filestate_python/operations_provider/python_operations_provider.py +0 -103
  74. {wexample_filestate_python-0.0.44 → wexample_filestate_python-0.0.45}/src/wexample_filestate_python/__init__.py +0 -0
  75. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/common → wexample_filestate_python-0.0.45/src/wexample_filestate_python/__pycache__}/__init__.py +0 -0
  76. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/config_option → wexample_filestate_python-0.0.45/src/wexample_filestate_python/common}/__init__.py +0 -0
  77. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/const → wexample_filestate_python-0.0.45/src/wexample_filestate_python/common/__pycache__}/__init__.py +0 -0
  78. {wexample_filestate_python-0.0.44 → wexample_filestate_python-0.0.45}/src/wexample_filestate_python/common/pipy_gateway.py +1 -1
  79. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/file → wexample_filestate_python-0.0.45/src/wexample_filestate_python/config_option}/__init__.py +0 -0
  80. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/helpers → wexample_filestate_python-0.0.45/src/wexample_filestate_python/config_option/__pycache__}/__init__.py +0 -0
  81. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation/utils → wexample_filestate_python-0.0.45/src/wexample_filestate_python/config_option/mixin/__pycache__}/__init__.py +0 -0
  82. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/options_provider → wexample_filestate_python-0.0.45/src/wexample_filestate_python/config_value/__pycache__}/__init__.py +0 -0
  83. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/workdir → wexample_filestate_python-0.0.45/src/wexample_filestate_python/const}/__init__.py +0 -0
  84. {wexample_filestate_python-0.0.44/tests/tests → wexample_filestate_python-0.0.45/src/wexample_filestate_python/const/__pycache__}/__init__.py +0 -0
  85. {wexample_filestate_python-0.0.44 → wexample_filestate_python-0.0.45}/src/wexample_filestate_python/const/name_pattern.py +0 -0
  86. {wexample_filestate_python-0.0.44/tests/wexample_tests → wexample_filestate_python-0.0.45/src/wexample_filestate_python/file}/__init__.py +0 -0
  87. /wexample_filestate_python-0.0.44/src/wexample_filestate_python/py.typed → /wexample_filestate_python-0.0.45/src/wexample_filestate_python/file/__pycache__/__init__.py +0 -0
  88. {wexample_filestate_python-0.0.44 → wexample_filestate_python-0.0.45}/src/wexample_filestate_python/file/python_file.py +0 -0
  89. {wexample_filestate_python-0.0.44 → wexample_filestate_python-0.0.45}/src/wexample_filestate_python/helpers/toml.py +0 -0
  90. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_attrs_utils.py +0 -0
  91. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_class_docstring_utils.py +0 -0
  92. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_class_methods_utils.py +0 -0
  93. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_docstring_utils.py +0 -0
  94. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_functions_utils.py +0 -0
  95. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_iterable_utils.py +0 -0
  96. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_main_guard_utils.py +0 -0
  97. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/python_type_checking_utils.py +0 -0
  98. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/relocate_imports/__init__.py +0 -0
  99. {wexample_filestate_python-0.0.44/src/wexample_filestate_python/operation → wexample_filestate_python-0.0.45/src/wexample_filestate_python}/utils/relocate_imports/python_runtime_symbol_collector.py +0 -0
@@ -0,0 +1,141 @@
1
+ Metadata-Version: 2.1
2
+ Name: wexample-filestate-python
3
+ Version: 0.0.45
4
+ Summary: Helpers for Python.
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-filestate-python
11
+ Requires-Python: >=3.10
12
+ Requires-Dist: attrs>=23.1.0
13
+ Requires-Dist: cattrs>=23.1.0
14
+ Requires-Dist: libcst
15
+ Requires-Dist: packaging
16
+ Requires-Dist: tomli
17
+ Requires-Dist: wexample-filestate==0.0.56
18
+ Requires-Dist: wexample-helpers-api==0.0.37
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest; extra == "dev"
21
+ Requires-Dist: pytest-cov; extra == "dev"
22
+ Description-Content-Type: text/markdown
23
+
24
+ # wexample-filestate-python
25
+
26
+ Version: 0.0.45
27
+
28
+ Helpers for Python.
29
+
30
+ ## Code Quality & Typing
31
+
32
+ All the suite packages follow strict quality standards:
33
+
34
+ - **Type hints**: Full type coverage with mypy validation
35
+ - **Code formatting**: Enforced with black and isort
36
+ - **Linting**: Comprehensive checks with custom scripts and tools
37
+ - **Testing**: High test coverage requirements
38
+
39
+ These standards ensure reliability and maintainability across the suite.
40
+
41
+ ## Versioning & Compatibility Policy
42
+
43
+ Wexample packages follow **Semantic Versioning** (SemVer):
44
+
45
+ - **MAJOR**: Breaking changes
46
+ - **MINOR**: New features, backward compatible
47
+ - **PATCH**: Bug fixes, backward compatible
48
+
49
+ We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
50
+
51
+ ## Changelog
52
+
53
+ See [CHANGELOG.md](CHANGELOG.md) for detailed version history and release notes.
54
+
55
+ Major changes are documented with migration guides when applicable.
56
+
57
+ ## Migration Notes
58
+
59
+ When upgrading between major versions, refer to the migration guides in the documentation.
60
+
61
+ Breaking changes are clearly documented with upgrade paths and examples.
62
+
63
+ ## Known Limitations & Roadmap
64
+
65
+ Current limitations and planned features are tracked in the GitHub issues.
66
+
67
+ See the [project roadmap](https://github.com/wexample/python-filestate-python/issues) for upcoming features and improvements.
68
+
69
+ ## Security Policy
70
+
71
+ ### Reporting Vulnerabilities
72
+
73
+ If you discover a security vulnerability, please email security@wexample.com.
74
+
75
+ **Do not** open public issues for security vulnerabilities.
76
+
77
+ We take security seriously and will respond promptly to verified reports.
78
+
79
+ ## Privacy & Telemetry
80
+
81
+ This package does **not** collect any telemetry or usage data.
82
+
83
+ Your privacy is respected — no data is transmitted to external services.
84
+
85
+ ## Support Channels
86
+
87
+ - **GitHub Issues**: Bug reports and feature requests
88
+ - **GitHub Discussions**: Questions and community support
89
+ - **Documentation**: Comprehensive guides and API reference
90
+ - **Email**: contact@wexample.com for general inquiries
91
+
92
+ Community support is available through GitHub Discussions.
93
+
94
+ ## Contribution Guidelines
95
+
96
+ We welcome contributions to the Wexample suite!
97
+
98
+ ### How to Contribute
99
+
100
+ 1. **Fork** the repository
101
+ 2. **Create** a feature branch
102
+ 3. **Make** your changes
103
+ 4. **Test** thoroughly
104
+ 5. **Submit** a pull request
105
+
106
+ ## Maintainers & Authors
107
+
108
+ Maintained by the Wexample team and community contributors.
109
+
110
+ See [CONTRIBUTORS.md](CONTRIBUTORS.md) for the full list of contributors.
111
+
112
+ ## License
113
+
114
+ MIT
115
+
116
+ ## Useful Links
117
+
118
+ - **Homepage**: https://github.com/wexample/python-filestate-python
119
+ - **Documentation**: [docs.wexample.com](https://docs.wexample.com)
120
+ - **Issue Tracker**: https://github.com/wexample/python-filestate-python/issues
121
+ - **Discussions**: https://github.com/wexample/python-filestate-python/discussions
122
+ - **PyPI**: [pypi.org/project/wexample-filestate-python](https://pypi.org/project/wexample-filestate-python/)
123
+
124
+ ## Integration in the Suite
125
+
126
+ This package is part of the **Wexample Suite** — a collection of high-quality Python packages designed to work seamlessly together.
127
+
128
+ ### Related Packages
129
+
130
+ 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.
131
+
132
+ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
133
+
134
+ # About us
135
+
136
+ 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.
137
+
138
+ 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.
139
+
140
+ 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.
141
+
@@ -0,0 +1,118 @@
1
+ # wexample-filestate-python
2
+
3
+ Version: 0.0.45
4
+
5
+ Helpers for Python.
6
+
7
+ ## Code Quality & Typing
8
+
9
+ All the suite packages follow strict quality standards:
10
+
11
+ - **Type hints**: Full type coverage with mypy validation
12
+ - **Code formatting**: Enforced with black and isort
13
+ - **Linting**: Comprehensive checks with custom scripts and tools
14
+ - **Testing**: High test coverage requirements
15
+
16
+ These standards ensure reliability and maintainability across the suite.
17
+
18
+ ## Versioning & Compatibility Policy
19
+
20
+ Wexample packages follow **Semantic Versioning** (SemVer):
21
+
22
+ - **MAJOR**: Breaking changes
23
+ - **MINOR**: New features, backward compatible
24
+ - **PATCH**: Bug fixes, backward compatible
25
+
26
+ We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.
27
+
28
+ ## Changelog
29
+
30
+ See [CHANGELOG.md](CHANGELOG.md) for detailed version history and release notes.
31
+
32
+ Major changes are documented with migration guides when applicable.
33
+
34
+ ## Migration Notes
35
+
36
+ When upgrading between major versions, refer to the migration guides in the documentation.
37
+
38
+ Breaking changes are clearly documented with upgrade paths and examples.
39
+
40
+ ## Known Limitations & Roadmap
41
+
42
+ Current limitations and planned features are tracked in the GitHub issues.
43
+
44
+ See the [project roadmap](https://github.com/wexample/python-filestate-python/issues) for upcoming features and improvements.
45
+
46
+ ## Security Policy
47
+
48
+ ### Reporting Vulnerabilities
49
+
50
+ If you discover a security vulnerability, please email security@wexample.com.
51
+
52
+ **Do not** open public issues for security vulnerabilities.
53
+
54
+ We take security seriously and will respond promptly to verified reports.
55
+
56
+ ## Privacy & Telemetry
57
+
58
+ This package does **not** collect any telemetry or usage data.
59
+
60
+ Your privacy is respected — no data is transmitted to external services.
61
+
62
+ ## Support Channels
63
+
64
+ - **GitHub Issues**: Bug reports and feature requests
65
+ - **GitHub Discussions**: Questions and community support
66
+ - **Documentation**: Comprehensive guides and API reference
67
+ - **Email**: contact@wexample.com for general inquiries
68
+
69
+ Community support is available through GitHub Discussions.
70
+
71
+ ## Contribution Guidelines
72
+
73
+ We welcome contributions to the Wexample suite!
74
+
75
+ ### How to Contribute
76
+
77
+ 1. **Fork** the repository
78
+ 2. **Create** a feature branch
79
+ 3. **Make** your changes
80
+ 4. **Test** thoroughly
81
+ 5. **Submit** a pull request
82
+
83
+ ## Maintainers & Authors
84
+
85
+ Maintained by the Wexample team and community contributors.
86
+
87
+ See [CONTRIBUTORS.md](CONTRIBUTORS.md) for the full list of contributors.
88
+
89
+ ## License
90
+
91
+ MIT
92
+
93
+ ## Useful Links
94
+
95
+ - **Homepage**: https://github.com/wexample/python-filestate-python
96
+ - **Documentation**: [docs.wexample.com](https://docs.wexample.com)
97
+ - **Issue Tracker**: https://github.com/wexample/python-filestate-python/issues
98
+ - **Discussions**: https://github.com/wexample/python-filestate-python/discussions
99
+ - **PyPI**: [pypi.org/project/wexample-filestate-python](https://pypi.org/project/wexample-filestate-python/)
100
+
101
+ ## Integration in the Suite
102
+
103
+ This package is part of the **Wexample Suite** — a collection of high-quality Python packages designed to work seamlessly together.
104
+
105
+ ### Related Packages
106
+
107
+ 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.
108
+
109
+ Visit the [Wexample Suite documentation](https://docs.wexample.com) for the complete package ecosystem.
110
+
111
+ # About us
112
+
113
+ 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.
114
+
115
+ 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.
116
+
117
+ 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.
118
+
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "wexample-filestate-python"
9
- version = "0.0.44"
9
+ version = "0.0.45"
10
10
  description = "Helpers for Python."
11
11
  authors = [
12
12
  { name = "weeger", email = "contact@wexample.com" },
@@ -20,8 +20,11 @@ classifiers = [
20
20
  dependencies = [
21
21
  "attrs>=23.1.0",
22
22
  "cattrs>=23.1.0",
23
- "wexample-filestate==0.0.54",
24
- "wexample-helpers-api==0.0.35",
23
+ "libcst",
24
+ "packaging",
25
+ "tomli",
26
+ "wexample-filestate==0.0.56",
27
+ "wexample-helpers-api==0.0.37",
25
28
  ]
26
29
 
27
30
  [project.readme]
@@ -37,6 +40,7 @@ homepage = "https://github.com/wexample/python-filestate-python"
37
40
  [project.optional-dependencies]
38
41
  dev = [
39
42
  "pytest",
43
+ "pytest-cov",
40
44
  ]
41
45
 
42
46
  [tool.pdm]
@@ -53,3 +57,11 @@ keep = [
53
57
  "black",
54
58
  "isort",
55
59
  ]
60
+
61
+ [tool.setuptools.packages.find]
62
+ include = [
63
+ "*",
64
+ ]
65
+ exclude = [
66
+ "wexample_filestate_python.testing*",
67
+ ]
@@ -0,0 +1,46 @@
1
+ from __future__ import annotations
2
+
3
+
4
+ class WithStdoutWrappingMixin:
5
+ @classmethod
6
+ def _execute_and_wrap_stdout(cls, callback):
7
+ """Execute a callback and wrap any stdout/stderr output with additional newlines.
8
+
9
+ This ensures that output from external tools doesn't interfere with progress indicators
10
+ by adding a newline after any captured output.
11
+
12
+ Args:
13
+ callback: Function to execute that may produce stdout/stderr output
14
+
15
+ Returns:
16
+ The return value of the callback function
17
+ """
18
+ import io
19
+ import sys
20
+
21
+ old_stdout = sys.stdout
22
+ old_stderr = sys.stderr
23
+ captured_stdout = io.StringIO()
24
+ captured_stderr = io.StringIO()
25
+ sys.stdout = captured_stdout
26
+ sys.stderr = captured_stderr
27
+
28
+ try:
29
+ result = callback()
30
+ finally:
31
+ sys.stdout = old_stdout
32
+ sys.stderr = old_stderr
33
+
34
+ stdout_content = captured_stdout.getvalue()
35
+ stderr_content = captured_stderr.getvalue()
36
+
37
+ if stdout_content.strip():
38
+ sys.stdout.write(stdout_content.rstrip())
39
+ sys.stdout.write("\n")
40
+ sys.stdout.write("\n")
41
+ if stderr_content.strip():
42
+ sys.stderr.write(stderr_content.rstrip())
43
+ sys.stderr.write("\n")
44
+ sys.stderr.write("\n")
45
+
46
+ return result
@@ -0,0 +1,195 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+
5
+ from wexample_config.config_value.config_value import ConfigValue
6
+ from wexample_helpers.classes.field import public_field
7
+ from wexample_helpers.decorator.base_class import base_class
8
+
9
+
10
+ @base_class
11
+ class PythonConfigValue(ConfigValue):
12
+ add_future_annotations: bool | None = public_field(
13
+ default=None,
14
+ description="Add `from __future__ import annotations`",
15
+ )
16
+ add_return_types: bool | None = public_field(
17
+ default=None,
18
+ description="Add return type annotations",
19
+ )
20
+ fix_attrs: bool | None = public_field(
21
+ default=None,
22
+ description="Fix attrs usage (ensure kw_only=True, etc.)",
23
+ )
24
+ fix_blank_lines: bool | None = public_field(
25
+ default=None,
26
+ description="Fix blank lines in Python files",
27
+ )
28
+ format: bool | None = public_field(
29
+ default=None,
30
+ description="Format Python code",
31
+ )
32
+ fstringify: bool | None = public_field(
33
+ default=None,
34
+ description="Convert string formatting to f-strings",
35
+ )
36
+ modernize_typing: bool | None = public_field(
37
+ default=None,
38
+ description="Modernize typing annotations",
39
+ )
40
+ order_class_attributes: bool | None = public_field(
41
+ default=None,
42
+ description="Sort class attributes: special first, then public A–Z, then private/protected A–Z",
43
+ )
44
+ order_class_docstring: bool | None = public_field(
45
+ default=None,
46
+ description="Ensure class docstring is first statement after header/decorators",
47
+ )
48
+ order_class_methods: bool | None = public_field(
49
+ default=None,
50
+ description="Order class methods (dunders sequence, class/staticmethods, properties, instances)",
51
+ )
52
+ order_constants: bool | None = public_field(
53
+ default=None,
54
+ description="Sort flagged UPPER_CASE constant blocks at module level",
55
+ )
56
+ order_iterable_items: bool | None = public_field(
57
+ default=None,
58
+ description="Sort items inside flagged iterable literals (lists/dicts)",
59
+ )
60
+ order_main_guard: bool | None = public_field(
61
+ default=None,
62
+ description="Ensure if __name__ == '__main__' block is at the very end",
63
+ )
64
+ order_module_docstring: bool | None = public_field(
65
+ default=None,
66
+ description="Order module docstring to be at the top of the file",
67
+ )
68
+ order_module_functions: bool | None = public_field(
69
+ default=None,
70
+ description="Order module-level functions (public A–Z, then private)",
71
+ )
72
+ order_module_metadata: bool | None = public_field(
73
+ default=None,
74
+ description="Group and sort module metadata at module level",
75
+ )
76
+ order_spacing: bool | None = public_field(
77
+ default=None,
78
+ description="Normalize blank lines between program structures (spacing rules)",
79
+ )
80
+ order_type_checking_block: bool | None = public_field(
81
+ default=None,
82
+ description="Move TYPE_CHECKING blocks to after regular imports",
83
+ )
84
+ raw: Any = public_field(
85
+ default=None, description="Disabled raw value for this config."
86
+ )
87
+ relocate_imports: bool | None = public_field(
88
+ default=None,
89
+ description="Relocate imports by usage (runtime-in-method, class property types, type-only)",
90
+ )
91
+ remove_unused: bool | None = public_field(
92
+ default=None,
93
+ description="Remove unused imports",
94
+ )
95
+ sort_imports: bool | None = public_field(
96
+ default=None,
97
+ description="Sort imports",
98
+ )
99
+ unquote_annotations: bool | None = public_field(
100
+ default=None,
101
+ description="Unquote annotations (remove string annotations)",
102
+ )
103
+
104
+ def to_option_raw_value(self) -> Any:
105
+ from wexample_filestate_python.config_option.add_future_annotations_config_option import (
106
+ AddFutureAnnotationsConfigOption,
107
+ )
108
+ from wexample_filestate_python.config_option.add_return_types_config_option import (
109
+ AddReturnTypesConfigOption,
110
+ )
111
+ from wexample_filestate_python.config_option.fix_attrs_config_option import (
112
+ FixAttrsConfigOption,
113
+ )
114
+ from wexample_filestate_python.config_option.fix_blank_lines_config_option import (
115
+ FixBlankLinesConfigOption,
116
+ )
117
+ from wexample_filestate_python.config_option.format_config_option import (
118
+ FormatConfigOption,
119
+ )
120
+ from wexample_filestate_python.config_option.fstringify_config_option import (
121
+ FstringifyConfigOption,
122
+ )
123
+ from wexample_filestate_python.config_option.modernize_typing_config_option import (
124
+ ModernizeTypingConfigOption,
125
+ )
126
+ from wexample_filestate_python.config_option.order_class_attributes_config_option import (
127
+ OrderClassAttributesConfigOption,
128
+ )
129
+ from wexample_filestate_python.config_option.order_class_docstring_config_option import (
130
+ OrderClassDocstringConfigOption,
131
+ )
132
+ from wexample_filestate_python.config_option.order_class_methods_config_option import (
133
+ OrderClassMethodsConfigOption,
134
+ )
135
+ from wexample_filestate_python.config_option.order_constants_config_option import (
136
+ OrderConstantsConfigOption,
137
+ )
138
+ from wexample_filestate_python.config_option.order_iterable_items_config_option import (
139
+ OrderIterableItemsConfigOption,
140
+ )
141
+ from wexample_filestate_python.config_option.order_main_guard_config_option import (
142
+ OrderMainGuardConfigOption,
143
+ )
144
+ from wexample_filestate_python.config_option.order_module_docstring_config_option import (
145
+ OrderModuleDocstringConfigOption,
146
+ )
147
+ from wexample_filestate_python.config_option.order_module_functions_config_option import (
148
+ OrderModuleFunctionsConfigOption,
149
+ )
150
+ from wexample_filestate_python.config_option.order_module_metadata_config_option import (
151
+ OrderModuleMetadataConfigOption,
152
+ )
153
+ from wexample_filestate_python.config_option.order_spacing_config_option import (
154
+ OrderSpacingConfigOption,
155
+ )
156
+ from wexample_filestate_python.config_option.order_type_checking_block_config_option import (
157
+ OrderTypeCheckingBlockConfigOption,
158
+ )
159
+ from wexample_filestate_python.config_option.relocate_imports_config_option import (
160
+ RelocateImportsConfigOption,
161
+ )
162
+ from wexample_filestate_python.config_option.remove_unused_config_option import (
163
+ RemoveUnusedConfigOption,
164
+ )
165
+ from wexample_filestate_python.config_option.sort_imports_config_option import (
166
+ SortImportsConfigOption,
167
+ )
168
+ from wexample_filestate_python.config_option.unquote_annotations_config_option import (
169
+ UnquoteAnnotationsConfigOption,
170
+ )
171
+
172
+ return {
173
+ AddFutureAnnotationsConfigOption.get_name(): self.add_future_annotations,
174
+ AddReturnTypesConfigOption.get_name(): self.add_return_types,
175
+ FixAttrsConfigOption.get_name(): self.fix_attrs,
176
+ FixBlankLinesConfigOption.get_name(): self.fix_blank_lines,
177
+ FormatConfigOption.get_name(): self.format,
178
+ FstringifyConfigOption.get_name(): self.fstringify,
179
+ ModernizeTypingConfigOption.get_name(): self.modernize_typing,
180
+ OrderClassAttributesConfigOption.get_name(): self.order_class_attributes,
181
+ OrderClassDocstringConfigOption.get_name(): self.order_class_docstring,
182
+ OrderClassMethodsConfigOption.get_name(): self.order_class_methods,
183
+ OrderConstantsConfigOption.get_name(): self.order_constants,
184
+ OrderIterableItemsConfigOption.get_name(): self.order_iterable_items,
185
+ OrderMainGuardConfigOption.get_name(): self.order_main_guard,
186
+ OrderModuleDocstringConfigOption.get_name(): self.order_module_docstring,
187
+ OrderModuleFunctionsConfigOption.get_name(): self.order_module_functions,
188
+ OrderModuleMetadataConfigOption.get_name(): self.order_module_metadata,
189
+ OrderSpacingConfigOption.get_name(): self.order_spacing,
190
+ OrderTypeCheckingBlockConfigOption.get_name(): self.order_type_checking_block,
191
+ RelocateImportsConfigOption.get_name(): self.relocate_imports,
192
+ RemoveUnusedConfigOption.get_name(): self.remove_unused,
193
+ SortImportsConfigOption.get_name(): self.sort_imports,
194
+ UnquoteAnnotationsConfigOption.get_name(): self.unquote_annotations,
195
+ }
@@ -70,25 +70,6 @@ def package_get_info(package_dir: Path) -> tuple[str, set[str]] | None:
70
70
  return name, set(deps)
71
71
 
72
72
 
73
- def package_list_sorted(root_dir: str | Path) -> list[str]:
74
- """
75
- Get a list of package names sorted by dependency order.
76
- """
77
- from wexample_filestate.helpers.dependencies import dependencies_sort
78
-
79
- dependencies = package_get_dependencies(root_dir)
80
- if not dependencies:
81
- return []
82
-
83
- # Convert dependencies dict to list for sorting
84
- packages = list(dependencies.keys())
85
-
86
- def get_deps(pkg: str) -> set[str]:
87
- return dependencies[pkg]
88
-
89
- return dependencies_sort(packages, get_deps)
90
-
91
-
92
73
  def package_normalize_name(val: str) -> str:
93
74
  import re as _re
94
75
 
@@ -0,0 +1,45 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Any
4
+
5
+ from wexample_config.config_option.abstract_config_option import AbstractConfigOption
6
+ from wexample_filestate.option.mixin.option_mixin import OptionMixin
7
+ from wexample_helpers.classes.abstract_method import abstract_method
8
+ from wexample_helpers.decorator.base_class import base_class
9
+
10
+ if TYPE_CHECKING:
11
+ from wexample_filestate.const.types_state_items import TargetFileOrDirectoryType
12
+
13
+
14
+ @base_class
15
+ class AbstractPythonFileContentOption(OptionMixin, AbstractConfigOption):
16
+ @staticmethod
17
+ def get_raw_value_allowed_type() -> Any:
18
+ return bool
19
+
20
+ def create_required_operation(
21
+ self, target: TargetFileOrDirectoryType
22
+ ) -> AbstractOperation | None:
23
+ from wexample_filestate.operation.file_write_operation import FileWriteOperation
24
+
25
+ """Create FileWriteOperation if add_future_annotations is enabled and needed."""
26
+ # Get current content
27
+ current_content = target.get_local_file().read()
28
+
29
+ # Apply add_future_annotations transformation
30
+ new_content = self._apply_content_change(target=target)
31
+
32
+ # If content changed, create FileWriteOperation
33
+ if new_content != current_content:
34
+ return FileWriteOperation(
35
+ option=self,
36
+ target=target,
37
+ content=new_content,
38
+ description=self.get_description(),
39
+ )
40
+
41
+ return None
42
+
43
+ @abstract_method
44
+ def _apply_content_change(self, target: TargetFileOrDirectoryType) -> None:
45
+ pass