Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
169 lines (154 loc) · 8.1 KB
/
Copy pathpyproject.toml
File metadata and controls
169 lines (154 loc) · 8.1 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
[build-system]
# Pinned rather than floored, and pinned to the same versions the Makefile
# bootstraps into the venv and requirements.in installs, which requirements
# README.md asks for under UPGRADE BLOCKERs. A floor is also too low now that
# the metadata below is PEP 621: setuptools grew full support for [project] in
# 61, so a build resolving anything older would ignore or reject it.
requires = ["setuptools==84.0.0", "setuptools_scm[toml]==10.2.3"]
build-backend = "setuptools.build_meta"
[project]
# Renamed from awx. An installed distribution keeps whatever name it was built
# under, so the version lookup in ascender/__init__.py reads both, and the
# Makefile still leaves a dist/awx.tar.gz symlink beside the new one for a
# caller that builds from source by that path.
name = "ascender"
# Two entries rather than one: a combined { name, email } renders as a single
# "Author-email: Red Hat <info@ansible.com>" header, where setup.cfg produced
# separate Author and Author-email fields. This keeps the metadata identical.
authors = [{ name = "Red Hat" }, { email = "info@ansible.com" }]
# Supplied by setuptools_scm, see the note on [tool.setuptools_scm] below.
dynamic = ["version"]
[project.scripts]
# Both names run the same entry point. `ascender-manage` is the name the
# product has, and `awx-manage` is the one the installers, the operator and
# people's own scripts call, so it stays until they have all moved.
ascender-manage = "ascender:manage"
awx-manage = "ascender:manage"
# The group a credential plugin registers against is a published name: anything
# third party declares itself under `awx.credential_plugins` and cannot be
# rewritten from here. Both groups carry the same ten plugins, and the loader
# reads both, so a plugin written against either is found. They are asserted
# identical by a test, which is what keeps the two lists from drifting.
[project.entry-points."ascender.credential_plugins"]
conjur = "ascender.main.credential_plugins.conjur:conjur_plugin"
hashivault_kv = "ascender.main.credential_plugins.hashivault:hashivault_kv_plugin"
hashivault_ssh = "ascender.main.credential_plugins.hashivault:hashivault_ssh_plugin"
azure_kv = "ascender.main.credential_plugins.azure_kv:azure_keyvault_plugin"
aim = "ascender.main.credential_plugins.aim:aim_plugin"
centrify_vault_kv = "ascender.main.credential_plugins.centrify_vault:centrify_plugin"
thycotic_dsv = "ascender.main.credential_plugins.dsv:dsv_plugin"
thycotic_tss = "ascender.main.credential_plugins.tss:tss_plugin"
aws_secretsmanager_credential = "ascender.main.credential_plugins.aws_secretsmanager:aws_secretmanager_plugin"
github_app_lookup = "ascender.main.credential_plugins.github_app:github_app_plugin"
[project.entry-points."awx.credential_plugins"]
conjur = "ascender.main.credential_plugins.conjur:conjur_plugin"
hashivault_kv = "ascender.main.credential_plugins.hashivault:hashivault_kv_plugin"
hashivault_ssh = "ascender.main.credential_plugins.hashivault:hashivault_ssh_plugin"
azure_kv = "ascender.main.credential_plugins.azure_kv:azure_keyvault_plugin"
aim = "ascender.main.credential_plugins.aim:aim_plugin"
centrify_vault_kv = "ascender.main.credential_plugins.centrify_vault:centrify_plugin"
thycotic_dsv = "ascender.main.credential_plugins.dsv:dsv_plugin"
thycotic_tss = "ascender.main.credential_plugins.tss:tss_plugin"
aws_secretsmanager_credential = "ascender.main.credential_plugins.aws_secretsmanager:aws_secretmanager_plugin"
github_app_lookup = "ascender.main.credential_plugins.github_app:github_app_plugin"
[tool.setuptools]
# `ascender` is a handful of lines that make every awx module importable under
# the Ascender name as well. See ascender/__init__.py.
packages = ["awx", "ascender"]
zip-safe = false
include-package-data = true
# Active on purpose: the built version comes from git describe by way of
# setuptools_scm. Note that this takes precedence over the project version, so
# the VERSION file that ascender.get_version() reads does not reach the built
# metadata, only the running application.
[tool.setuptools_scm]
[tool.ruff]
# Ported from the [flake8] block in tox.ini rather than adopted from upstream
# AWX, whose Ruff config selects 12 rules where ours selects 48. Copying theirs
# would have dropped 36 checks silently.
line-length = 160
exclude = [".git", "__pycache__", ".tox", "ascender/ui/node_modules", "env"]
# target-version is left unset on purpose, which means ruff's default of py39.
# It is not only a lint setting, the formatter reads it too: at py314 it rewrites
# 31 files from except (A, B): to the PEP 758 except A, B:, which is a syntax
# error on anything older. Ruff infers the target from requires-python when that
# is present, so if [project] ever gains one, pin target-version here in the same
# change rather than letting the formatting follow it.
[tool.ruff.format]
# The two settings black was configured with: line-length above, and preserving
# quotes rather than normalising them, which is skip-string-normalization.
quote-style = "preserve"
[tool.ruff.lint]
# E265, E266 and W391 are preview rules in Ruff 0.16. Without this they are
# accepted and then silently do nothing, which ruff reports as "Selection
# `E265` has no effect because preview is not enabled". Since the selection
# below is explicit, preview does not pull in anything unasked for: it only
# makes those three run. Drop this once they are stabilised.
preview = true
# The same 48 rules tox.ini selects, and for the same reason: black owns the
# formatting and most of pycodestyle would fight it, so what is listed is the
# checks that catch a mistake rather than a style preference. Kept in the same
# order as the flake8 block so the two can be compared line by line.
select = [
"E265", "E266", "E703", "E713", "E714", "E722", "E741", "E742", "E743",
"F401", "F402", "F405", "F501", "F502", "F503", "F504", "F505", "F506",
"F507", "F508", "F509", "F521", "F522", "F523", "F524", "F525", "F541",
"F601", "F602", "F631", "F632", "F633", "F634", "F702", "F706", "F707",
"F811", "F821", "F822", "F823", "F841", "F842", "F901",
"W291", "W292", "W293", "W391", "W605",
]
# Moved here from pytest.ini. One value changed on the way, python_files, and
# the reason is below.
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "ascender.main.tests.settings_for_test"
# pytest.ini said every .py, which made collection import the whole repository
# looking for tests, including modules that parse argv and call sys.exit at
# import time. That is where the 14 collection errors came from, and one of
# them, tools/data_generators/rbac_dummy_data_generator.py, took the run down
# with SystemExit rather than reporting.
#
# Nothing needed the wider net: not one file outside these two patterns defines
# a test. The two that look like they do are fixtures named test_* inside a
# conftest.py, which pytest never collects as a module anyway.
python_files = ["test_*.py", "*_test.py"]
addopts = "--reuse-db --nomigrations --tb=native --timeout=300"
junit_family = "xunit2"
markers = [
"ac: access control test",
"survey: tests related to survey feature",
"inventory_import: tests of code used by inventory import command",
"defined_in_file:",
"job_permissions:",
"activity_stream_access:",
"job_runtime_vars:",
"fixture_args:",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore:CoreAPI compatibility is deprecated:UserWarning",
"ignore:pkg_resources is deprecated as an API:UserWarning",
]
# Moved here from .coveragerc, unchanged. The exclude_lines entries are regular
# expressions, so they are literal strings: a backslash in them is the regex's,
# not TOML's.
[tool.coverage.run]
source = ["ascender"]
branch = true
omit = ["ascender/main/migrations/*"]
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
'if self\.debug',
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
'if __name__ == .__main__.:',
]
ignore_errors = true
[tool.coverage.xml]
output = "./reports/coverage.xml"