pytola-dev 0.1.18__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 (171) hide show
  1. pytola_dev-0.1.18/.gitignore +155 -0
  2. pytola_dev-0.1.18/PKG-INFO +9 -0
  3. pytola_dev-0.1.18/README.md +0 -0
  4. pytola_dev-0.1.18/pyproject.toml +180 -0
  5. pytola_dev-0.1.18/pytola_dev/__init__.py +1 -0
  6. pytola_dev-0.1.18/pytola_dev/autofmt/__init__.py +11 -0
  7. pytola_dev-0.1.18/pytola_dev/autofmt/cli.py +53 -0
  8. pytola_dev-0.1.18/pytola_dev/autofmt/formatters/__init__.py +1 -0
  9. pytola_dev-0.1.18/pytola_dev/autofmt/formatters/base.py +78 -0
  10. pytola_dev-0.1.18/pytola_dev/autofmt/formatters/docstring.py +231 -0
  11. pytola_dev-0.1.18/pytola_dev/autofmt/formatters/pyproject.py +916 -0
  12. pytola_dev-0.1.18/pytola_dev/autofmt/logger.py +6 -0
  13. pytola_dev-0.1.18/pytola_dev/autofmt/parsers/__init__.py +1 -0
  14. pytola_dev-0.1.18/pytola_dev/autofmt/parsers/base.py +12 -0
  15. pytola_dev-0.1.18/pytola_dev/autofmt/parsers/module.py +86 -0
  16. pytola_dev-0.1.18/pytola_dev/bumpversion/__init__.py +1 -0
  17. pytola_dev-0.1.18/pytola_dev/bumpversion/cli.py +1404 -0
  18. pytola_dev-0.1.18/pytola_dev/bumpversion/tests/__init__.py +0 -0
  19. pytola_dev-0.1.18/pytola_dev/bumpversion/tests/test_bumpversion.py +929 -0
  20. pytola_dev-0.1.18/pytola_dev/checksum/__init__.py +1 -0
  21. pytola_dev-0.1.18/pytola_dev/checksum/cli.py +180 -0
  22. pytola_dev-0.1.18/pytola_dev/checksum/gui.py +1037 -0
  23. pytola_dev-0.1.18/pytola_dev/checksum/tests/__init__.py +0 -0
  24. pytola_dev-0.1.18/pytola_dev/checksum/tests/test_checksum.py +315 -0
  25. pytola_dev-0.1.18/pytola_dev/cleanbuild/__init__.py +7 -0
  26. pytola_dev-0.1.18/pytola_dev/cleanbuild/cli.py +174 -0
  27. pytola_dev-0.1.18/pytola_dev/cleanbuild/tests/__init__.py +0 -0
  28. pytola_dev-0.1.18/pytola_dev/cleanbuild/tests/test_cleanbuild.py +167 -0
  29. pytola_dev-0.1.18/pytola_dev/condasetup/__init__.py +7 -0
  30. pytola_dev-0.1.18/pytola_dev/condasetup/cli.py +170 -0
  31. pytola_dev-0.1.18/pytola_dev/condasetup/tests/__init__.py +1 -0
  32. pytola_dev-0.1.18/pytola_dev/condasetup/tests/test_condasetup.py +188 -0
  33. pytola_dev-0.1.18/pytola_dev/envtool/__init__.py +1 -0
  34. pytola_dev-0.1.18/pytola_dev/envtool/base.py +18 -0
  35. pytola_dev-0.1.18/pytola_dev/envtool/cli.py +84 -0
  36. pytola_dev-0.1.18/pytola_dev/envtool/python.py +180 -0
  37. pytola_dev-0.1.18/pytola_dev/envtool/rust.py +185 -0
  38. pytola_dev-0.1.18/pytola_dev/gittool/__init__.py +7 -0
  39. pytola_dev-0.1.18/pytola_dev/gittool/cli.py +778 -0
  40. pytola_dev-0.1.18/pytola_dev/gittool/tests/__init__.py +1 -0
  41. pytola_dev-0.1.18/pytola_dev/gittool/tests/test_gittool.py +468 -0
  42. pytola_dev-0.1.18/pytola_dev/makepython/__init__.py +1 -0
  43. pytola_dev-0.1.18/pytola_dev/makepython/_config.py +206 -0
  44. pytola_dev-0.1.18/pytola_dev/makepython/_tool_utils.py +29 -0
  45. pytola_dev-0.1.18/pytola_dev/makepython/cli.py +264 -0
  46. pytola_dev-0.1.18/pytola_dev/makepython/commands/__init__.py +16 -0
  47. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/__init__.py +1 -0
  48. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/activate.py +92 -0
  49. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/build.py +76 -0
  50. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/clean.py +122 -0
  51. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/dist.py +92 -0
  52. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/doc.py +149 -0
  53. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/init.py +146 -0
  54. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/lint.py +75 -0
  55. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/publish.py +253 -0
  56. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/test.py +303 -0
  57. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/token.py +148 -0
  58. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/update.py +120 -0
  59. pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/version.py +139 -0
  60. pytola_dev-0.1.18/pytola_dev/makepython/commands/loader.py +120 -0
  61. pytola_dev-0.1.18/pytola_dev/makepython/core/__init__.py +1 -0
  62. pytola_dev-0.1.18/pytola_dev/makepython/core/cache.py +93 -0
  63. pytola_dev-0.1.18/pytola_dev/makepython/core/context.py +185 -0
  64. pytola_dev-0.1.18/pytola_dev/makepython/core/executor.py +273 -0
  65. pytola_dev-0.1.18/pytola_dev/makepython/core/factory.py +71 -0
  66. pytola_dev-0.1.18/pytola_dev/makepython/core/registry.py +178 -0
  67. pytola_dev-0.1.18/pytola_dev/makepython/interfaces/__init__.py +1 -0
  68. pytola_dev-0.1.18/pytola_dev/makepython/interfaces/command.py +82 -0
  69. pytola_dev-0.1.18/pytola_dev/makepython/interfaces/types.py +38 -0
  70. pytola_dev-0.1.18/pytola_dev/makepython/tests/__init__.py +1 -0
  71. pytola_dev-0.1.18/pytola_dev/makepython/tests/test_commands.py +157 -0
  72. pytola_dev-0.1.18/pytola_dev/piptool/__init__.py +5 -0
  73. pytola_dev-0.1.18/pytola_dev/piptool/cli.py +738 -0
  74. pytola_dev-0.1.18/pytola_dev/piptool/tests/__init__.py +0 -0
  75. pytola_dev-0.1.18/pytola_dev/piptool/tests/test_benchmark.py +137 -0
  76. pytola_dev-0.1.18/pytola_dev/piptool/tests/test_piptool.py +217 -0
  77. pytola_dev-0.1.18/pytola_dev/pymake/__init__.py +17 -0
  78. pytola_dev-0.1.18/pytola_dev/pymake/cli.py +104 -0
  79. pytola_dev-0.1.18/pytola_dev/pymake/commands.py +309 -0
  80. pytola_dev-0.1.18/pytola_dev/pypack/__init__.py +17 -0
  81. pytola_dev-0.1.18/pytola_dev/pypack/_logger.py +50 -0
  82. pytola_dev-0.1.18/pytola_dev/pypack/cli/__init__.py +1 -0
  83. pytola_dev-0.1.18/pytola_dev/pypack/cli/main.py +293 -0
  84. pytola_dev-0.1.18/pytola_dev/pypack/components/__init__.py +21 -0
  85. pytola_dev-0.1.18/pytola_dev/pypack/components/archiver.py +1100 -0
  86. pytola_dev-0.1.18/pytola_dev/pypack/components/embedinstaller.py +766 -0
  87. pytola_dev-0.1.18/pytola_dev/pypack/components/libpacker.py +748 -0
  88. pytola_dev-0.1.18/pytola_dev/pypack/components/loader.py +1884 -0
  89. pytola_dev-0.1.18/pytola_dev/pypack/components/parser.py +49 -0
  90. pytola_dev-0.1.18/pytola_dev/pypack/components/sourcepacker.py +399 -0
  91. pytola_dev-0.1.18/pytola_dev/pypack/core/__init__.py +1 -0
  92. pytola_dev-0.1.18/pytola_dev/pypack/core/cache.py +267 -0
  93. pytola_dev-0.1.18/pytola_dev/pypack/core/concurrent.py +303 -0
  94. pytola_dev-0.1.18/pytola_dev/pypack/core/config.py +100 -0
  95. pytola_dev-0.1.18/pytola_dev/pypack/core/constants.py +21 -0
  96. pytola_dev-0.1.18/pytola_dev/pypack/core/io.py +279 -0
  97. pytola_dev-0.1.18/pytola_dev/pypack/core/workflow.py +681 -0
  98. pytola_dev-0.1.18/pytola_dev/pypack/gui/__init__.py +1 -0
  99. pytola_dev-0.1.18/pytola_dev/pypack/gui/main.py +901 -0
  100. pytola_dev-0.1.18/pytola_dev/pypack/gui/widgets/__init__.py +1 -0
  101. pytola_dev-0.1.18/pytola_dev/pypack/gui/widgets/build_worker.py +253 -0
  102. pytola_dev-0.1.18/pytola_dev/pypack/gui/widgets/config_panel.py +249 -0
  103. pytola_dev-0.1.18/pytola_dev/pypack/gui/widgets/log_panel.py +79 -0
  104. pytola_dev-0.1.18/pytola_dev/pypack/models/__init__.py +13 -0
  105. pytola_dev-0.1.18/pytola_dev/pypack/models/dependency.py +91 -0
  106. pytola_dev-0.1.18/pytola_dev/pypack/models/entryfile.py +327 -0
  107. pytola_dev-0.1.18/pytola_dev/pypack/models/libcache.py +615 -0
  108. pytola_dev-0.1.18/pytola_dev/pypack/models/libdownloader.py +205 -0
  109. pytola_dev-0.1.18/pytola_dev/pypack/models/project.py +990 -0
  110. pytola_dev-0.1.18/pytola_dev/pypack/models/solution.py +378 -0
  111. pytola_dev-0.1.18/pytola_dev/pypack/tests/__init__.py +0 -0
  112. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_archiver.py +234 -0
  113. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_archiver_benchmark.py +407 -0
  114. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_benchmark.py +98 -0
  115. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_colored_logs.py +78 -0
  116. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_embed_installer.py +2284 -0
  117. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_enhanced_debug.py +139 -0
  118. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_enhanced_dependency_detection.py +237 -0
  119. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_libpack_benchmark.py +674 -0
  120. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_loader.py +1104 -0
  121. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_loader_benchmark.py +61 -0
  122. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_loader_debug_enhancement.py +295 -0
  123. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_pack.py +147 -0
  124. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_parser_benchmark.py +826 -0
  125. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_performance.py +230 -0
  126. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_projectparse.py +848 -0
  127. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_pylibpack.py +1390 -0
  128. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_source_packer_benchmark.py +119 -0
  129. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_sourcepack.py +175 -0
  130. pytola_dev-0.1.18/pytola_dev/pypack/tests/test_sourcepacker_functional.py +128 -0
  131. pytola_dev-0.1.18/pytola_dev/pypack/tools/__init__.py +1 -0
  132. pytola_dev-0.1.18/pytola_dev/pypack/tools/pyarchiver.py +112 -0
  133. pytola_dev-0.1.18/pytola_dev/pypack/tools/pylibpack.py +149 -0
  134. pytola_dev-0.1.18/pytola_dev/pypack/tools/pyloadergen.py +56 -0
  135. pytola_dev-0.1.18/pytola_dev/pypack/translations/__init__.py +1 -0
  136. pytola_dev-0.1.18/pytola_dev/pypack/translations/pypack.py +311 -0
  137. pytola_dev-0.1.18/pytola_dev/pypack/utils/__init__.py +1 -0
  138. pytola_dev-0.1.18/pytola_dev/pypack/utils/validation.py +78 -0
  139. pytola_dev-0.1.18/pytola_dev/pyprofiler/__init__.py +1 -0
  140. pytola_dev-0.1.18/pytola_dev/pyprofiler/analyzer.py +611 -0
  141. pytola_dev-0.1.18/pytola_dev/pyprofiler/cli.py +228 -0
  142. pytola_dev-0.1.18/pytola_dev/pyprofiler/core.py +151 -0
  143. pytola_dev-0.1.18/pytola_dev/pyprofiler/examples/__init__.py +1 -0
  144. pytola_dev-0.1.18/pytola_dev/pyprofiler/examples/test_script.py +95 -0
  145. pytola_dev-0.1.18/pytola_dev/pyprofiler/models.py +235 -0
  146. pytola_dev-0.1.18/pytola_dev/pyprofiler/reporter.py +294 -0
  147. pytola_dev-0.1.18/pytola_dev/pyprofiler/templates/report.html.j2 +1073 -0
  148. pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/__init__.py +1 -0
  149. pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_analyzer.py +389 -0
  150. pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_cli.py +292 -0
  151. pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_core.py +197 -0
  152. pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_models.py +390 -0
  153. pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_reporter.py +365 -0
  154. pytola_dev-0.1.18/pytola_dev/regexvalidate/__init__.py +5 -0
  155. pytola_dev-0.1.18/pytola_dev/regexvalidate/gui.py +668 -0
  156. pytola_dev-0.1.18/pytola_dev/regexvalidate/tests/__init__.py +0 -0
  157. pytola_dev-0.1.18/pytola_dev/regexvalidate/tests/test_benchmark.py +185 -0
  158. pytola_dev-0.1.18/pytola_dev/regexvalidate/tests/test_regexvalidate.py +251 -0
  159. pytola_dev-0.1.18/pytola_dev/reshack/__init__.py +9 -0
  160. pytola_dev-0.1.18/pytola_dev/reshack/cli.py +289 -0
  161. pytola_dev-0.1.18/pytola_dev/reshack/gui.py +55 -0
  162. pytola_dev-0.1.18/pytola_dev/reshack/models/__init__.py +1 -0
  163. pytola_dev-0.1.18/pytola_dev/reshack/models/file_utils.py +288 -0
  164. pytola_dev-0.1.18/pytola_dev/reshack/models/icon_handler.py +505 -0
  165. pytola_dev-0.1.18/pytola_dev/reshack/models/pe_parser.py +254 -0
  166. pytola_dev-0.1.18/pytola_dev/reshack/models/resource_manager.py +366 -0
  167. pytola_dev-0.1.18/pytola_dev/reshack/ui/__init__.py +1 -0
  168. pytola_dev-0.1.18/pytola_dev/reshack/ui/config.py +173 -0
  169. pytola_dev-0.1.18/pytola_dev/reshack/ui/main_window.py +550 -0
  170. pytola_dev-0.1.18/pytola_dev/reshack/ui/preview_widget.py +949 -0
  171. pytola_dev-0.1.18/pytola_dev/reshack/ui/resource_view.py +478 -0
