4 ms·
>Serving the needs of python developers vs. sysadmins is a false dichotomy. Python developers develop on a system that they need to admin. I couldn't disagree
by simonh 5y ago
>Serving the needs of python developers vs. sysadmins is a false dichotomy. Python developers develop on a system that they need to admin.
I couldn't disagree more. Even if the same person is admining a system they develop on, they almost certainly aren't going to admin the systems their users deploy on. The admin role and developer role should be completely separate with different goals and requirements.
The system Python should only be used for system scripts. The end. Nowadays ideally it shouldn't even be visible to non-admin user accounts, and users certainly shouldn't be installing packages into the python being used by system scripts, not even using virtual envs.
The python your system uses and how it's configured should be decided by the distro. If they want to break it up into weird packages and funky paths, whatever. That's their problem because they and maybe (_maybe_) system admins should be the only people using it.
As a developer you should be making your own decision about which version of Python you are using, what modules get installed into it, what venvs you have and how you manage them. This should all be considered with one eye firmly fixed on the target deployment environment and how your Python will be configured there. The right answer, of course, being that you should be packaging the required python along with the application.
- rolandog 5y agoInteresting; how would you isolate the system python from the user in Debian/Ubuntu. Do you have a link where I could learn more about this?
- pas 5y agoDon't put the system python in $PATH. Any command that needs the system python can be launched through a shim/wrapper script that sets the PATH. (Or even better to execute python directly to avoid passing the system python in PATH.)
- rolandog 5y agoWow. It never occurred to me to approach it that way, thanks!
- simonh 5y agoYou may not be able to completely, but basically if users can write python scripts and run them using system python that's a side effect. It's purpose is to run system scripts, and any other use must not interfere or compete with that in any way. To be hones that wasn't always the case. In the early days Python was provided on these systems for users just as much as administrators and in the early days there weren't any system script as part of the OS that used it. However now there are, and the packaging and configuration of the system python has in some cases even been mangled somewhat to suit the needs of the distro. It's time to make a clean split between system python and user/developer python.
- dagw 5y agoI would start by putting it in a path that won't be included in the users default $PATH, perhaps /sbin or /usr/sbin
- rolandog 5y agoOoh, this sounds quite nice. And it would also be compliant with the Filesystem Hierarchy Standard.
- orev 5y agoThis is exactly the approach RHEL has taken with version 8. Typing ‘python’ results in ‘command not found’. All the system tools that use python are set to use a custom path dedicated for those tools.