Aside RE: Re: macaddress or networkaddress module
As an aside I have a perfect example to back up what Paul is saying below. I work for a large corporation where developers are permitted to install python modules on their development machines, (subject to some licence restrictions), but the proxy settings required to get to PyPi vary from user to user, site to site, day to day (sometimes hour to hour) and connection type to connection type, e.g. If you are connected via WiFi you need to use a different proxy to that needed if you are on a wired connection and on a VPN (we have more than one in use) different again. To help with this I have put together a script that will try pip, if it fails will check the current location for pac.pac, get and parse it for proxies, correct a common incompatibility and then try each discovered proxy and if sill none work fall back to a list of common proxies. Once it finds a working setting it advises the user what to use in the current situation. Obviously, since the script is intended to work out how to get to PyPi, I needed to stick 100% to the standard libraries. -----Original Message----- From: Paul Moore <p.f.moore@gmail.com> Sent: 06 April 2020 09:11 To: Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> Cc: Pete Wicken <petewicken@gmail.com>; Python-Ideas <python-ideas@python.org> Subject: [Python-ideas] Re: macaddress or networkaddress module On Mon, 6 Apr 2020 at 04:14, Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
That's OK for developers on their "own" machines, but I think there are still a lot of folks who need approval from corporate (though I haven't heard from Paul Moore on that theme in quite a while, maybe it's gotten better?)
Howdy :-) It's actually got a bit worse, to the point where I don't bother trying to fight the system as much any more, so things have gone quieter because of that :-) But yes, I still believe that there are important use cases for code that only uses the stdlib, and "not being able to get to the internet" is a valid use case that we shouldn't just dismiss. On the other hand, with regard to the comment you were replying to:
Up to around a decade ago, installing third-party libraries > was a huge mess, but nowadays, PyPI works, Python comes with pip > pre-installed, and telling developers they need internet access > when they first start a new project isn’t considered onerous.
I think all of that is true. What I think is more important, though, is around things that aren't so much "projects" as "scripts", and that *distributing* such scripts that depend on 3rd party libraries is still problematic. Here, I'm not talking about making full-fledged packages, or py2exe style fully bundled apps, but "here's this monitoring script I wrote, let's ship it across 10 production systems and why don't you try it out on your dev boxes?" There's a *significant* step change in complexity between doing that if the script depends on just the stdlib, versus if it depends on a 3rd party module. And we don't have a really good answer to that yet (zipapps, and tools like shiv that wrap zipapps, are pretty good in practice, but they are not well known or commonly used). Paul _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/5BN5DA... Code of Conduct: http://python.org/psf/codeofconduct/
Yeah, that's almost exactly the situation I have - although I haven't been as clever as to write a script, I just manually change the proxy settings when needed. Plus, we use an NTLM proxy, so you need CNTLM installed to get to PyPI at all. So not something a casual developer will have (Python isn't core to our team's role, so it's only people like me doing automation and data analysis work who have the necessary stuff set up). Paul On Mon, 6 Apr 2020 at 09:36, Steve Barnes <GadgetSteve@live.co.uk> wrote:
As an aside I have a perfect example to back up what Paul is saying below. I work for a large corporation where developers are permitted to install python modules on their development machines, (subject to some licence restrictions), but the proxy settings required to get to PyPi vary from user to user, site to site, day to day (sometimes hour to hour) and connection type to connection type, e.g. If you are connected via WiFi you need to use a different proxy to that needed if you are on a wired connection and on a VPN (we have more than one in use) different again.
To help with this I have put together a script that will try pip, if it fails will check the current location for pac.pac, get and parse it for proxies, correct a common incompatibility and then try each discovered proxy and if sill none work fall back to a list of common proxies. Once it finds a working setting it advises the user what to use in the current situation.
Obviously, since the script is intended to work out how to get to PyPi, I needed to stick 100% to the standard libraries.
-----Original Message----- From: Paul Moore <p.f.moore@gmail.com> Sent: 06 April 2020 09:11 To: Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> Cc: Pete Wicken <petewicken@gmail.com>; Python-Ideas <python-ideas@python.org> Subject: [Python-ideas] Re: macaddress or networkaddress module
On Mon, 6 Apr 2020 at 04:14, Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
That's OK for developers on their "own" machines, but I think there are still a lot of folks who need approval from corporate (though I haven't heard from Paul Moore on that theme in quite a while, maybe it's gotten better?)
Howdy :-)
It's actually got a bit worse, to the point where I don't bother trying to fight the system as much any more, so things have gone quieter because of that :-) But yes, I still believe that there are important use cases for code that only uses the stdlib, and "not being able to get to the internet" is a valid use case that we shouldn't just dismiss.
On the other hand, with regard to the comment you were replying to:
Up to around a decade ago, installing third-party libraries > was a huge mess, but nowadays, PyPI works, Python comes with pip > pre-installed, and telling developers they need internet access > when they first start a new project isn’t considered onerous.
I think all of that is true. What I think is more important, though, is around things that aren't so much "projects" as "scripts", and that *distributing* such scripts that depend on 3rd party libraries is still problematic. Here, I'm not talking about making full-fledged packages, or py2exe style fully bundled apps, but "here's this monitoring script I wrote, let's ship it across 10 production systems and why don't you try it out on your dev boxes?" There's a *significant* step change in complexity between doing that if the script depends on just the stdlib, versus if it depends on a 3rd party module. And we don't have a really good answer to that yet (zipapps, and tools like shiv that wrap zipapps, are pretty good in practice, but they are not well known or commonly used).
Paul _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/5BN5DA... Code of Conduct: http://python.org/psf/codeofconduct/
On Mon, 6 Apr 2020 at 09:40, Steve Barnes <GadgetSteve@live.co.uk> wrote:
As an aside I have a perfect example to back up what Paul is saying below. I work for a large corporation where developers are permitted to install python modules on their development machines, (subject to some licence restrictions), but the proxy settings required to get to PyPi vary from user to user, site to site, day to day (sometimes hour to hour) and connection type to connection type, e.g. If you are connected via WiFi you need to use a different proxy to that needed if you are on a wired connection and on a VPN (we have more than one in use) different again.
FYI there's an issue open on pip to allow for multiple proxies. I have this exact situation as well. https://github.com/pypa/pip/issues/8232 -- Kind regards, Stefano Borini
On Thu, 13 Aug 2020 at 22:22, Stefano Borini <stefano.borini@gmail.com> wrote:
On Mon, 6 Apr 2020 at 09:40, Steve Barnes <GadgetSteve@live.co.uk> wrote:
As an aside I have a perfect example to back up what Paul is saying below. I work for a large corporation where developers are permitted to install python modules on their development machines, (subject to some licence restrictions), but the proxy settings required to get to PyPi vary from user to user, site to site, day to day (sometimes hour to hour) and connection type to connection type, e.g. If you are connected via WiFi you need to use a different proxy to that needed if you are on a wired connection and on a VPN (we have more than one in use) different again.
FYI there's an issue open on pip to allow for multiple proxies. I have this exact situation as well.
Even though this conversation references the situation I described initially, I'm against adding more complexity to how tools like pip deal with the network. That simply isn't scalable - every tool ends up having to implement the same set of options, configuration, etc. My point was challenging the statement that "if the stdlib were designed from scratch today rather than over the past 30 years, I think it would have less than it does, not more". It may be true, but IMO it would be a mistake, and would have definitely damaged Python's popularity - the "batteries included" philosophy is a *huge* selling point in many environments, that aren't immediately obvious to people who have the luxury of easy and permanent access to the internet. I'm not against pushing people to publish libraries on PyPI (I've done that myself many times) but that doesn't mean I support omitting important functionality from the stdlib "because you can get it from PyPI". The tricky bit is deciding what's important :-) (Off topic, but IMO the scalable solution to the whole proxy/network access issue, is to have core Python integrate directly with platform networking, so that if your browser can see a webpage, then so can Python. Then tools don't need *any* proxy configuration, you just set up your system and you're done. Unfortunately, that's a really hard problem due to Python's reliance on openssl, which doesn't integrate and has an API that isn't easily emulatable with platform libraries - at least, as I understand it from the people who are looking at these sorts of things, I'm a long way from an expert in networking). Paul
participants (3)
-
Paul Moore
-
Stefano Borini
-
Steve Barnes