Commit cc7e5786 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

feat(qa): add has_capture_deprecation_warnings

parent 91c6166c912b
Pipeline #13722 failed with stages
in 1 minute and 49 seconds
......@@ -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())
......
......@@ -14,6 +14,7 @@
<th>black</th>
<th>mypy</th>
<th>from forge</th>
<th>capture deprecationwarnings</th>
</tr>
{%- endmacro %}
......@@ -42,8 +43,14 @@
<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>
<td></td>
<td></td>
<td></td>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment