Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
dashboards
Commits
3e449ad9ba6d
Commit
a30d79b9
authored
Dec 10, 2020
by
Laurent Peuch
Browse files
feat(deprecated): exclude but list projects with outdated CW dependencies
parent
341ecbf9d507
Pipeline
#24984
passed with stages
in 4 minutes and 45 seconds
Changes
3
Pipelines
25
Hide whitespace changes
Inline
Side-by-side
deprecated-warnings.py
View file @
3e449ad9
...
...
@@ -5,6 +5,8 @@ import gitlab
import
jinja2
import
zipfile
from
heptalab
import
get_all_versions_number_from_pypi
from
collections
import
defaultdict
from
rdflib
import
ConjunctiveGraph
...
...
@@ -189,8 +191,23 @@ result: dict = defaultdict(lambda: {"count": 0, "path": [],
"dependencies"
:
{},
"warnings"
:
{}})})
outdated_projects
=
[]
cubicweb_latest_version
=
get_all_versions_number_from_pypi
(
"cubicweb"
)[
-
1
]
# yams_latest_version = get_all_versions_number_from_pypi("yams")[-1]
# rql_latest_version = get_all_versions_number_from_pypi("rql")[-1]
# logilab_common_latest_version = get_all_versions_number_from_pypi("logilab-common")[-1]
# logilab_database_latest_version = get_all_versions_number_from_pypi("logilab-database")[-1]
for
gitlab_project
,
warnings
in
all_artifacts
.
items
():
for
warning
in
warnings
:
if
"cubicweb"
in
warning
.
get
(
"dependencies"
,
()):
current_project_cubicweb_version
=
tuple
(
map
(
int
,
warning
[
"dependencies"
][
"cubicweb"
].
split
(
"."
)))
if
current_project_cubicweb_version
!=
cubicweb_latest_version
:
if
(
gitlab_project
,
warning
[
"dependencies"
])
not
in
outdated_projects
:
outdated_projects
.
append
((
gitlab_project
,
warning
[
"dependencies"
]))
continue
warning_text
=
eval
(
warning
[
"args"
])[
0
]
result
[
warning_text
][
"count"
]
+=
warning
[
"count"
]
result
[
warning_text
][
"projects"
][
gitlab_project
][
"count"
]
+=
warning
[
"count"
]
...
...
@@ -225,9 +242,11 @@ result = sorted(result.items(), key=lambda x: -x[1]["count"])
rendered_template
=
jinja2
.
Template
(
open
(
"template/deprecated-warnings.html"
,
"r"
).
read
()).
render
(
warnings
=
result
,
outdated_projects
=
outdated_projects
,
cubicweb_latest_version
=
cubicweb_latest_version
,
files_to_url
=
files_to_url_cache
,
highlight_code
=
highlight_code
,
str
=
str
,
str
=
str
,
map
=
map
,
render_traceback
=
render_traceback
,
render_source_code_file
=
render_source_code_file
,
pygment_css
=
HtmlFormatter
().
get_style_defs
())
...
...
requirements.txt
View file @
3e449ad9
...
...
@@ -5,3 +5,4 @@ requests
rdflib
pygments
anybadge
hg+https://forge.extranet.logilab.fr/open-source/heptalab
template/deprecated-warnings.html
View file @
3e449ad9
...
...
@@ -85,5 +85,14 @@
{% endfor %}
<hr>
<h2>
Project with outdated dependencies (but deprecated warnings):
</h2>
<ul>
{% for outdated_project, dependencies in outdated_projects %}
<li><a
href=
"{{ outdated_project.web_url }}"
>
{{ outdated_project.name }}
</a>
: {{ dependencies["cubicweb"] }} != {{ ".".join(map(str, cubicweb_latest_version)) }}
</li>
{% endfor %}
</ul>
</body>
</html>
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