Commit 3593cba4 authored by Zen Fu's avatar Zen Fu
Browse files

[weblate] Fix generation of requirements in dep update script (tails#17377)

parent 606dbc55
......@@ -15,9 +15,9 @@ class tails::weblate::python_modules () {
# Dependencies for Weblate 3.5.1
tails::pip_package_from_repo { 'amqp':
version => '2.6.0', # <2.7,>=2.6.0
version => '2.6.0', # >=2.6.0,<2.7
url => 'http://github.com/celery/py-amqp',
require => 'Exec[pip_install_vine]',
require => ['Exec[pip_install_vine]'],
}
tails::pip_package_from_repo { 'asgiref':
......@@ -26,7 +26,7 @@ class tails::weblate::python_modules () {
}
tails::pip_package_from_repo { 'billiard':
version => '3.6.3.0', # <4.0,>=3.6.3.0
version => '3.6.3.0', # >=3.6.3.0,<4.0
url => 'https://github.com/celery/billiard',
}
......@@ -34,37 +34,33 @@ class tails::weblate::python_modules () {
version => '4.4.4', # >=4.0
tag => 'v4.4.4',
url => 'https://github.com/celery/celery',
require => 'Exec[pip_install_billiard]',
require => 'Exec[pip_install_kombu]',
require => 'Exec[pip_install_vine]',
require => 'Exec[pip_install_redis]',
require => ['Exec[pip_install_billiard], Exec[pip_install_kombu], Exec[pip_install_vine], Exec[pip_install_redis]'],
}
tails::pip_package_from_repo { 'celery-batches':
version => '0.3', # >=0.2
tag => 'v0.3',
url => 'https://github.com/percipient/celery-batches',
require => 'Exec[pip_install_celery]',
require => ['Exec[pip_install_celery]'],
}
tails::pip_package_from_repo { 'django':
version => '1.11.29', # <2.0,>=1.11
version => '1.11.29', # >=1.11,<2.0
url => 'https://github.com/django/django',
require => 'Exec[pip_install_asgiref]',
require => ['Exec[pip_install_asgiref]'],
}
tails::pip_package_from_repo { 'django-appconf':
version => '1.0.4', # >=1.0
tag => 'v1.0.4',
url => 'https://github.com/django-compressor/django-appconf',
require => 'Exec[pip_install_django]',
require => ['Exec[pip_install_django]'],
}
tails::pip_package_from_repo { 'django-compressor':
version => '2.4', # >=2.1.1
url => 'https://github.com/django-compressor/django-compressor',
require => 'Exec[pip_install_django-appconf]',
require => 'Exec[pip_install_rjsmin]',
require => ['Exec[pip_install_django-appconf], Exec[pip_install_rjsmin]'],
}
tails::pip_package_from_repo { 'django-crispy-forms':
......@@ -75,7 +71,7 @@ class tails::weblate::python_modules () {
tails::pip_package_from_repo { 'djangorestframework':
version => '3.11.0', # >=3.8
url => 'https://github.com/encode/django-rest-framework',
require => 'Exec[pip_install_django]',
require => ['Exec[pip_install_django]'],
}
tails::pip_package_from_repo { 'filelock':
......@@ -87,7 +83,7 @@ class tails::weblate::python_modules () {
tails::pip_package_from_repo { 'importlib-metadata':
version => '1.6.1', # >=0.18
url => 'https://gitlab.com/python-devs/importlib_metadata',
require => 'Exec[pip_install_zipp]',
require => ['Exec[pip_install_zipp]'],
}
tails::pip_package_from_repo { 'jellyfish':
......@@ -99,9 +95,7 @@ class tails::weblate::python_modules () {
version => '4.6.10', # <4.7,>=4.6.10
tag => 'v4.6.10',
url => 'http://github.com/celery/kombu',
require => 'Exec[pip_install_amqp]',
require => 'Exec[pip_install_importlib-metadata]',
require => 'Exec[pip_install_redis]',
require => ['Exec[pip_install_amqp], Exec[pip_install_importlib-metadata], Exec[pip_install_redis]'],
}
tails::pip_package_from_repo { 'oauthlib':
......@@ -141,14 +135,13 @@ class tails::weblate::python_modules () {
tails::pip_package_from_repo { 'social-auth-app-django':
version => '3.4.0', # >=3.1.0
url => 'https://github.com/python-social-auth/social-app-django',
require => 'Exec[pip_install_social-auth-core]',
require => ['Exec[pip_install_social-auth-core]'],
}
tails::pip_package_from_repo { 'social-auth-core':
version => '3.3.3', # >=3.1.0
url => 'https://github.com/python-social-auth/social-core',
require => 'Exec[pip_install_oauthlib]',
require => 'Exec[pip_install_python3-openid]',
require => ['Exec[pip_install_oauthlib], Exec[pip_install_python3-openid]'],
}
tails::pip_package_from_repo { 'translate-toolkit':
......@@ -169,7 +162,7 @@ class tails::weblate::python_modules () {
tails::pip_package_from_repo { 'user-agents':
version => '2.1', # >=1.1.0
url => 'https://github.com/selwin/python-user-agents',
require => 'Exec[pip_install_ua-parser]',
require => ['Exec[pip_install_ua-parser]'],
}
tails::pip_package_from_repo { 'vine':
......
......@@ -228,8 +228,9 @@ class Dependency:
if self.repo_type:
lines.append(f"repo_type => '{self.repo_type}',")
for dep in self.require(via_pip):
lines.append(f"require => 'Exec[pip_install_{dep.name}]',")
deps = list(map(lambda d: f"Exec['pip_install_{d.name}']", self.require(via_pip)))
if deps:
lines.append(f"require => [{', '.join(deps)}],")
inner = '\n '.join(lines)
......
Supports Markdown
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