From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
Andrew Goodbody <andrew.goodbody@linaro.org>,
Caleb Connolly <caleb.connolly@linaro.org>,
Dmitry Rokosov <ddrokosov@salutedevices.com>,
Guillaume La Roque <glaroque@baylibre.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Igor Opaniuk <igor.opaniuk@gmail.com>,
Jens Wiklander <jens.wiklander@linaro.org>,
Jerome Forissier <jerome.forissier@linaro.org>,
Julien Masson <jmasson@baylibre.com>,
Love Kumar <love.kumar@amd.com>,
Mattijs Korpershoek <mkorpershoek@baylibre.com>,
Michal Simek <michal.simek@amd.com>,
Padmarao Begari <padmarao.begari@amd.com>,
Patrick Rudolph <patrick.rudolph@9elements.com>,
Peter Robinson <pbrobinson@gmail.com>,
Richard Weinberger <richard@nod.at>,
Sam Protsenko <semen.protsenko@linaro.org>,
Tim Harvey <tharvey@gateworks.com>
Subject: Re: [PATCH 2/4] test: Drop u_boot_ prefix on test files
Date: Sat, 25 Jan 2025 16:57:56 -0600 [thread overview]
Message-ID: <20250125225756.GK60249@bill-the-cat> (raw)
In-Reply-To: <CAFLszTgYPNxmiO=agM+MUp0da_6q3BBro74bWEnNbqeM-tT=bw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2269 bytes --]
On Sat, Jan 25, 2025 at 03:41:43PM -0700, Simon Glass wrote:
> Hi Tom,
>
> On Sat, 25 Jan 2025 at 14:46, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sat, Jan 25, 2025 at 02:31:37PM -0700, Simon Glass wrote:
> >
> > > We know this is U-Boot so the prefix serves no purpose other than to
> > > make things longer and harder to read. Drop it and rename the files.
> > >
> > > Signed-off-by: Simon Glass <sjg@chromium.org>
> >
> > This is a massive bit of churn and violating namespace best practices
> > when it seems like we really need:
> > [snip]
> > > diff --git a/test/py/tests/fit_util.py b/test/py/tests/fit_util.py
> > > index 16ff8c96c63..7aad4030be3 100644
> > > --- a/test/py/tests/fit_util.py
> > > +++ b/test/py/tests/fit_util.py
> > > @@ -5,7 +5,7 @@
> > >
> > > import os
> > >
> > > -import u_boot_utils as util
> > > +import utils as util
>
> The real namespace is the one in site-packages, where you are supposed
> to put things in their own modules. The Python tools operate in a
> proper namespace, but so far the tests don't. They just use whatever
> directory the file is in. So, for example, we have:
>
> from tests import fs_helper
>
> where 'tests' is the subdir in test/py
>
> One option would be to move the pytests up a directory, with test.py
> in test/ and the other python files in test/u-boot and the tests in
> test/pytests or something like that.
>
> Then we would have:
>
> from tests import some_file (*)
>
> like we do in tools
>
> Also, I wouldn't call this 'massive' churn. Most files just have a
> line or two changed, with test.py and test_ut.py getting more.
>
> >
> > A lot more of this type of namespace shortening which I believe is the
> > normal Python-way of solving this issue.
>
> It doesn't really, since 'util' might conflict with something. When
> you have a set of related Python files, as with do in test/py it is
> better to use a namespace. But even then, I think we would want a
> shorter name.
Yes, I suppose I'd rather see (and without the ubpy rename, one thing at
a time please!) moving files around such that we can then do more normal
"from foo import bar", and also avoid the silly thing of "import utils
at util" ;)
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2025-01-25 22:58 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-25 21:31 [PATCH 0/4] test: A few quality-of-life improvements Simon Glass
2025-01-25 21:31 ` Simon Glass
2025-01-25 21:31 ` [PATCH 1/4] test/py: Shorten u_boot_console Simon Glass
2025-01-25 21:50 ` Tom Rini
2025-01-25 21:50 ` Tom Rini
2025-01-25 22:42 ` Simon Glass
2025-01-25 22:42 ` Simon Glass
2025-01-25 22:55 ` Tom Rini
2025-01-25 22:55 ` Tom Rini
2025-01-25 22:58 ` Simon Glass
2025-01-25 22:58 ` Simon Glass
2025-02-03 6:04 ` Love Kumar via Linux-erofs
2025-02-03 6:04 ` Love Kumar
2025-02-09 14:29 ` Simon Glass
2025-02-09 14:29 ` Simon Glass
2025-01-25 21:31 ` [PATCH 2/4] test: Drop u_boot_ prefix on test files Simon Glass
2025-01-25 21:46 ` Tom Rini
2025-01-25 22:41 ` Simon Glass
2025-01-25 22:57 ` Tom Rini [this message]
2025-01-25 22:59 ` Simon Glass
2025-01-25 21:31 ` [PATCH 3/4] test/py: Show info about module-loading Simon Glass
2025-01-25 21:43 ` Tom Rini
2025-01-25 23:00 ` Simon Glass
2025-01-25 23:02 ` Tom Rini
2025-01-25 23:39 ` Simon Glass
2025-01-25 23:53 ` Tom Rini
2025-01-25 21:31 ` [PATCH 4/4] test: Make net tests depend on CONFIG_CMD_NET Simon Glass
2025-01-25 21:44 ` Tom Rini
2025-01-25 22:47 ` Simon Glass
2025-01-25 22:50 ` Tom Rini
2025-01-25 22:56 ` Simon Glass
2025-01-25 23:00 ` Tom Rini
2025-02-15 13:02 ` Simon Glass
2025-02-15 14:37 ` Tom Rini
2025-02-15 17:21 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250125225756.GK60249@bill-the-cat \
--to=trini@konsulko.com \
--cc=andrew.goodbody@linaro.org \
--cc=caleb.connolly@linaro.org \
--cc=ddrokosov@salutedevices.com \
--cc=glaroque@baylibre.com \
--cc=igor.opaniuk@gmail.com \
--cc=jens.wiklander@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=jmasson@baylibre.com \
--cc=love.kumar@amd.com \
--cc=michal.simek@amd.com \
--cc=mkorpershoek@baylibre.com \
--cc=padmarao.begari@amd.com \
--cc=patrick.rudolph@9elements.com \
--cc=pbrobinson@gmail.com \
--cc=richard@nod.at \
--cc=semen.protsenko@linaro.org \
--cc=sjg@chromium.org \
--cc=tharvey@gateworks.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.