plone / documentation

Plone Documentation
https://docs.plone.org
92 stars 154 forks source link

`pip install pipx` should not be used on page /install/create-project-cookieplone.html #1771

Open stevepiercy opened 6 days ago

stevepiercy commented 6 days ago

I just realized we have an issue with the new docs method to install pipx. This may affect other pages where we say pip install pipx.

@davisagli let's chat about pipx's official documentation to install pipx. I think our current method of pip install pipx will trip up some users who might try to install it into their system Python with sudo or who might create a virtual environment and activate it 😱. I much prefer to link to official docs.

davisagli commented 6 days ago

@stevepiercy The official pipx docs don't look like something we can recommend.

For macOS it says to use homebrew to install pipx. I know from experience that that leads to sadness, because it'll use the homebrew-installed Python, and then at some random point in the future homebrew will upgrade Python and then existing software installed with pipx will stop working.

For linux it says to use the OS package manager. In a similar way that means you get the Python from the OS and don't have any control over which version of Python to use.

My preferred path would be to switch to using uvx instead of pipx, since it also handles installing a compatible version of Python in a cross-platform way.

stevepiercy commented 6 days ago

@davisagli what would be the process to install uvx instead of pipx? And which one?

There's still the matter of using pip install without knowing which pip to use. Weren't you the person who pointed me to https://snarky.ca/why-you-should-use-python-m-pip/ ?

davisagli commented 6 days ago

@stevepiercy The uvx command that comes with uv. The standalone installer is the best option for someone who doesn't know what they're doing. https://docs.astral.sh/uv/getting-started/installation/#standalone-installer

There's still the matter of using pip install without knowing which pip to use. Weren't you the person who pointed me to https://snarky.ca/why-you-should-use-python-m-pip/ ?

I guess I was figuring that you generally want pipx installed globally in whatever Python is your default. Sure, it's probably better to be explicit. But we don't have this problem if we stop using pipx.

stevepiercy commented 6 days ago

OK.

Now the hard question: Should we be so bold as to use uvx in the docs now or use python3 -m pip install pipx?

I'm on the fence. For personal stuff and Plone Sphinx Theme, I'm using uv and its friends, but I have also stumbled on some things with it, such as uv discovery of venvs. pip is most familiar, and python3 -m pip install pipx won't require a big change. I reckon we need to throw this out to the Community Forum for a broader discussion.

In docs, we can always add a note admonition with a brief explanation of why we use this one way, whichever one we choose.