Skip to content

Commit

Permalink
docs: use uv as recommended tool to install Weblate
Browse files Browse the repository at this point in the history
It performs better and comes with virtualenv embedded making it easier
to manage.
  • Loading branch information
nijel committed Oct 15, 2024
1 parent 26a39a2 commit 15b8567
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 34 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,11 @@ jobs:
- run: brew upgrade
- run: brew list --versions
- run: brew deps --tree --installed
- name: Fix Python
# Workaround for https://github.com/actions/setup-python/issues/577
run: |
brew uninstall --ignore-dependencies python@3.11
brew uninstall --ignore-dependencies python@3.13
brew unlink python@3.12
rm -f /usr/local/bin/{2to3,idle3,pydoc3,python3,python3-config}
brew link --overwrite python@3.12
- name: Install brew dependencies
run: |
brew install pango cairo gobject-introspection glib libyaml pkg-config zstd xxhash libxmlsec1
brew install pango cairo gobject-introspection glib libyaml pkg-config zstd xxhash libxmlsec1 uv
- name: Install Weblate
run: |
python3 -m venv .venv
.venv/bin/pip3 install -e .[all,test]
uv venv --python python3.12 .venv
. .venv/bin/activate
uv pip install -e .[all,test]
4 changes: 2 additions & 2 deletions docs/admin/auth.rst
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ can install it via usual means:
.. code-block:: sh
# Using PyPI
pip install 'django-auth-ldap>=1.3.0'
uv pip install 'django-auth-ldap>=1.3.0'
# Using apt-get
apt-get install python-django-auth-ldap
Expand Down Expand Up @@ -704,7 +704,7 @@ To install `django-cas-ng`:

.. code-block:: sh
pip install django-cas-ng
uv pip install django-cas-ng
Once you have the package installed you can hook it up to the Django
authentication system by modifying the :file:`settings.py` file:
Expand Down
6 changes: 3 additions & 3 deletions docs/admin/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,19 @@ When installing using pip, you can directly specify desired features when instal

.. code-block:: sh
pip install "Weblate[Postgres,Amazon,SAML]"
uv pip install "Weblate[Postgres,Amazon,SAML]"
Or you can install Weblate with all optional features:

.. code-block:: sh
pip install "Weblate[all]"
uv pip install "Weblate[all]"
Or you can install Weblate without any optional features:

.. code-block:: sh
pip install Weblate
uv pip install Weblate
Other system requirements
+++++++++++++++++++++++++
Expand Down
4 changes: 2 additions & 2 deletions docs/admin/install/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Installing from sources
.. code-block:: sh
. ~/weblate-env/bin/activate
pip install -e 'weblate-src[all]'
uv pip install -e 'weblate-src[all]'
# In case you intentd to run testsuite, install test deps as well:
pip install -e 'weblate-src[all,test]'
uv pip install -e 'weblate-src[all,test]'
#. Copy :file:`weblate/settings_example.py` to :file:`weblate/settings.py`.

Expand Down
6 changes: 3 additions & 3 deletions docs/admin/install/steps/install-python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Python modules

.. code-block:: sh
virtualenv ~/weblate-env
uv venv ~/weblate-env
#. Activate the virtualenv for Weblate:

Expand All @@ -24,7 +24,7 @@ Python modules
.. code-block:: sh
# Install Weblate with all optional dependencies
pip install "Weblate[all]"
uv pip install "Weblate[all]"
Please check :ref:`python-deps` for fine-tuning of optional dependencies.

Expand All @@ -42,4 +42,4 @@ Python modules

.. code-block:: sh
pip install --force-reinstall --no-binary :all: cffi
uv pip install --force-reinstall --no-binary :all: cffi
15 changes: 15 additions & 0 deletions docs/admin/install/steps/install-uv.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
uv package manager
++++++++++++++++++

.. hint::

We're using uv package manager to install Weblate.


.. code-block:: sh
curl -LsSf https://astral.sh/uv/install.sh | sh
.. seealso::

`Installing uv <https://docs.astral.sh/uv/getting-started/installation/>`_
3 changes: 2 additions & 1 deletion docs/admin/install/venv-debian.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Installing on Debian and Ubuntu
libxml2-dev libxslt-dev libfreetype6-dev libjpeg-dev libz-dev libyaml-dev \
libffi-dev libcairo-dev gir1.2-pango-1.0 gir1.2-rsvg-2.0 libgirepository1.0-dev \
libacl1-dev liblz4-dev libzstd-dev libxxhash-dev libssl-dev libpq-dev libjpeg-dev build-essential \
python3-gdbm python3-dev python3-pip python3-virtualenv virtualenv git
python3-gdbm python3-dev git
.. include:: steps/install-system-optional.rst

