-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathpip-install
executable file
·41 lines (36 loc) · 1.94 KB
/
pip-install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
# Copyright © Michal Čihař <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -e -x
# Install mercurial with rust support
export HGWITHRUSTEXT=cpython
if [ "${1:-latest}" = minimal ]; then
# Adjust deps to force minimal version
sed -i '/^ *"/ s/>=/==/' pyproject.toml
uv sync --no-sources --all-extras --dev --no-binary-package mercurial
elif [ "${1:-latest}" = edge ]; then
# Install from git / pre-release
mkdir -p build/packages
# Fetch current snapshots
curl -LsSf https://github.com/translate/translate/archive/master.zip > build/packages/translate-toolkit.zip
curl -LsSf https://github.com/WeblateOrg/language-data/archive/main.zip > build/packages/weblate-language-data.zip
curl -LsSf https://github.com/WeblateOrg/translation-finder/archive/main.zip > build/packages/transaltion-finder.zip
# TODO: lxml can use wheels once xmlsec has one
# see https://github.com/xmlsec/python-xmlsec/issues/327
# Add downloaded zip, cannot add URL as uv complains about missing checksum
uv add --no-sources --no-binary-package lxml --no-binary-package xmlsec --no-binary-package mercurial build/packages/*
# Allow pre-repeases
uv add --no-sources --no-binary-package lxml --no-binary-package xmlsec --no-binary-package mercurial --prerelease allow Django
uv sync --no-sources --all-extras --dev --no-binary-package lxml --no-binary-package xmlsec --no-binary-package mercurial
elif python -c 'import sys; sys.exit(0 if sys.version_info >= (3,13) else 1)'; then
# TODO: lxml can use wheels once xmlsec has one
# see https://github.com/xmlsec/python-xmlsec/issues/327
uv sync --no-sources --frozen --all-extras --dev --no-binary-package lxml --no-binary-package xmlsec --no-binary-package mercurial
else
uv sync --no-sources --frozen --all-extras --dev --no-binary-package mercurial
fi
# Verify that deps are consistent
if [ "${1:-latest}" != edge ]; then
uv pip check
fi