Skip to content

Commit 46ab131

Browse files
authored
Merge pull request #3549 from getpelican/install-docs
docs: Add Pipx & `uv` as alternate install methods
2 parents f941cb0 + 8ad4e90 commit 46ab131

1 file changed

Lines changed: 64 additions & 27 deletions

File tree

docs/install.rst

Lines changed: 64 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,85 @@
11
Installing Pelican
22
##################
33

4-
Pelican currently runs best on |min_python|; earlier versions of Python are not supported.
4+
Pelican currently runs best on Python |min_python|; earlier versions of Python are not supported.
55

6-
You can install Pelican via several different methods. The simplest is via Pip_::
6+
Once Pelican is installed, you can run ``pelican --help`` to see basic usage
7+
options. For more detail, refer to the :doc:`Publish<publish>` section.
8+
9+
You can install Pelican via several different methods.
10+
11+
**Recommended method:** `Pip <https://pip.pypa.io/>`_ User Install
12+
13+
To install Pelican via Pip::
14+
15+
python3 -m pip install --user "pelican[markdown]"
16+
17+
Or, if you do not plan to use `Markdown <https://pypi.org/project/Markdown/>`_,
18+
you can omit the ``[markdown]`` suffix::
19+
20+
python3 -m pip install --user pelican
21+
22+
**Alternate method 1:** `Pipx <https://github.com/pypa/pipx>`_
23+
24+
Pipx lets you execute binaries from Python packages in isolated environments.
25+
You can install Pipx by following its
26+
`documentation <https://pipx.pypa.io>`_. After Pipx is installed,
27+
you can install Pelican via::
28+
29+
pipx install "pelican[markdown]"
730

8-
python -m pip install pelican
31+
**Alternate method 2:** `uv <https://docs.astral.sh/uv/>`_
932

10-
Or, if you plan on using Markdown::
33+
Like Pipx, ``uv`` allows you to install tools in isolated environments.
34+
If you have ``uv`` installed, you can install Pelican via::
1135

12-
python -m pip install "pelican[markdown]"
36+
uv tool install "pelican[markdown]"
1337

14-
(Keep in mind that some operating systems will require you to prefix the above
15-
command with ``sudo`` in order to install Pelican system-wide.)
38+
**Alternate method 3:** Virtual Environment
1639

17-
While the above is the simplest method, the recommended approach is to create a
18-
virtual environment for Pelican via virtualenv_ before installing Pelican.
19-
Assuming you have virtualenv_ installed, you can then open a new terminal
20-
session and create a new virtual environment for Pelican::
40+
If you prefer to manually manage a virtual environment, you can create
41+
a virtual environment for Pelican via venv_ before installing Pelican::
2142

22-
virtualenv ~/virtualenvs/pelican
23-
cd ~/virtualenvs/pelican
24-
source bin/activate
43+
python3 -m venv ~/virtualenvs/pelican
44+
source ~/virtualenvs/pelican/bin/activate
45+
python3 -m pip install "pelican[markdown]"
2546

26-
Once the virtual environment has been created and activated, Pelican can be
27-
installed via ``python -m pip install pelican`` as noted above. Alternatively, if you
28-
have the project source, you can install Pelican using the setuptools method::
47+
Alternatively, if you have the project source, you can replace the last command
48+
with the following to install Pelican using the ``setuptools`` method::
2949

3050
cd path-to-Pelican-source
31-
python -m pip install .
51+
python3 -m pip install .
3252

3353
If you have Git installed and prefer to install the latest bleeding-edge
3454
version of Pelican rather than a stable release, use the following command::
3555

36-
python -m pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican"
56+
python3 -m pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican"
3757

38-
Once Pelican is installed, you can run ``pelican --help`` to see basic usage
39-
options. For more detail, refer to the :doc:`Publish<publish>` section.
58+
To exit the virtual environment, type ``deactivate``.
4059

4160
Optional packages
4261
-----------------
4362

4463
If you plan on using `Markdown <https://pypi.org/project/Markdown/>`_ as a
4564
markup format, you can install Pelican with Markdown support::
4665

47-
python -m pip install "pelican[markdown]"
66+
python3 -m pip install --user "pelican[markdown]"
4867

4968
Typographical enhancements can be enabled in your settings file, but first the
50-
requisite `Typogrify <https://pypi.org/project/typogrify/>`_ library must be
69+
requisite `Typogrify <https://github.com/justinmayer/typogrify>`_ library must be
5170
installed::
5271

53-
python -m pip install typogrify
72+
python3 -m pip install --user typogrify
73+
74+
If you are using Pipx, you can inject packages into the Pipx-managed virtual
75+
environment. For example, to add Typogrify::
76+
77+
pipx inject pelican typogrify
78+
79+
To use ``uv`` to install Pelican with additional extra packages, use the
80+
following example command, which like above will also install Typogrify::
81+
82+
uv tool install --with typogrify "pelican[markdown]"
5483

5584
Dependencies
5685
------------
@@ -80,11 +109,19 @@ Upgrading
80109
If you installed a stable Pelican release via Pip_ and wish to upgrade to
81110
the latest stable release, you can do so by adding ``--upgrade``::
82111

83-
python -m pip install --upgrade pelican
112+
python3 -m pip install --upgrade pelican
84113

85-
If you installed Pelican via distutils or the bleeding-edge method, simply
114+
If you installed Pelican via ``setuptools`` or the bleeding-edge method,
86115
perform the same step to install the most recent version.
87116

117+
If you installed with Pipx, upgrade via::
118+
119+
pipx upgrade pelican
120+
121+
If you installed with ``uv``, upgrade via::
122+
123+
uv tool upgrade pelican
124+
88125
Kickstart your site
89126
-------------------
90127

@@ -118,5 +155,5 @@ content)::
118155
The next step is to begin to adding content to the *content* folder that has
119156
been created for you.
120157

121-
.. _Pip: https://pip.pypa.io/
122158
.. _virtualenv: https://virtualenv.pypa.io/en/latest/
159+
.. _venv: https://docs.python.org/3/library/venv.html

0 commit comments

Comments
 (0)