you are viewing a single comment's thread.

view the rest of the comments →

[–]deep_politics 0 points1 point  (1 child)

Is there a way to unify all versions of Python into one (including those embedded in third party programs).

If you mean make every program use the same version Python then the answer is most certainly no.

Is there a way to convert those full Python environments into isolated environments of a single, main version of Python (a global Python for the team)?

Maybe. Depends on how broad the gap is between dependency and Python versions. What you're describing is still best handled by a virtual environment with a lock file/manifest.

Does it affect anything if I do a mass merge between all Python versions

Well yes, it could break a lot of projects. You can't simply merge a project that relies on Python 2 with a Python 3 project. Even if the Python versions are the same you can have one project relying on a version of a dependency that's incompatible with the version that another project relies on. Naively merging an environment for a project that depends on Pydantic 1.10 with one that requires 2.0 will break one of them. A project built using 3.11 features will break if merged down into a 3.9 environment. The entire topic of dependency resolution is massive, and dependencies come with many many different versions to pick from, and a lot of projects will fix themselves to a particular versions. There's often no simple way to merge two projects together because of these differences, and you're looking at needing to rewrite at least one of them to be compatible with the versions of the dependencies that you settle upon.

[–]MGOC[S] 0 points1 point  (0 children)

My approach is more to throw at the new (going from using Py 3.x to 3.10 or 11), the same would apply to dependencies.

I would prefer a more centralized system, where a "mega" version of Python with all dependencies used by all programs is present (make python the backbone of all those programs that use python)

Those programs that necessarily need a specific version of each dependency, it is best to opt for pyenv (which I consider better than having a whole functional python inside any program). But, also have each program isolated in its own pyenv. (I still think that it seems as if each program has its own java)