logoalt Hacker News

kibwentoday at 12:21 AM2 repliesview on HN

The use or adherence to semver isn't the problem here. As you say, if a package follows semver, it's easy enough for the package managers to automatically update to newer compatible versions. The problem is when you want to have two different incompatible versions of the same package `foo` in the same program, because then you have to figure out what `import foo` means. You might say "just don't do that", but that package could be an indirect dependency of several of your direct dependencies. Some languages handle this natively, e.g. in Rust it just works if you have multiple versions of the same library in different parts of your dependency tree (and you'll get a compilation error if you try to pass a type from one version into a function of an incompatible version). But Python does not handle this use case very well.


Replies

skeledrewtoday at 1:35 AM

> Python does not handle this use case very well

I solved this issue a few months ago. Created a tool that essentially allows the use of multiple envs at once, with their own versions of packages at any level.

show 2 replies
__mharrison__today at 2:24 AM

I'm curious. Do you have real world examples of when you want to do this?

show 2 replies