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.
- pytola_dev-0.1.18/.gitignore +155 -0
- pytola_dev-0.1.18/PKG-INFO +9 -0
- pytola_dev-0.1.18/README.md +0 -0
- pytola_dev-0.1.18/pyproject.toml +180 -0
- pytola_dev-0.1.18/pytola_dev/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/__init__.py +11 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/cli.py +53 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/formatters/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/formatters/base.py +78 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/formatters/docstring.py +231 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/formatters/pyproject.py +916 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/logger.py +6 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/parsers/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/parsers/base.py +12 -0
- pytola_dev-0.1.18/pytola_dev/autofmt/parsers/module.py +86 -0
- pytola_dev-0.1.18/pytola_dev/bumpversion/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/bumpversion/cli.py +1404 -0
- pytola_dev-0.1.18/pytola_dev/bumpversion/tests/__init__.py +0 -0
- pytola_dev-0.1.18/pytola_dev/bumpversion/tests/test_bumpversion.py +929 -0
- pytola_dev-0.1.18/pytola_dev/checksum/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/checksum/cli.py +180 -0
- pytola_dev-0.1.18/pytola_dev/checksum/gui.py +1037 -0
- pytola_dev-0.1.18/pytola_dev/checksum/tests/__init__.py +0 -0
- pytola_dev-0.1.18/pytola_dev/checksum/tests/test_checksum.py +315 -0
- pytola_dev-0.1.18/pytola_dev/cleanbuild/__init__.py +7 -0
- pytola_dev-0.1.18/pytola_dev/cleanbuild/cli.py +174 -0
- pytola_dev-0.1.18/pytola_dev/cleanbuild/tests/__init__.py +0 -0
- pytola_dev-0.1.18/pytola_dev/cleanbuild/tests/test_cleanbuild.py +167 -0
- pytola_dev-0.1.18/pytola_dev/condasetup/__init__.py +7 -0
- pytola_dev-0.1.18/pytola_dev/condasetup/cli.py +170 -0
- pytola_dev-0.1.18/pytola_dev/condasetup/tests/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/condasetup/tests/test_condasetup.py +188 -0
- pytola_dev-0.1.18/pytola_dev/envtool/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/envtool/base.py +18 -0
- pytola_dev-0.1.18/pytola_dev/envtool/cli.py +84 -0
- pytola_dev-0.1.18/pytola_dev/envtool/python.py +180 -0
- pytola_dev-0.1.18/pytola_dev/envtool/rust.py +185 -0
- pytola_dev-0.1.18/pytola_dev/gittool/__init__.py +7 -0
- pytola_dev-0.1.18/pytola_dev/gittool/cli.py +778 -0
- pytola_dev-0.1.18/pytola_dev/gittool/tests/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/gittool/tests/test_gittool.py +468 -0
- pytola_dev-0.1.18/pytola_dev/makepython/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/makepython/_config.py +206 -0
- pytola_dev-0.1.18/pytola_dev/makepython/_tool_utils.py +29 -0
- pytola_dev-0.1.18/pytola_dev/makepython/cli.py +264 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/__init__.py +16 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/activate.py +92 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/build.py +76 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/clean.py +122 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/dist.py +92 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/doc.py +149 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/init.py +146 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/lint.py +75 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/publish.py +253 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/test.py +303 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/token.py +148 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/update.py +120 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/impl/version.py +139 -0
- pytola_dev-0.1.18/pytola_dev/makepython/commands/loader.py +120 -0
- pytola_dev-0.1.18/pytola_dev/makepython/core/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/makepython/core/cache.py +93 -0
- pytola_dev-0.1.18/pytola_dev/makepython/core/context.py +185 -0
- pytola_dev-0.1.18/pytola_dev/makepython/core/executor.py +273 -0
- pytola_dev-0.1.18/pytola_dev/makepython/core/factory.py +71 -0
- pytola_dev-0.1.18/pytola_dev/makepython/core/registry.py +178 -0
- pytola_dev-0.1.18/pytola_dev/makepython/interfaces/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/makepython/interfaces/command.py +82 -0
- pytola_dev-0.1.18/pytola_dev/makepython/interfaces/types.py +38 -0
- pytola_dev-0.1.18/pytola_dev/makepython/tests/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/makepython/tests/test_commands.py +157 -0
- pytola_dev-0.1.18/pytola_dev/piptool/__init__.py +5 -0
- pytola_dev-0.1.18/pytola_dev/piptool/cli.py +738 -0
- pytola_dev-0.1.18/pytola_dev/piptool/tests/__init__.py +0 -0
- pytola_dev-0.1.18/pytola_dev/piptool/tests/test_benchmark.py +137 -0
- pytola_dev-0.1.18/pytola_dev/piptool/tests/test_piptool.py +217 -0
- pytola_dev-0.1.18/pytola_dev/pymake/__init__.py +17 -0
- pytola_dev-0.1.18/pytola_dev/pymake/cli.py +104 -0
- pytola_dev-0.1.18/pytola_dev/pymake/commands.py +309 -0
- pytola_dev-0.1.18/pytola_dev/pypack/__init__.py +17 -0
- pytola_dev-0.1.18/pytola_dev/pypack/_logger.py +50 -0
- pytola_dev-0.1.18/pytola_dev/pypack/cli/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pypack/cli/main.py +293 -0
- pytola_dev-0.1.18/pytola_dev/pypack/components/__init__.py +21 -0
- pytola_dev-0.1.18/pytola_dev/pypack/components/archiver.py +1100 -0
- pytola_dev-0.1.18/pytola_dev/pypack/components/embedinstaller.py +766 -0
- pytola_dev-0.1.18/pytola_dev/pypack/components/libpacker.py +748 -0
- pytola_dev-0.1.18/pytola_dev/pypack/components/loader.py +1884 -0
- pytola_dev-0.1.18/pytola_dev/pypack/components/parser.py +49 -0
- pytola_dev-0.1.18/pytola_dev/pypack/components/sourcepacker.py +399 -0
- pytola_dev-0.1.18/pytola_dev/pypack/core/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pypack/core/cache.py +267 -0
- pytola_dev-0.1.18/pytola_dev/pypack/core/concurrent.py +303 -0
- pytola_dev-0.1.18/pytola_dev/pypack/core/config.py +100 -0
- pytola_dev-0.1.18/pytola_dev/pypack/core/constants.py +21 -0
- pytola_dev-0.1.18/pytola_dev/pypack/core/io.py +279 -0
- pytola_dev-0.1.18/pytola_dev/pypack/core/workflow.py +681 -0
- pytola_dev-0.1.18/pytola_dev/pypack/gui/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pypack/gui/main.py +901 -0
- pytola_dev-0.1.18/pytola_dev/pypack/gui/widgets/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pypack/gui/widgets/build_worker.py +253 -0
- pytola_dev-0.1.18/pytola_dev/pypack/gui/widgets/config_panel.py +249 -0
- pytola_dev-0.1.18/pytola_dev/pypack/gui/widgets/log_panel.py +79 -0
- pytola_dev-0.1.18/pytola_dev/pypack/models/__init__.py +13 -0
- pytola_dev-0.1.18/pytola_dev/pypack/models/dependency.py +91 -0
- pytola_dev-0.1.18/pytola_dev/pypack/models/entryfile.py +327 -0
- pytola_dev-0.1.18/pytola_dev/pypack/models/libcache.py +615 -0
- pytola_dev-0.1.18/pytola_dev/pypack/models/libdownloader.py +205 -0
- pytola_dev-0.1.18/pytola_dev/pypack/models/project.py +990 -0
- pytola_dev-0.1.18/pytola_dev/pypack/models/solution.py +378 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/__init__.py +0 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_archiver.py +234 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_archiver_benchmark.py +407 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_benchmark.py +98 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_colored_logs.py +78 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_embed_installer.py +2284 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_enhanced_debug.py +139 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_enhanced_dependency_detection.py +237 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_libpack_benchmark.py +674 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_loader.py +1104 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_loader_benchmark.py +61 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_loader_debug_enhancement.py +295 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_pack.py +147 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_parser_benchmark.py +826 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_performance.py +230 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_projectparse.py +848 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_pylibpack.py +1390 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_source_packer_benchmark.py +119 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_sourcepack.py +175 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tests/test_sourcepacker_functional.py +128 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tools/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tools/pyarchiver.py +112 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tools/pylibpack.py +149 -0
- pytola_dev-0.1.18/pytola_dev/pypack/tools/pyloadergen.py +56 -0
- pytola_dev-0.1.18/pytola_dev/pypack/translations/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pypack/translations/pypack.py +311 -0
- pytola_dev-0.1.18/pytola_dev/pypack/utils/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pypack/utils/validation.py +78 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/analyzer.py +611 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/cli.py +228 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/core.py +151 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/examples/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/examples/test_script.py +95 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/models.py +235 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/reporter.py +294 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/templates/report.html.j2 +1073 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_analyzer.py +389 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_cli.py +292 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_core.py +197 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_models.py +390 -0
- pytola_dev-0.1.18/pytola_dev/pyprofiler/tests/test_reporter.py +365 -0
- pytola_dev-0.1.18/pytola_dev/regexvalidate/__init__.py +5 -0
- pytola_dev-0.1.18/pytola_dev/regexvalidate/gui.py +668 -0
- pytola_dev-0.1.18/pytola_dev/regexvalidate/tests/__init__.py +0 -0
- pytola_dev-0.1.18/pytola_dev/regexvalidate/tests/test_benchmark.py +185 -0
- pytola_dev-0.1.18/pytola_dev/regexvalidate/tests/test_regexvalidate.py +251 -0
- pytola_dev-0.1.18/pytola_dev/reshack/__init__.py +9 -0
- pytola_dev-0.1.18/pytola_dev/reshack/cli.py +289 -0
- pytola_dev-0.1.18/pytola_dev/reshack/gui.py +55 -0
- pytola_dev-0.1.18/pytola_dev/reshack/models/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/reshack/models/file_utils.py +288 -0
- pytola_dev-0.1.18/pytola_dev/reshack/models/icon_handler.py +505 -0
- pytola_dev-0.1.18/pytola_dev/reshack/models/pe_parser.py +254 -0
- pytola_dev-0.1.18/pytola_dev/reshack/models/resource_manager.py +366 -0
- pytola_dev-0.1.18/pytola_dev/reshack/ui/__init__.py +1 -0
- pytola_dev-0.1.18/pytola_dev/reshack/ui/config.py +173 -0
- pytola_dev-0.1.18/pytola_dev/reshack/ui/main_window.py +550 -0
- pytola_dev-0.1.18/pytola_dev/reshack/ui/preview_widget.py +949 -0
- 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
|
|
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"}
|