@@ -0,0 +1,155 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .pytest_cache/
51
+ cover/
52
+
53
+ # Translations
54
+ *.mo
55
+ *.pot
56
+
57
+ # Django stuff:
58
+ *.log
59
+ local_settings.py
60
+ db.sqlite3
61
+ db.sqlite3-journal
62
+
63
+ # Flask stuff:
64
+ instance/
65
+ .webassets-cache
66
+
67
+ # Scrapy stuff:
68
+ .scrapy
69
+
70
+ # Sphinx documentation
71
+ docs/_build/
72
+
73
+ # PyBuilder
74
+ .pybuilder/
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # idea
85
+ .idea
86
+
87
+ # pyenv
88
+ # For a library or package, you might want to ignore these files since the code is
89
+ # intended to run in multiple environments; otherwise, check them in:
90
+ # .python-version
91
+
92
+ # pipenv
93
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
95
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
96
+ # install all needed dependencies.
97
+ #Pipfile.lock
98
+
99
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
100
+ __pypackages__/
101
+
102
+ # Celery stuff
103
+ celerybeat-schedule
104
+ celerybeat.pid
105
+
106
+ # SageMath parsed files
107
+ *.sage.py
108
+
109
+ # Environments
110
+ .env
111
+ .venv
112
+ env/
113
+ venv/
114
+ ENV/
115
+ env.bak/
116
+ venv.bak/
117
+
118
+ # Spyder project settings
119
+ .spyderproject
120
+ .spyproject
121
+
122
+ # Rope project settings
123
+ .ropeproject
124
+
125
+ # mkdocs documentation
126
+ /site
127
+
128
+ # mypy
129
+ .mypy_cache/
130
+ .dmypy.json
131
+ dmypy.json
132
+
133
+ # poetry
134
+ poetry.lock
135
+
136
+ # uv
137
+ uv.lock
138
+
139
+ # Pyre type checker
140
+ .pyre/
141
+
142
+ # pytype static type analyzer
143
+ .pytype/
144
+
145
+ # Cython debug symbols
146
+ cython_debug/
147
+
148
+
149
+ # Added by cargo
150
+
151
+ /target
152
+ Cargo.lock
153
+ projects.json
154
+ .cbuild
155
+ *.backup
@@ -0,0 +1,9 @@
1
+ Metadata-Version: 2.4
2
+ Name: pytola-dev
3
+ Version: 0.1.18
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.8
6
+ Requires-Dist: jinja2>=3.0
7
+ Requires-Dist: pefile>=2024.8.26
8
+ Requires-Dist: pillow>=10.4.0
9
+ Requires-Dist: tomli-w>=1.0.0
File without changes
@@ -0,0 +1,180 @@
1
+ [tool.hatch.build.targets.wheel]
2
+ exclude = [
3
+ "pytola_dev/**/README.md",
4
+ "pytola_dev/**/dist",
5
+ "pytola_dev/**/pyproject.toml",
6
+ "pytola_dev/**/tests",
7
+ ]
8
+ packages = ["pytola_dev"]
9
+ [tool.hatch.build]
10
+ include = ["pytola_dev/**/*.py", "pytola_dev/**/templates/**"]
11
+
12
+ [project]
13
+ dependencies = [
14
+ "jinja2>=3.0",
15
+ "pefile>=2024.8.26",
16
+ "pillow>=10.4.0",
17
+ "tomli-w>=1.0.0",
18
+ ]
19
+ description = "Add your description here"
20
+ name = "pytola-dev"
21
+ readme = "README.md"
22
+ requires-python = ">=3.8"
23
+ version = "0.1.18"
24
+
25
+ [project.scripts]
26
+ autofmt = "pytola_dev.autofmt.cli:main"
27
+ bumpversion = "pytola_dev.bumpversion.cli:main"
28
+ checksum = "pytola_dev.checksum.gui:main"
29
+ checksumc = "pytola_dev.checksum.cli:main"
30
+ cleanbuild = "pytola_dev.cleanbuild:main"
31
+ condasetup = "pytola_dev.condasetup:main"
32
+ envt = "pytola_dev.envtool.cli:main"
33
+ gitt = "pytola_dev.gittool.cli:main"
34
+ mkp = "pytola_dev.makepython.cli:main"
35
+ pipt = "pytola_dev.piptool:main"
36
+ pylibpack = "pytola_dev.pypack.tools.pylibpack:main"
37
+ pyloadergen = "pytola_dev.pypack.tools.pyloadergen:main"
38
+ pymake = "pytola_dev.pymake.cli:main"
39
+ pyp = "pytola_dev.pypack:main"
40
+ pypack = "pytola_dev.pypack:gui_main"
41
+ pyparse = "pytola_dev.pypack.components.parser:main"
42
+ pyprof = "pytola_dev.pyprofiler.cli:main"
43
+ regval = "pytola_dev.regexvalidate:main"
44
+ reshack = "pytola_dev.reshack:gui_main"
45
+ reshackc = "pytola_dev.reshack:main"
46
+
47
+ [build-system]
48
+ build-backend = "hatchling.build"
49
+ requires = ["hatchling"]
50
+ # ------------------------ ruff ------------------------- #
51
+ [tool.ruff]
52
+ exclude = ["**/*_rc.py", "**/ui_*.py", "docs/**/*.py"]
53
+ line-length = 120
54
+ preview = true
55
+ target-version = "py38"
56
+ unsafe-fixes = true
57
+
58
+ [tool.ruff.lint]
59
+ # See list of rules at: https://docs.astral.sh/ruff/rules/
60
+ select = [
61
+ "A",
62
+ "AIR",
63
+ "ANN",
64
+ "ARG",
65
+ "ASYNC",
66
+ "B",
67
+ "BLE",
68
+ "C",
69
+ "C4",
70
+ "C90",
71
+ "COM",
72
+ "D",
73
+ "DJ",
74
+ "DOC",
75
+ "DTZ",
76
+ "E",
77
+ "EM",
78
+ "ERA",
79
+ "EXE",
80
+ "F",
81
+ "FA",
82
+ "FAST",
83
+ "FBT",
84
+ "FIX",
85
+ "FLY",
86
+ "FURB",
87
+ "I",
88
+ "ICN",
89
+ "INP",
90
+ "INT",
91
+ "ISC",
92
+ "LOG",
93
+ "N",
94
+ "NPY",
95
+ "PD",
96
+ "PERF",
97
+ "PGH",
98
+ "PIE",
99
+ "PL",
100
+ "PT",
101
+ "PTH",
102
+ "PYI",
103
+ "Q",
104
+ "RET",
105
+ "RSE",
106
+ "RUF",
107
+ "SIM",
108
+ "SLF",
109
+ "SLOT",
110
+ "T10",
111
+ "T20",
112
+ "TD",
113
+ "TID",
114
+ "TRY",
115
+ "UP",
116
+ "W",
117
+ "YTT",
118
+ ]
119
+
120
+ ignore = [
121
+ "ARG001",
122
+ "D100",
123
+ "D103",
124
+ "D104",
125
+ "D107",
126
+ "D203",
127
+ "DOC201",
128
+ "DOC501",
129
+ "FBT003",
130
+ "N802",
131
+ "PGH003",
132
+ "PIE",
133
+ "PLC0415",
134
+ "PLR0904",
135
+ "PLR0913",
136
+ "PLR0915",
137
+ "PLR6301",
138
+ "RUF002",
139
+ "RUF003",
140
+ "UP006",
141
+ "UP045",
142
+ ]
143
+
144
+ [tool.ruff.lint.per-file-ignores]
145
+ "**/*gui*.py" = ["N802", "N803", "N806"] # Allow Qt naming conventions
146
+ "**/gui/**" = ["N802", "N803", "N806"] # Allow Qt naming conventions
147
+ "**/tests/**" = [
148
+ "ANN",
149
+ "ARG",
150
+ "D1",
151
+ "DOC",
152
+ "FBT",
153
+ "PLC0415",
154
+ "PLR2004",
155
+ "PLR6301",
156
+ "SLF",
157
+ ] # Do not require documentation for tests.
158
+ "**/ui/**" = ["N802", "N803", "N806"] # Allow Qt naming conventions
159
+ "**/views/**" = ["N802", "N803", "N806"] # Allow Qt naming conventions
160
+
161
+ [tool.ruff.lint.pycodestyle]
162
+ max-doc-length = 100
163
+
164
+ [tool.ruff.lint.pydocstyle]
165
+ convention = "numpy"
166
+
167
+ # ------------------------ pytest ------------------------- #
168
+ [tool.pytest.ini_options]
169
+ addopts = ["--tb=short", "-m not benchmark", "-v"]
170
+ asyncio_default_fixture_loop_scope = "function"
171
+ asyncio_mode = "auto"
172
+ filterwarnings = ["ignore::DeprecationWarning"]
173
+ markers = [
174
+ "benchmark: marks tests as performance benchmarks",
175
+ "slow: marks tests as slow-running (for stress testing and large-scale operations)",
176
+ ]
177
+ python_classes = ["Test*"]
178
+ python_files = ["test_*.py"]
179
+ python_functions = ["test_*"]
180
+ testpaths = ["."]
@@ -0,0 +1 @@
1
+ """Development tools and utilities."""
@@ -0,0 +1,11 @@
1
+ """Autofmt pytola-dev tools."""
2
+
3
+ from .formatters.base import BaseFormatter
4
+ from .formatters.docstring import DocstringFormatter
5
+ from .formatters.pyproject import PyProjectFormatter
6
+
7
+ __all__ = [
8
+ "BaseFormatter",
9
+ "DocstringFormatter",
10
+ "PyProjectFormatter",
11
+ ]
@@ -0,0 +1,53 @@
1
+ """Command-line interface for autofmt."""
2
+
3
+ import argparse
4
+ import logging
5
+ from pathlib import Path
6
+
7
+ from pytola_core.registry import DefaultRegistry
8
+
9
+ from .logger import logger
10
+
11
+
12
+ def parse_args() -> argparse.Namespace:
13
+ """Parse command-line arguments.
14
+
15
+ Returns
16
+ -------
17
+ argparse.Namespace: Parsed command-line arguments namespace
18
+ """
19
+ parser = argparse.ArgumentParser(description="Pytola autofmt tool")
20
+ parser.add_argument("root_dir", type=Path, default=Path.cwd(), nargs="?", help="Root directory to run autofmt on")
21
+ parser.add_argument("--list", "-l", action="store_true", help="List all available actions")
22
+ parser.add_argument("--verbose", "-v", action="store_true", help="Enable verbose output")
23
+ parser.add_argument("--dry-run", "-D", action="store_true", help="Enable dry run mode")
24
+ parser.add_argument("--check", "-C", action="store_true", help="Enable check mode")
25
+
26
+ return parser.parse_args()
27
+
28
+
29
+ def main() -> None:
30
+ """Run the autofmt tool."""
31
+ args = parse_args()
32
+
33
+ if args.verbose:
34
+ logger.setLevel(logging.DEBUG)
35
+
36
+ if not args.root_dir.exists():
37
+ logger.error(f"Root directory {args.root_dir} does not exist")
38
+ return
39
+
40
+ action_registry = DefaultRegistry.get_instance()
41
+
42
+ if args.list:
43
+ logger.info("Available actions:")
44
+ actions = action_registry.list_all()
45
+ for action in actions:
46
+ logger.info(f" - {action}")
47
+ else:
48
+ logger.info("Executing default action...")
49
+ classes = action_registry.get_classes()
50
+ for klass in classes:
51
+ logger.info(f"Executing {klass.__name__}...")
52
+ class_instance = klass(root_dir=args.root_dir, check_only=args.check, dry_run=args.dry_run)
53
+ class_instance.run()
@@ -0,0 +1 @@
1
+ """Tools pytola-dev tools."""
@@ -0,0 +1,78 @@
1
+ """Base module for formatters."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from abc import ABC, abstractmethod
6
+ from functools import cached_property
7
+ from pathlib import Path
8
+
9
+ # 需要跳过的文件夹
10
+ SKIP_FOLDERS: set[str] = {"__pycache__", "dist", "build", ".venv", "venv", "env", ".env", "tests"}
11
+
12
+
13
+ def check_exclude_folder(file_path: Path, excludes: set[str] | None = None) -> bool:
14
+ """Check if a file is excluded based on its name or parent directories.
15
+
16
+ Args:
17
+ file_path: Path of the file to check
18
+ exclude_dirs: Directories to exclude from search
19
+
20
+ Returns
21
+ -------
22
+ True if the file is excluded, False otherwise
23
+
24
+ Examples
25
+ --------
26
+ >>> check_exclude_folder(Path("path/to/file.py"))
27
+ False
28
+ >>> check_exclude_folder(Path("path/to/__file.py"))
29
+ False
30
+ >>> check_exclude_folder(Path("path/to/__init__.py"))
31
+ False
32
+ >>> check_exclude_folder(Path("path/to/file.py"), excludes={"path/to"})
33
+ False
34
+ >>> check_exclude_folder(Path("path/build/file.py"), excludes={"build"})
35
+ True
36
+ """
37
+ # 快速检查:文件名是否以 . 开头(隐藏文件),但不是 __init__.py
38
+ if excludes is None:
39
+ excludes = SKIP_FOLDERS
40
+
41
+ if file_path.name.startswith(".") and file_path.name != "__init__.py":
42
+ return True
43
+
44
+ # 检查路径中是否包含排除的目录
45
+ return any(part in excludes for part in file_path.parts)
46
+
47
+
48
+ class BaseFormatter(ABC):
49
+ """Base class for auto-formatting tools."""
50
+
51
+ def __init__(self, root_dir: Path | None = None, *, check_only: bool = False, dry_run: bool = True) -> None:
52
+ self.root_dir = root_dir or Path.cwd()
53
+ self.check_only = check_only
54
+ self.dry_run = dry_run
55
+
56
+ @abstractmethod
57
+ def run(self, *, dry_run: bool = True, check_only: bool = False) -> bool:
58
+ """Run the formatter on all Python files.
59
+
60
+ Args:
61
+ dry_run: If True, only report changes without writing
62
+ check_only: If True, only check if conversion is needed
63
+
64
+ Returns
65
+ -------
66
+ True if successful, False otherwise
67
+ """
68
+
69
+ @cached_property
70
+ def python_files(self) -> set[Path]:
71
+ """Get a set of Python files in the root directory, excluding certain folders."""
72
+ py_files = self.root_dir.rglob("*.py")
73
+ return {py_file for py_file in py_files if not check_exclude_folder(py_file)}
74
+
75
+ @cached_property
76
+ def init_files(self) -> set[Path]:
77
+ """Get a set of __init__.py files in the root directory, excluding certain folders."""
78
+ return {f for f in self.python_files if f.name == "__init__.py"}