Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
dashboards
Commits
6cdd4c7b5140
Commit
cc7e5786
authored
Sep 09, 2020
by
Laurent Peuch
Browse files
feat(qa): add has_capture_deprecation_warnings
parent
91c6166c912b
Pipeline
#13722
failed with stages
in 1 minute and 49 seconds
Changes
2
Pipelines
18
Hide whitespace changes
Inline
Side-by-side
qa_dashboard.py
View file @
6cdd4c7b
...
...
@@ -14,6 +14,8 @@ context = {"cubes": []}
all_cubes
=
[
x
for
x
in
gl
.
projects
.
list
(
all
=
True
)
if
x
.
namespace
[
"name"
]
==
"cubes"
]
PYTEST_CAPTURE_DEPRECATIONWARNINGS_PACKAGE_URI
=
"git+https://github.com/psycojoker/pytest-capture-deprecationwarnings"
for
number
,
cube
in
enumerate
(
all_cubes
):
# python3
# doc8
...
...
@@ -40,6 +42,9 @@ for number, cube in enumerate(all_cubes):
has_doc
=
bool
({
"doc"
,
"docs"
}
&
cube_files
)
# set intersection
has_readthedocs
=
requests
.
get
(
f
"https://cubicweb-
{
cube_normalized_name
}
.readthedocs.io"
).
status_code
==
200
# will be set after
has_capture_deprecation_warnings
=
None
if
has_tox
:
tox_content
=
cube
.
files
.
get
(
"tox.ini"
,
ref
=
"branch/default"
).
decode
().
decode
(
"Utf-8"
)
...
...
@@ -56,6 +61,23 @@ for number, cube in enumerate(all_cubes):
has_mypy
=
"mypy"
in
tox_config
.
envlist
has_flake8
=
"flake8"
in
tox_config
.
envlist
has_from_forge
=
any
([
"from-forge"
in
x
for
x
in
tox_config
.
envlist
])
if
has_py3_tests
:
env_name
=
[
x
for
x
in
tox_config
.
envconfigs
if
x
.
startswith
(
"py3"
)]
py3
=
tox_config
.
envconfigs
[
env_name
[
0
]]
deps
=
[
str
(
x
)
for
x
in
py3
.
deps
]
uses_dev_requirements
=
bool
([
x
for
x
in
deps
if
x
.
startswith
(
"-r"
)
and
x
.
endswith
(
"dev-requirements.txt"
)])
if
PYTEST_CAPTURE_DEPRECATIONWARNINGS_PACKAGE_URI
in
deps
:
has_capture_deprecation_warnings
=
True
elif
uses_dev_requirements
and
"dev-requirements.txt"
in
cube_files
:
requirements
=
[
x
.
strip
()
for
x
in
cube
.
files
.
get
(
"dev-requirements.txt"
,
ref
=
"branch/default"
).
decode
().
decode
(
"Utf-8"
)
if
not
x
.
strip
().
startswith
(
"#"
)]
if
PYTEST_CAPTURE_DEPRECATIONWARNINGS_PACKAGE_URI
in
requirements
:
has_capture_deprecation_warnings
=
True
else
:
has_capture_deprecation_warnings
=
False
# has_doc8, check if has doc first
# has_pytest_html
# has_pytest_capture_deprecationwarnings
...
...
@@ -83,6 +105,7 @@ for number, cube in enumerate(all_cubes):
"has_mypy"
:
has_mypy
,
"has_flake8"
:
has_flake8
,
"has_from_forge"
:
has_from_forge
,
"has_capture_deprecation_warnings"
:
has_capture_deprecation_warnings
,
})
context
[
"cubes"
]
=
sorted
(
context
[
"cubes"
],
key
=
lambda
x
:
x
[
"cube"
][
"name"
].
lower
())
...
...
template/qa.html
View file @
6cdd4c7b
...
...
@@ -14,6 +14,7 @@
<th>
black
</th>
<th>
mypy
</th>
<th>
from forge
</th>
<th>
capture deprecationwarnings
</th>
</tr>
{%- endmacro %}
...
...
@@ -42,6 +43,11 @@
<td
class=
"{{ "
true
"
if
cube
["
has_black
"]
else
"
false
"
}}"
></td>
<td
class=
"{{ "
true
"
if
cube
["
has_mypy
"]
else
"
false
"
}}"
></td>
<td
class=
"{{ "
true
"
if
cube
["
has_from_forge
"]
else
"
false
"
}}"
></td>
{% if cube["has_py3_tests"] %}
<td
class=
"{{ "
true
"
if
cube
["
has_capture_deprecation_warnings
"]
else
"
false
"
}}"
></td>
{% else %}
<td></td>
{% endif %}
{% else %}
<td></td>
<td></td>
...
...
@@ -50,6 +56,7 @@
<td></td>
<td></td>
<td></td>
<td></td>
{% endif %}
</tr>
{%- endmacro %}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment