Re: [PATCH v5 08/11] doc: devicetree: Updates for devicetree-rebasing subtree

Sumit Garg <[email protected]>
Newsgroups io.groups.u-boot-amlogic,org.u-boot-project.lists.u-boot
Message-ID <CAFA6WYPYSj4Am1jZMyAM-4VpxoqMbBiSOTSVMsjF2MabA-UeXQ@mail.gmail.com>
On Fri, 16 Feb 2024 at 16:17, Paul Barker <[email protected]> wrote:
>
> On 14/02/2024 13:32, Sumit Garg wrote:
> > On Wed, 14 Feb 2024 at 03:01, Paul Barker <[email protected]> wrote:
> >> On 02/02/2024 13:05, Sumit Garg wrote:
> >>> +Dependencies
> >>> +~~~~~~~~~~~~
> >>> +
> >>> +The DT schema project must be installed in order to validate the DT schema
> >>> +binding documents and validate DTS files using the DT schema. The DT schema
> >>> +project can be installed with pip::
> >>> +
> >>> +    pip3 install dtschema
> >>
> >> Unfortunately this won't work on recent distro versions, e.g. on Debian
> >> 12 I get:
> >>
> >>     error: externally-managed-environment
> >>
> >>     × This environment is externally managed
> >>     ╰─> To install Python packages system-wide, try apt install
> >>         python3-xyz, where xyz is the package you are trying to
> >>         install.
> >>
> >>         If you wish to install a non-Debian-packaged Python package,
> >>         create a virtual environment using python3 -m venv path/to/venv.
> >>         Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
> >>         sure you have python3-full installed.
> >>
> >>         If you wish to install a non-Debian packaged Python application,
> >>         it may be easiest to use pipx install xyz, which will manage a
> >>         virtual environment for you. Make sure you have pipx installed.
> >>
> >>         See /usr/share/doc/python3.11/README.venv for more information.
> >>
> >>     note: If you believe this is a mistake, please contact your Python
> >>     installation or OS distribution provider. You can override this, at the
> >>     risk of breaking your Python installation or OS, by passing
> >>     --break-system-packages.
> >>     hint: See PEP 668 for the detailed specification.
> >>
> >> I don't have a good solution to recommend here - there's no consensus on
> >> how to install Python tools for use in development. You could use
> >> `pipx`, you could create a virtualenv, and I'm sure there are other
> >> options as well. Perhaps we just need to leave it up to the reader to
> >> find out how to install dtschema on their system.
> >
> > I suppose you haven't installed python3-pip package [1] on your Debian
> > 12. BTW, `pip3` is being used as the common way to install dtschema
> > [2]. Also, every user may not be aware about python virtual
> > environments. So it's better to provide the commonly used pip3 option
> > for installation.
>
> The python3-pip package is installed, it's the pip3 program that is
> printing the error message I saw. This is the new behaviour in Debian
> 12, also seen in rolling distributions like Arch Linux and OpenSuSE
> Tumbleweed since the middle of last year. There is a good guide to this
> from Python=>Speed [1] and more detail in the Python packaging spec [2].
> Sadly it's something we now have to live with in recent Linux distro
> releases, and I expect all distros will enable this in upcoming
> releases.

Okay I see, thanks for bringing it up. I hope Rob will take note of
this and update dtschema installation instructions [1] accordingly.

As part of v6, I will rather guide users towards the dtschema github
page in order to get installation instructions.

[1] https://github.com/devicetree-org/dt-schema/tree/main?tab=readme-ov-file#installing

-Sumit

>
> [1]: https://pythonspeed.com/articles/externally-managed-environment-pep-668/
> [2]: https://packaging.python.org/en/latest/specifications/externally-managed-environments/#externally-managed-environments
>
> Thanks,
>
> --
> Paul Barker
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.