Should `python` point to python3?

The python attribute currently points to python2.

Should this be updated to point to python3 at some point? Or are python2 and python3 so different that derivations should just always be explicit about which version they need, and avoid python?

Assuming we want to keep python and want to point it to python3 at some point, what does the road to get there look like? Should we make a “big-bang” switch and fix any packages that are broken (either by actually-fixing them or by requiring python2 explicitly for those)? Or should we gradually move, and start having derivations that don’t care about the python version to depend on python3? In the latter case, should we update the derivations to take python3 as a parameter instead of python, or should we change all-packages.nix to pass python3 as the python parameter of such derivations?

2 Likes

As far as I remember there has been some announcement during August or September that the python attribute will remain python 2 forever for compatibility reasons.

Ah, I searched around a bit and didn’t find it. So that means the python attribute is effectively deprecated and we should prefer the python3 attribute (or, if we must, explicitly python2)?

1 Like

Yeah, I was as well unable to find it as well, I’m sure that @jonringer posted it, though I’m not sure anymore, at least he confirmed my understanding of that post in the discord a while ago (a couple of weeks).

Perhaps this ping is enough for him to dig up the post for us?

There’s still many (but getting fewer) places which refer to python2. Once python2 has been removed, then we will probably alias python to be python3

That makes sense.

In the mean time, for packages that work with both python2 and python3, should we:

  • change the derivation to expect python3 rather than python, or
  • keep python in the derivation and pass python = python3 in all-packages.nix?

I have a preference toward referring to python3 explicitly. It makes it easier to grep for references to just python