What are our thoughts on still having tests of Pyt...
# development
f
What are our thoughts on still having tests of Python 2.7 in Pants? Motivation for this question is that I upgraded CI in a PR to use ubuntu-22.04 instead of the ubuntu-20.04 image (since I need a newer image for the tonic/hyper upgrade PR), but Python 2.7 is intentionally no longer provided in GitHub images. And the
actions/setup-python
action refuses to install 2.x versions. https://github.com/pantsbuild/pants/actions/runs/10492075946/job/29063241372#step:5:22. So if we want continued ability to test with Python 2.7, sort of on our own to supply the installation method.
p
I believe the PEX repo does something to download unsupported python versions like this. Maybe we can look at the CI setup there. I lean towards continuing to support 2.7.
f
The pex repo appears to build a Docker image with all of the Pythons in it. https://github.com/pex-tool/pex/blob/main/docker/base/Dockerfile
and then uses
tox
to drive the build
Seems like the base image is published to
<http://ghcr.io/pex-tool/pex/base|ghcr.io/pex-tool/pex/base>
I could copy that over to pantsbuild and see about publishing an image for use by Pants CI.
although one complication which comes to mind is our
docker_environment
tests since now it would be docker-in-docker when those tests run
w
If I can ask a silly question. Do we know if we have users who are still using Python 2.7 while also upgrading Pants versions regularly?
f
I don’t know offhand. Frankly I’d rather we drop Python 2.7 support.
If someone actually needs such support, they should fund the work.
Or at the very least, just stop testing against 2.7.
w
https://github.com/pantsbuild/pants/issues/21074 Not directly related, but relevant. When we drop support for older OS versions and the different mechanisms to do it. I’m generally fine with something that is a time or cost burden, that is not obviously used by a large chunk of the user base, to be gracefully sunset (when it, itself, is considered deprecated or not being updated)
The flip side being - if there is a lot of usage, or if it was sponsored - naturally we would keep it
f
I don't entirely agree with the flip side. If others maintain it or sponsor it, then great, but if continuing such support gets in the way of upgrading other parts of our stack, then I'm inclined to ditch it absent such maintenance or support.
(and in this case, it is getting in the way of upgrading tonic and hyper)
w
Fair point
f
someone wrote a replacement for
actions/setup-python
which can install Python 2.7 via pyenv: https://github.com/LizardByte/setup-python-action
one way forward: confine Python 2.7 tests to a single test shard and only that shard has Python 2.7 installed
h
Maybe the user survey we discussed should check for any extant use of 2.7 to inform a decision
but I am general in favour of dropping explicit support for 2.7
If we do find someone who still needs it, they can consider funding it
f
Maybe the user survey we discussed should check for any extant use of 2.7 to inform a decision
good point
h
And of 3.7 for that matter…
I think “support for old versions” can be a feature an org can pay for
f
in the meantime, if I can confine the Python 2.7 tests to a single shard with a Docker container, then I can avoid the more general Docker-in-Docker problems if we had to run Docker backend tests in a Docker container
h
but the community cannot continue to support that sort of thing indefinitely
f
> but the community cannot continue to support that sort of thing indefinitely What would be a good way forward within the project to get consensus on ending support for EOL Python versions?
at the very least, I imagine a policy statement outlining the project's stance and for how long after EOL we continue support
and we would need to define "support" - i.e., do we stop testing on that version but allow an EOL version in interpreter constraints with a warning? or something more (error on EOL versions)?
p
I changed my mind. I'm ok with dropping 2.7 and 3.7. If someone needs it, they can use an older version of pants or pay someone (as you said).
f
I can wait on my tonic/hyper PR until we branch
2.23.x
from
main
. Maybe then we deprecate 2.7 support in 2.23 and stop testing it in 2.24? Or should we give more notice?
w
If someone needs it, they can use an older version of pants or pay someone (as you said).
I mean, the other thing here is that, they can just stay on certain Pants versions - at least into 2.23ish timelines, and maybe even further. Some of my clients are still happily on 2.17 or whatever I left them at if they didn't feel like upgrading 🤷
h
True, if they are on an ancient version of Python, an ancient version of Pants is not likely to intimidate