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
79dea082291c
Commit
596c3275
authored
Aug 21, 2020
by
Laurent Peuch
Browse files
refactor(qa): simplify files presence testing a lot
parent
5471ccc8f406
Changes
1
Hide whitespace changes
Inline
Side-by-side
qa_dashboard.py
View file @
79dea082
...
...
@@ -21,29 +21,18 @@ for number, cube in enumerate(all_cubes):
# deprecation warnings ?
try
:
tox_content
=
cube
.
files
.
get
(
"tox.ini"
,
ref
=
"branch/default"
).
decode
().
decode
(
"Utf-8"
)
has_tox
=
True
cube_files
=
{
x
[
"name"
]
for
x
in
cube
.
repository_tree
()}
except
(
gitlab
.
GitlabHttpError
,
gitlab
.
GitlabGetError
):
has_tox
=
False
tox_content
=
Non
e
# we don't care about empty repositories
continu
e
try
:
cube
.
files
.
get
(
".gitlab-ci.yml"
,
ref
=
"branch/default"
)
has_gitlab_ci
=
True
except
(
gitlab
.
GitlabHttpError
,
gitlab
.
GitlabGetError
):
has_gitlab_ci
=
False
has_tox
=
"tox.ini"
in
cube_files
has_gitlab_ci
=
".gitlab-ci.yml"
in
cube_files
has_readme_rst
=
bool
({
"README.rst"
,
"README.md"
}
&
cube_files
)
# set intersection
try
:
cube
.
files
.
get
(
"README.rst"
,
ref
=
"branch/default"
)
has_readme_rst
=
True
except
(
gitlab
.
GitlabHttpError
,
gitlab
.
GitlabGetError
):
try
:
cube
.
files
.
get
(
"README.md"
,
ref
=
"branch/default"
)
has_readme_rst
=
True
except
(
gitlab
.
GitlabHttpError
,
gitlab
.
GitlabGetError
):
has_readme_rst
=
False
if
has_tox
:
tox_content
=
cube
.
files
.
get
(
"tox.ini"
,
ref
=
"branch/default"
).
decode
().
decode
(
"Utf-8"
)
if
tox_content
is
not
None
:
with
tempfile
.
TemporaryDirectory
()
as
temporary_directory_path
:
# TODO pyproject.toml
tox_path
=
os
.
path
.
join
(
temporary_directory_path
,
"tox.ini"
)
...
...
Write
Preview
Markdown
is supported
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