Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-10 Thread Chris Warrick
On 9 August 2017 at 23:15, Steven D'Aprano wrote: > On Tue, Aug 08, 2017 at 12:56:56PM +0200, Chris Warrick wrote: > >> While setuptools is not officially part of the stdlib, > > This is the critical factor. How can you use *by default* something that > is *NOT* supplied by

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-09 Thread eryk sun
On Wed, Aug 9, 2017 at 11:32 PM, Alan Gauld via Tutor wrote: > On 09/08/17 22:15, Steven D'Aprano wrote: >> >> This is the critical factor. How can you use *by default* something that >> is *NOT* supplied by default? > > I have to agree with Steven here. Any mature language

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-09 Thread Alan Gauld via Tutor
On 09/08/17 22:15, Steven D'Aprano wrote: > On Tue, Aug 08, 2017 at 12:56:56PM +0200, Chris Warrick wrote: > >> While setuptools is not officially part of the stdlib, > > This is the critical factor. How can you use *by default* something that > is *NOT* supplied by default? I have to agree

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-09 Thread Steven D'Aprano
On Tue, Aug 08, 2017 at 12:56:56PM +0200, Chris Warrick wrote: > While setuptools is not officially part of the stdlib, This is the critical factor. How can you use *by default* something that is *NOT* supplied by default? Obviously you cannot. It is physically impossible. > it *is* >

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-08 Thread Chris Warrick
On 8 August 2017 at 03:30, Ben Finney wrote: > Thomas Güttler writes: > >> Why is "the sane default is 'use console_scripts entry-point in >> setup.py'" not a good answer? > > Because third-party Setuptools is required for entry points,

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-07 Thread Ben Finney
Thomas Güttler writes: > Why is "the sane default is 'use console_scripts entry-point in > setup.py'" not a good answer? Because third-party Setuptools is required for entry points, which means entry points cannot be a default choice. It may well be a good choice

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-07 Thread Thomas Güttler
Am 05.08.2017 um 06:14 schrieb Ben Finney: Thomas Güttler writes: The underlaying question is: Imangine you are a newcomer. A newcomer is in a tough position when it comes to packaging and distributing Python code, especially the command-line programs. There

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-04 Thread Ben Finney
Thomas Güttler writes: > The underlaying question is: Imangine you are a newcomer. A newcomer is in a tough position when it comes to packaging and distributing Python code, especially the command-line programs. There has been significant progress on this in

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-04 Thread Chris Warrick
On 4 August 2017 at 12:15, Thomas Güttler wrote: > Chris wrote "Simple: `scripts` are legacy." > > You say it is the standard, and console_scripts is from a third party. > > For me "legacy" sound like "don't go this old way". > > For me "third party" sounds like

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-04 Thread eryk sun
On Fri, Aug 4, 2017 at 10:15 AM, Thomas Güttler wrote: > Am 04.08.2017 um 02:50 schrieb Ben Finney: > >> Because Distutils implements only ‘scripts’, and that's not capable >> enough for what people need so Setuptools implements entry points. >> >> In other words:

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-04 Thread Thomas Güttler
Am 04.08.2017 um 02:50 schrieb Ben Finney: Thomas Güttler writes: Why are there two ways: "script" vs "console_scripts entry-point"? Because Distutils implements only ‘scripts’, and that's not capable enough for what people need so Setuptools implements entry

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread eryk sun
On Thu, Aug 3, 2017 at 4:22 PM, Chris Warrick wrote: > > Simple: `scripts` are legacy. `entry_points` are the new thing. > There’s also a third approach: gui_scripts entry_points, which work > the same way on Linux/*nix, but on Windows, it means that running your > script by

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread Ben Finney
Thomas Güttler writes: > Why are there two ways: "script" vs "console_scripts entry-point"? Because Distutils implements only ‘scripts’, and that's not capable enough for what people need so Setuptools implements entry points. In other words: One of them is in the

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread Chris Warrick
On 3 August 2017 at 09:52, Thomas Güttler wrote: > > > Am 02.08.2017 um 18:06 schrieb Wolfgang Maier: >> >> On 08/02/2017 04:57 PM, Steven D'Aprano wrote: >>> >>> On Wed, Aug 02, 2017 at 10:48:39PM +1000, Ben Finney wrote: Thomas Güttler