-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
181 lines (159 loc) · 4.85 KB
/
pyproject.toml
File metadata and controls
181 lines (159 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
[project]
name = "scriptize"
version = "0.1.0"
description = "Improve maintainability, readability, and efficiency of your scripts by standardize your scripting environment."
authors = [
{name = "Jonathan T. da Silva",email = "jonathantosilva@hotmail.com"}
]
license = {text = "LICENSE"}
readme = "README.md"
requires-python = ">=3.13,<4.0"
dependencies = [
]
[tool.poetry]
package-mode = true
packages = [{include = "scriptize", from = "."}]
include = ["src/scriptize/assets/**/*"]
[tool.poetry.dependencies]
typer = {extras = ["all"], version = "^0.16.0"} # typer = "^0.16.0"
rich = "^14.0.0"
validators = "^0.35.0"
# This creates the `scriptize` command in the user's PATH
# It points to the `app` object inside the `src/scriptize/main.py` file
[tool.poetry.scripts]
scriptize = "scriptize.main:app"
[tool.poetry.group.dev.dependencies]
pytest = "^8.4.1"
pytest-cov = "^6.2.1"
ruff = "^0.12.1"
taskipy = "^1.14.1"
mypy = "^1.16.1"
pydantic = "^2.11.7"
pre-commit = "^4.2.0"
allure-pytest = "^2.15.0"
isort = "^5.13.2"
[tool.poetry.group.doc.dependencies]
mkdocs = "^1.6.1"
mkdocs-material = "^9.6.15"
mkdocstrings = "^0.29.1"
mkdocstrings-python = "^1.16.12"
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
line-length = 100
indent-width = 4
target-version = "py313"
[tool.ruff.lint]
select = ["ALL"]
# Putting an entry in `ignore` will ignore all errors that start with that string.
# For example, adding `T` will ignore all errors beginning with `T`,
# whereas adding `T20` will only ignore the `T20` error
# (and probably any errors that start with `T20`)
ignore = [
'Q000',
'Q003',
'COM812',
'FIX002',
'TD003',
]
fixable = ["ALL"] # ['A', 'B', 'C', 'D', 'E', 'F', 'Q']
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"
# I like the google docstyle
# See https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
# and http://google.github.io/styleguide/pyguide.html
# https://gist.github.com/redlotus/3bc387c2591e3e908c9b63b97b11d24e
[tool.ruff.lint.pydocstyle]
convention = 'google' # Or 'numpy', or 'pep257'
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.pytest.ini_options]
pythonpath = [
".", "scriptize",
]
addopts = "--doctest-modules"
[tool.taskipy.tasks]
# MAIN COMMANDS
test = "poetry run task _check && poetry run task _pytest_local"
site = "poetry run task _build_site && echo 'Site built successfully! Run `poetry run task serve` to preview.' || echo 'Site build failed. Run `poetry run task _build_site` for detailed logs.'"
docs = "mkdocs serve"
serve = "python -m http.server --directory site 8008"
# QUALITY CHECKS
lint = "ruff check . && isort --check --diff ."
typecheck = "mypy ."
_check = "poetry run task lint && poetry run task typecheck"
format = "ruff format . && isort ."
post_test = "coverage html"
# CORE TEST
_pytest_local = "rm -rf test/allure-results && pytest -s -x --cov=scriptize -vv --alluredir=test/allure-results"
_pytest_ci = "rm -rf test/allure-results && pytest -s --cov=scriptize -vv --alluredir=test/allure-results"
# CORE BUILD
_docs_build = "mkdocs build --clean"
_report_build = """
mkdir -p test/allure-history && \
cp -r test/allure-history/history test/allure-results/ 2>/dev/null || true && \
python test/scripts/generate_executor.py && \
allure -q generate test/allure-results --clean -o site/test-report/allure && \
cp -r site/test-report/allure/history test/allure-history/
"""
_build_site = """
echo '[1/3] Running tests...' && poetry run task _pytest_local >/dev/null 2>&1 && \
echo '[2/3] Building documentation...' && poetry run task _docs_build >/dev/null 2>&1 && \
echo '[3/3] Building test report...' && poetry run task _report_build >/dev/null 2>&1
"""
# GITHUB CI
ci = "poetry run task _check && poetry run task _pytest_ci"
[tool.coverage.html]
directory = "site/test-report/coverage"
[tool.coverage.run]
branch = true
source = ["scriptize"]
[tool.isort]
profile = "black"
[tool.mypy]
python_version = "3.13"
ignore_missing_imports = true
disallow_untyped_defs = true
check_untyped_defs = true
strict_optional = true
warn_unused_ignores = true
warn_return_any = true
plugins = ["pydantic.mypy"]
exclude = 'migrations|tests/fixtures'