Hacker News new | ask | show | jobs
by pmahoney 2585 days ago
> "pip install pendulum" is not complex.

For much of the work I do, there's a _big_ jump in complexity from using python (2 or 3) and its stdlib vs. requiring a library. A script using only the stdlib is easy to distribute and get working on developer, ci, and production machines. Once an external library is required, I need machinery or scripts to manage or ensure presence of those dependencies.

2 comments

It's probably no good to you, but one of the reasons I like NixOS is the simplicity of creating single file scripts including dependencies. For example, something using Pendulum and ffmpeg together would start like this:

    #!/usr/bin/env nix-shell
    #!nix-shell -i python -p python pythonPackages.pendulum ffmpeg
Then you just put the code after that.
I love Nix and NixOS personally... but it's been a tough sell at work, unfortunately.

Even with simple shell scripts... it's so easy to invoke programs with GNU extensions and later find they fail on a co-workers macos machine. And I often have a shell.nix sitting right there that defines the complete dependency closure; very frustrating to not be able to use it.

OK that's pretty cool
It was compared to the linked article.

Besides, for time zones, you can't do otherwise: it's not in the stdlib. So compared to pytz, it's easy.

Unrelated, but I highly recommand pex for script with dependancies. It will turn it to a one file bunddle of all required modules, and all you need on the server is the same oython version.

It should be in the stdlib really.