From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: erichiggins@gmail.com
Cc: James Hilliard <james.hilliard1@gmail.com>,
Marcus Hoffmann <marcus.hoffmann@othermo.de>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] utils/scanpypi: supply package name to setup() when not provided
Date: Sun, 18 Sep 2022 18:00:29 +0200 [thread overview]
Message-ID: <20220918160029.GD1127102@scaer> (raw)
In-Reply-To: <CAHfxMJ6GD6EaJYHw_QzbiRKAoFBwV+_9Aym4sGBgSqmd5906JQ@mail.gmail.com>
Eric, All,
On 2022-09-12 14:34 -0700, erichiggins@gmail.com spake thusly:
> Yann,
> I did a write up w/ the justification for this change in this Github gist
> [1]https://gist.github.com/erichiggins/223b2495ada64001c44deedd3a3df6ed
> Hopefully that provides the necessary info, but I'm happy to copy/paste it here if you need it for the mailing list record.
Please, resubmit this change with the appropriate explanations from your
gist if that makes sense, reformatted as a proper commit log;
1. describe the issue
2. explain why it happens
3. explain how you fixed it (don't describe the code, explain it).
Regards,
Yann E. MORIN.
> On Mon, Sep 12, 2022 at 2:05 PM Marcus Hoffmann < [2]marcus.hoffmann@othermo.de> wrote:
>
> Yann, Eric,
>
> On 12.09.22 22:34, Yann E. MORIN wrote:
> > Eric, All,
> >
> > +James for his expertise in that file
> >
> > On 2022-09-12 09:28 -0700, [3]erichiggins@gmail.com spake thusly:
> >> Signed-off-by: Eric Higgins < [4]erichiggins@gmail.com>
> >
> > Thanks for this patch.
> >
> > However, this will need a bit more explanations in the commit log. Start
> > by describing the issue, explain why that happens, and how it is fixed.
> >
> > You can get an idea of how to structure that by looking at existing
> > commit logs: git log utils/scanpypi
> >
> >> ---
> >> utils/scanpypi | 6 ++++--
> >> 1 file changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/utils/scanpypi b/utils/scanpypi
> >> index 452b4a3fc3..a5522a879e 100755
> >> --- a/utils/scanpypi
> >> +++ b/utils/scanpypi
> >> @@ -58,8 +58,9 @@ def setup_decorator(func, method):
> >> def closure(*args, **kwargs):
> >> # Any python packages calls its setup function to be installed.
> >> # Argument 'name' of this setup function is the package's name
> >
> > So, this comment states that setup() is called with 'name' argument, but
> > what your commit title implies is that it is not always true. So, this
> > comment is now incorrect, and must be amended apropriately.
> >
> > Could it be that sometimes, 'name' is a keyword argument, and in some
> > other case, it is just a positional argument?
>
> I can offer an example of where the existing script goes wrong:
>
> [5]https://github.com/Pylons/waitress/blob/73fe701cba0b37dc6099858b064cb1e755e83e9e/setup.py
>
> No arguments passed at all. `name` (like anything else) in this case is
> read from the accompanying setup.cfg file (in medium-modern python
> packaging world):
>
> [6]https://github.com/Pylons/waitress/blob/73fe701cba0b37dc6099858b064cb1e755e83e9e/setup.cfg#L2
>
> This is explained for example here:
> [7]https://towardsdatascience.com/setuptools-python-571e7d5500f2
>
> In the even more modern world the same info is specified in
> pyproject.toml instead:
>
> [8]https://github.com/agronholm/apscheduler/blob/49344e6954559259beb336436a45698d62eed5b4/pyproject.toml#L2-L9
>
> But I think it's easiest and correct to use the name specified on the
> cli instead for us.
>
> >
> >> - BuildrootPackage.setup_args[kwargs['name']] = kwargs
> >> - BuildrootPackage.setup_args[kwargs['name']]['method'] = method
> >> + name = kwargs.get('name', BuildrootPackage.setup_args['name'])
> >> + BuildrootPackage.setup_args[name] = kwargs
> >> + BuildrootPackage.setup_args[name]['method'] = method
> >> return closure
> >>
> >> # monkey patch
> >> @@ -147,6 +148,7 @@ class BuildrootPackage():
> >> self.url = None
> >> self.version = None
> >> self.license_files = []
> >> + self.setup_args['name'] = self.real_name
> >
> > Otherwise, I do understand what the code does, and I think this is the
> > correct solution. James, your opinion?.
> >
> > Still, what is missing is an explanation on why this change is needed. >
> > Regards,
> > Yann E. MORIN.
> >
> >> def fetch_package_info(self):
> >> """
> >> --
> >> 2.25.1
> >> _______________________________________________
> >> buildroot mailing list
> >> [9]buildroot@buildroot.org
> >> [10]https://lists.buildroot.org/mailman/listinfo/buildroot
> >
>
> Links:
> 1. https://gist.github.com/erichiggins/223b2495ada64001c44deedd3a3df6ed
> 2. mailto:marcus.hoffmann@othermo.de
> 3. mailto:erichiggins@gmail.com
> 4. mailto:erichiggins@gmail.com
> 5. https://github.com/Pylons/waitress/blob/73fe701cba0b37dc6099858b064cb1e755e83e9e/setup.py
> 6. https://github.com/Pylons/waitress/blob/73fe701cba0b37dc6099858b064cb1e755e83e9e/setup.cfg#L2
> 7. https://towardsdatascience.com/setuptools-python-571e7d5500f2
> 8. https://github.com/agronholm/apscheduler/blob/49344e6954559259beb336436a45698d62eed5b4/pyproject.toml#L2-L9
> 9. mailto:buildroot@buildroot.org
> 10. https://lists.buildroot.org/mailman/listinfo/buildroot
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-09-18 16:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 16:28 [Buildroot] [PATCH 1/1] utils/scanpypi: supply package name to setup() when not provided erichiggins
2022-09-12 20:34 ` Yann E. MORIN
2022-09-12 21:05 ` Marcus Hoffmann
2022-09-12 21:34 ` erichiggins
2022-09-18 16:00 ` Yann E. MORIN [this message]
2022-09-18 19:32 ` erichiggins
-- strict thread matches above, loose matches on Subject: below --
2022-09-18 19:48 erichiggins
2023-08-26 21:39 ` Thomas Petazzoni via buildroot
2023-08-27 7:03 ` James Hilliard
2023-08-27 21:28 ` erichiggins
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=20220918160029.GD1127102@scaer \
--to=yann.morin.1998@free.fr \
--cc=buildroot@buildroot.org \
--cc=erichiggins@gmail.com \
--cc=james.hilliard1@gmail.com \
--cc=marcus.hoffmann@othermo.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.