All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 2/2] utils/scanpypi: allow installation of commands without 'main' method
Date: Thu, 05 Aug 2021 22:07:38 +0200	[thread overview]
Message-ID: <877dgzk645.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20210308134542.22324-2-patrickdepinguin@gmail.com> (Thomas De Schampheleire's message of "Mon, 8 Mar 2021 14:45:40 +0100")

>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:

 > From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
 > In case the setup.py file of a python package does not directly call the
 > 'setup' method, utils/scanpypi was hoping there be a 'main' function which
 > would do the work, normally called via a construct like:

 >     if __name__ == '__main__':
 >         main()

 > However, this construct is nonstandard, and there are packages in PyPI which
 > call 'setup()' directly from the 'if' statement, without a main() method.

 > But scanpypi does not actually need to make such assumption: when loading
 > the module, it can decide the name to be '__main__', just as if setup.py
 > would be loaded interactively.

 > Additionally, remove some logic seemingly related to the previous trick of
 > calling 'main'. There should not be a problem in keeping already loaded
 > modules in sys.modules, as this is the purpose of sys.modules.

 > Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

Committed to 2021.02.x and 2021.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

  reply	other threads:[~2021-08-05 20:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 13:45 [Buildroot] [PATCH 1/2] utils/scanpypi: add setup.py script directory as sys.path[0] Thomas De Schampheleire
2021-03-08 13:45 ` [Buildroot] [PATCH 2/2] utils/scanpypi: allow installation of commands without 'main' method Thomas De Schampheleire
2021-08-05 20:07   ` Peter Korsgaard [this message]
2021-07-25 21:44 ` [Buildroot] [PATCH 1/2] utils/scanpypi: add setup.py script directory as sys.path[0] Thomas Petazzoni
2021-08-05 20:07 ` Peter Korsgaard

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=877dgzk645.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=buildroot@buildroot.org \
    --cc=patrickdepinguin@gmail.com \
    --cc=thomas.de_schampheleire@nokia.com \
    /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.