Deprecate Python 2 installations#28003
Conversation
|
@spackbot maintainers |
trws
left a comment
There was a problem hiding this comment.
This looks good to me. It's unfortunate that we'll keep supporting 2.7, but that's reality for the moment I suppose. The actual change makes me think having a way to make a deprecation viral might be valuable though, all of the changes outside of python itself are really just side-effects right?
|
Does this mean python2 won't install no-matter-what, or that we'll have to pass extra flags to support an installation? I have a legacy application I help that refuses to move off of python2 due to various reasons. I've been building that application with spack as it has over 100 dependencies, but it would be a shame if I had to migrate away from spack. |
|
@trws Correct, all changes to packages other than Python are simply a result of the changes to Python. These changes do propagate to other packages in the sense that if you try to install one of these packages that requires Python 2, Spack will prompt you with a warning that the version is deprecated and ask for confirmation before installing. @rblake-llnl Once this PR is merged, you'll still be able to build with Python, but you'll either need to manually type "Y" to confirm that you want to install with a deprecated version or pass the |
|
@spackbot run pipeline |
|
I've started that pipeline for you! |
|
I've started that pipeline for you! |
|
I'm 100% fine with this for affected packages that I contributed to. |
|
No objections from my side on deprecating 3.x versions of |
|
🤔 |
12f7118 to
7fcdfb5
Compare
|
As of today, Python 3.6 is also deprecated. I went through all packages again and deprecated a few more. Maintainers on these new packages who may want to see this PR: @RemiLacroix-IDRIS @ax3l @skosukhin |
|
I'm fine with removing python 2 support. If necessary, I am happy to use latest Spack releases with python 2 support. |
|
@adamjstewart: So Regarding the VAPOR package that got me notified, I'm a bit annoyed as it is still being used on our cluster even though it currently requires Python 3.6. VAPOR is still maintained so hopefully they will release new versions that support newer Python versions eventually... |
See the docs for details. Once a version is marked as
Actually, according to NCAR/VAPOR#1822, it seems like they might already support Python 3. Can you investigate this? |
They do support Python 3.6 but last time I checked VAPOR failed to compile with Python 3.7+. I will try again. But anyway there is still a bit of time before VAPOR gets actually removed from Spack. |
7fcdfb5 to
4dfc26e
Compare
|
Is this going to affect bootstrapping from source on distros (like RHEL8) where the system python is 3.6? Not sure why that CI test was skipped here. |
|
@alalazo would know better than me, but I'm guessing that it won't be an issue. Users should still be able to use externally installed Python 3.6 (or even Python 2) and build packages with it, although we may remove Python 2-only dependencies from packages someday (especially backports that are deprecated here). |
|
@tgamblin The rhel8 test is generally skipped in PRs that modify only package recipes. The rationale is that changing a recipe shouldn't affect which Python interpreter can be used to run Spack. |
9ccc775 to
e410cbd
Compare
|
If it makes things easier to review/merge I can remove all changes to packages other than Python. Just wanted people to get an idea of which packages would be affected by this deprecation and get a list of people to ping for review. |
cosmicexplorer
left a comment
There was a problem hiding this comment.
This seems like a really good change!
sethrj
left a comment
There was a problem hiding this comment.
Looks good! Let the deprecations continue!
|
Sorry I am not a big noise here but this is quite a bad problem in my eyes. Python2 may be dead in some areas but unfortunately it is still very much in use in some areas. Just as much software depended on fortran 77 for many years there is plenty of software that hasn't been updated and won't be for some considerable time (mostly because there isn't money, this doesn't mean the software isn't useful. Grants aren't always easy to get especially if you just want to update to a new version of python that isn't sexy as far as funders are concerned...). Also we have a duty as a scientific community to be able to reproduce our results. In the UK the timescales for this are at least 10 years (this is how long scientific projects are required to maintain their data and still be able to analyse it to prove reproducibility and accuracy). Now I could understand saying that all versions except 2.7.18 are deprecated as almost all 2.x software will run on 2.7.18 and this reduces the testing space by a large area. As a positive example ARIA a program used to calculate many NMR Structures in the PDB is still a 2.7 code base... Xplor also very much used in the NMR structural community has only just gone python3. I am a CoI on the ccpn project (though I speak in a personal position here) https://ccpn.ac.uk they have a new python3 software but still have python2 legacy software. Also if spack were a fully mature piece of software this would be ok, but I am just having to move from 0.16 to 0.17 to get around bugs in new packages I am writing. what happens when the fix is in 0.19, I presume I just give up. I hope I am not sounding disruptive just worried, I have spent a lot of time investing in learning how to use spack because of its flexibility and because it didn't kill my installs like home-brew by removing version will nilly. I can still compile programs with really ancient versions of gcc with spack if need be why should I not be able to work with old version of python? |
Offer still stands 😃 From my perspective, I understand your concerns, and if this was as simple as keeping the I think the biggest problem with Python is that much like Spack is still a work in progress, so is Python's build system. The "best practice" instructions for writing and building Python packages have changed so much in the last 2 years that it's been hard for me to keep up with. If we want to keep up with these changes, it will become increasingly difficult if we also need to support EOL versions of Python. Spack is one of the only package managers in existence that I know of that lets you install something that isn't the latest version of a package. Homebrew and others may have separate packages for major version changes (python2 and python3) but none of them let you pick which version of Python 2 or 3 you get. Spack is trying to solve a much more difficult problem (how do we install every version of a package). Without deprecating old EOL software, this problem becomes intractable. |
* Deprecate Python 2 installations * Deprecate py-python-meep * Deprecate older easybuild backend libs * Deprecate Python 3.6 * Deprecate miniconda2
Just to note, If there's still a substantial number of users trapped on Python 2 due to the unfortunate reality of grant funding priorities, you could consider making 0.17 a LTS branch maintained by a separate team that accepts bug and security fixes on a best-effort basis. That's more or less what distros like Debian do. |
This reverts commit 7b76e39.
|
For anyone following this discussion, we decided to revert this PR. Thanks to @scheibelp and @varioustoxins for volunteering to help maintain Python 2 support in Spack! I definitely still encourage users to request that packages that still require Python 2 be ported to Python 3, but many packages are no longer maintained yet are still needed for reproducing experiments. If anyone has time to volunteer, tools like 2to3 make it relatively easy to port software libraries from Python 2 to 3. |
This reverts commit 7b76e39.
* Deprecate Python 2 installations * Deprecate py-python-meep * Deprecate older easybuild backend libs * Deprecate Python 3.6 * Deprecate miniconda2
This PR deprecates using Spack to install [EOL Python versions](https://endoflife.date/python), including Python 2.7, 3.1–3.6. It also deprecates running Spack with Python 2.7. Going forward, we expect Spack to have the following Python support timeline. ### Running Spack * Spack 0.18 (spring 2022): Python 2.7, 3.5–3.10 * Spack 0.19 (fall 2022): Python 2.7 (deprecated), 3.6–3.11 * Spack 0.20 (spring 2023): Python 3.6–3.11 ### Building with Spack * Spack 0.18 (spring 2022): Python 2.7, 3.1–3.10 * Spack 0.19 (fall 2022): Python 2.7, 3.1–3.6 (deprecated), 3.7–3.11 * Spack 0.20 (spring 2023): Python 3.7–3.11 This is a reboot of #28003. See #31824 for a detailed discussion of the motivation for this PR. If you have concerns about this change, please comment on #31824.
This PR removes [end of life](https://endoflife.date/python) versions of Python from Spack. Specifically, this includes all versions of Python older than 3.7. See #31824 for rationale. Deprecated in #32615. And #28003. For anyone using software that relies on Python 2, you have a few options: * Upgrade the software to support Python 3. The `3to2` tool may get you most of the way there, although more complex libraries may need manual tweaking. * Add Python 2 as an [external package](https://spack.readthedocs.io/en/latest/build_settings.html#external-packages). Many Python libraries do not support Python 2, but you may be able to add older versions that did once upon a time. * Use Spack 0.19. Spack 0.19 is the last release to officially support Python 3.6 and older * Create and maintain your own [custom repository](https://spack.readthedocs.io/en/latest/repositories.html). Basically, you would need a package for Python 2 and any other Python 2-specific libraries you need.
This PR removes [end of life](https://endoflife.date/python) versions of Python from Spack. Specifically, this includes all versions of Python older than 3.7. See spack#31824 for rationale. Deprecated in spack#32615. And spack#28003. For anyone using software that relies on Python 2, you have a few options: * Upgrade the software to support Python 3. The `3to2` tool may get you most of the way there, although more complex libraries may need manual tweaking. * Add Python 2 as an [external package](https://spack.readthedocs.io/en/latest/build_settings.html#external-packages). Many Python libraries do not support Python 2, but you may be able to add older versions that did once upon a time. * Use Spack 0.19. Spack 0.19 is the last release to officially support Python 3.6 and older * Create and maintain your own [custom repository](https://spack.readthedocs.io/en/latest/repositories.html). Basically, you would need a package for Python 2 and any other Python 2-specific libraries you need.
NOTE: To clarify, this PR does not affect which versions of Python can be used to run Spack. Spack will continue to support Python 2.7 and 3.5-3.6 for the foreseeable future. This PR only affects which versions of Python Spack can install.
Contents
This PR deprecates versions of Python that have reached end-of-life. It also deprecates versions of other packages that require deprecated versions of Python. This is in the hopes that maintainers of those packages get pinged on this PR and offer feedback. This PR does not deprecate versions of packages that optionally require deprecated versions of Python (if I could deprecate a specific version/variant combo I would). This PR also does not deprecate versions of packages that rely on deprecated versions of package. I'm hoping that maintainers of those packages will notice this once it is merged. Once these versions are deprecated and a 0.18.0 release comes out, these versions/packages can be removed.
Rationale
Python 2 has been unsupported for almost 2 years, and many of the Spack packages that rely on Python 2 either don't concretize, can't be downloaded, or haven't had a new release in over 10 years. When working on large PRs like #27798, it becomes exceedingly difficult to maintain support for Python 2 and test it properly. If any of these packages/versions are present in a DAG/environment, Spack will install an unsupported version of Python without warning. I don't believe this is safe behavior, and we should work towards deprecating/removing unsupported Python versions.
Discussion
For anyone who has stumbled upon this PR or was automatically pinged, I would welcome feedback on this PR. This PR is not a hard requirement but a request. For anyone who absolutely needs Python 2 or 3.5-3.6 support, I'm willing to keep it, but I would ask that you add yourself as a maintainer for the Python package so that you can help review PRs like #27798. Also, for any of the packages where all versions have been deprecated, if you are aware of a newer release that adds Python 3 support, let me know and I can add it to the package. Otherwise, packages that only support Python 2 will be removed after the next release.
Closes #28022