weblate/ci/pip-install
Michal Čihař 08bec42652 chore(ci): merge ci and test deps
- The coverage package is pulled by pytest-cov anyway
- Merge migrations and latest pip install code
2024-10-15 13:58:09 +02:00

38 lines
1.2 KiB
Bash
Executable file

#!/bin/sh
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -e -x
if [ "${1:-latest}" = minimal ]; then
# Adjust deps to force minimal version
sed -i '/^ *"/ s/>=/==/' pyproject.toml
fi
if [ "${1:-latest}" = mypy ]; then
uv pip install --system -e ".[all,mysql,mypy,test]"
else
# TODO: lxml can use wheels once xmlsec has one
# see https://github.com/xmlsec/python-xmlsec/issues/327
if python -c 'import sys; sys.exit(0 if sys.version_info >= (3,13) else 1)'; then
uv pip install --system --no-binary=lxml -e ".[all,mysql,test]"
else
uv pip install --system -e ".[all,mysql,test]"
fi
fi
if [ "${1:-latest}" = edge ]; then
uv pip install --system --upgrade -e ".[all,mysql,test]"
# Install from git / pre-release
uv pip install --system --no-deps --upgrade --force-reinstall \
https://github.com/translate/translate/archive/master.zip \
https://github.com/WeblateOrg/language-data/archive/main.zip \
https://github.com/WeblateOrg/translation-finder/archive/main.zip
uv pip install --system --upgrade --pre Django
fi
# Verify that deps are consistent
if [ "${1:-latest}" != edge ]; then
uv pip check
fi