Expand Down Expand Up @@ -43,6 +43,7 @@ Installing on Debian and Ubuntu
# Gettext for the msgmerge add-on
apt install -y gettext
.. include:: steps/install-uv.rst

.. include:: steps/install-python.rst

Expand Down
3 changes: 1 addition & 2 deletions docs/admin/install/venv-macos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Installing on macOS

.. code-block:: sh
brew install python pango cairo gobject-introspection glib libyaml pkg-config zstd lz4 xxhash libxmlsec1
pip install virtualenv
brew install python pango cairo gobject-introspection glib libyaml pkg-config zstd lz4 xxhash libxmlsec1 uv
.. include:: steps/install-system-server.rst

Expand Down
4 changes: 3 additions & 1 deletion docs/admin/install/venv-redhat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Installing on RedHat, Fedora and CentOS
dnf install \
libxslt-devel libxml2-devel freetype-devel libjpeg-devel zlib-devel \
libyaml-devel libffi-devel cairo-devel cairo-gobject-devel pango-devel \
gobject-introspection-devel libacl-devel lz4-devel libzstd-devel xxhash-devel python3-pip python3-virtualenv \
gobject-introspection-devel libacl-devel lz4-devel libzstd-devel xxhash-devel \
libtool-ltdl-devel python3-devel git
.. include:: steps/install-system-optional.rst
Expand Down Expand Up @@ -43,6 +43,8 @@ Installing on RedHat, Fedora and CentOS
# Gettext for the msgmerge add-on
dnf install gettext
.. include:: steps/install-uv.rst

.. include:: steps/install-python.rst

.. include:: steps/install-configure.rst
Expand Down
4 changes: 3 additions & 1 deletion docs/admin/install/venv-suse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Installing on SUSE and openSUSE
zypper install \
libxslt-devel libxml2-devel freetype-devel libjpeg-devel zlib-devel \
libyaml-devel libffi-devel cairo-devel pango-devel \
gobject-introspection-devel libacl-devel liblz4-devel libzstd-devel libxxhash-devel python3-pip python3-virtualenv \
gobject-introspection-devel libacl-devel liblz4-devel libzstd-devel libxxhash-devel \
python3-devel git
.. include:: steps/install-system-optional.rst
Expand Down Expand Up @@ -42,6 +42,8 @@ Installing on SUSE and openSUSE
# Gettext for the msgmerge add-on
zypper install gettext
.. include:: steps/install-uv.rst

.. include:: steps/install-python.rst

.. include:: steps/install-configure.rst
Expand Down
12 changes: 6 additions & 6 deletions docs/admin/upgrade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ releases should work, but is not as well tested as single version upgrades!

.. code-block:: sh
pip install -U "Weblate[all]==version"
uv pip install -U "Weblate[all]==version"
Or, if you just want to get the latest released version:

.. code-block:: sh
pip install -U "Weblate[all]"
uv pip install -U "Weblate[all]"
If you don't want to install all of the optional dependencies do:

.. code-block:: sh
pip install -U Weblate
uv pip install -U Weblate
Using Git checkout, you need to fetch new source code and update your installation:

Expand All @@ -63,11 +63,11 @@ releases should work, but is not as well tested as single version upgrades!
cd weblate-src
git pull
# Update Weblate inside your virtualenv
. ~/weblate-env/bin/pip install -e '.[all]'
. ~/weblate-env/bin/uv pip install -e '.[all]'
# Install dependencies directly when not using virtualenv
pip install --upgrade -e .
uv pip install --upgrade -e .
# Install optional dependencies directly when not using virtualenv
pip install --upgrade -e '.[all]'
uv pip install --upgrade -e '.[all]'
#. New Weblate releases might have new :ref:`python-deps`, check if they cover
the features you want.
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The tests are executed using :program:`py.test`. First you need to install test

.. code-block:: sh
pip install -e '.[test,lint]'
uv pip install -e '.[dev]'
You can then execute the testsuite in the repository checkout:

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sources.

.. code-block:: sh
pip install -e '.[all,dev,ci,test,mypy,lint]'
uv pip install -e '.[dev]'
3. Start a development server:

Expand Down

0 comments on commit 15b8567

Please sign in to comment.