← Back to context

Comment by zelphirkalt

2 days ago

> Python scripts last 6-12 months.

Not, if you know what you are doing.

"You're holding it wrong" ;-)

  • Every Python version is officially supported for 5 years. Tons of useful scripts don't require any dependencies outside the standard library, and I have code from very many years ago that has not been hit by any standard library deprecations (which have been in relatively obscure corners, honestly) and would work fine under current Python. (Of course, it helps that I was a relatively early 3.x adopter.) Conversely, what I write today should generally be backwards-compatible to 3.6 (f-strings are really neat, and `pathlib` semantics greatly improved in that version).

  • I mean, if you are not able to make a reproducible virtual environment, by using one of the popular package managers, like Poetry or uv, then yes, you are holding it wrong. If you are relying on requirements.txt merely pinning versions and not transitive dependencies, then yes, you are holding it wrong. In that case it would be a skill issue.

    • > If you are relying on requirements.txt merely pinning versions and not transitive dependencies, then yes, you are holding it wrong.

      Even then, if you have the original environment, you may very well not need to re-create it. If you do need to re-create an equivalent for a newer Python version (EOL versions of Python don't just spontaneously vanish, but maybe you upgraded your system or something, or better yet maybe you're planning in advance for that) then you generally can easily create the needed requirements.txt (or, for that matter, a PEP 751 lockfile) from the old environment.