-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default to Python 3.7 #10319
Default to Python 3.7 #10319
Conversation
I like this in principle, but I suspect that it will surprise a lot of users. I'm also not sure how robust the python 3 support is yet. Can we hold off until we can ensure that a decent subset of the python 3 packages build fine as binaries? I'm fine with having an opinion about Python as long as 3 works as well as 2, but right now I worry that we'll be enforcing this and providing a less robust default stack. |
I have a lot of information (not opinions) on this issue but no chance yet
to say much. Puthon3 is now well developed and everything works with it.
However the spack packages are often designed in a way that breaks things.
For example, there are many backports of puthon3 functionality that exist
as python2 only packages. These are listed as dependencies on packages,
and the concretizer is not smart enough to remove them as dependencies when
building with python3. I have designed a fix for this that makes it work
with both; but that fix has languished in “unofficial” land basically
forever.
Short version: if we want to make it work by default we can and will. One
day we will have to do this. The only question is timing
…On Sat, Jan 12, 2019 at 20:46 Todd Gamblin ***@***.***> wrote:
I like this in principle, but I suspect that it will surprise a lot of
users. I'm also not sure how robust the python 3 support is yet. Can we
hold off until we can ensure that a decent subset of the python 3 packages
build fine as binaries? I'm fine with having an opinion about Python as
long as 3 works as well as 2, but right now I worry that we'll be enforcing
this *and* providing a less robust default stack.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10319 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB1cdzA-76C1vA7sZjE6y6D7hQE7qgZGks5vCo_lgaJpZM4Z8RZe>
.
|
@adamjstewart Have you reviewed / incorporated #7926 in this PR? Currently, that PR is required to build Python3-based software stacks. It could be merged in a way that allows both Python2 and Python3-based stacks. If we're going to have Python3 be the default, we might wish to reverse the "sense" of #7926 so that extra variants are required for Python2. #7926 would not be needed with a better concretizer. But we don't currently have one. |
My thoughts on this: Apart from Spack, the Python3 ecosystem is rather mature. Most things that most people want to do "just work." All the "core" Python libraries work fine with Python3. I've been running a Python3 stack with Spack for 3 years, and it works great. Setting the default version of Python to 3.x in your HOWEVER... the reality is that, as it stands, Spack blows up if you just do that. Many packages work with Python2 or Python3; however, when built with Python2, they require Python2-only support libraries that are backports of standard Python3 features. The Spack packages aren't smart enough to eliminate these dependencies when building with Python3, thereby making the Spack recipe (but not the upstream Python library) not work with Python3. This issue must be ironed out before we can talk seriously about changing Python version defaults. Either we run with something like what we have in #7926; or we fix the concretizer so we can do stuff like Summary: before we can switch the default version to Python3, we need to make sure that Python3-based stacks build smoothly without modifying / patching / merging in from other branches. As for the Python2-only packages identified above, someone needs to do the research and categorize them as:
At this point, there aren't many packages in category (4). My guess is they are mostly Python interfaces to specialized domain-specific software with only a small number of users. For example, PISM only supported Python2 bindings until Dec 2018. Apparently, PETSc still requires Python2 to build (although it's not a Python package per se, so it falls in category 5). ISSM is another example. They mostly use MATLAB (not Python) in-house anyway. ISSM is also still running on SVN (not git). And they hand-build 50+ packages as prerequisites, rather than using Spack. So I wouldn't expect Python3 bindings any time soon. OTOH, ISSM is specialty software with a small user base. |
The |
Python 3.7 is still rather new. If you want to determine Python3
compatibility, I would test against Python 3.5 or maybe 3.6.
|
Note the list of packages that declare they will require Python3, starting in the next year or so: This includes all the basics: numpy, matplotlib, basemap, scipy, ipython, jupyter, pandas. I think that sometime in 2019 is the time for Spack to commit to Python3 by default. |
72fa411
to
9770b31
Compare
I'm trying to understand what's holding back this PR (besides the tut build test). The way I'm looking at it, the packages that support python2-only aren't negatively affected by this change - they already have a dependency on python2 explicitly and concretize correctly even with the PR in place. The python3-only packages are likewise fine with this PR. The packages that are some combination of |
Lack of a coherent agreed-upon plan is holding us back for now. See #11468. |
Filed an issue: mrzechonek/tut-framework#18 |
347b435
to
3d2054c
Compare
@citibeth does |
Went through all the packages in Spack that claim to only support Python 2. A few now have Python 3 support, but the vast majority are either a work in progress or are no longer supported. A few like |
… On Mon, Jul 22, 2019 at 12:30 AM Adam J. Stewart ***@***.***> wrote:
@citibeth <https://github.com/citibeth> does pism support Python 3 yet?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10319?email_source=notifications&email_token=AAOVY55OWI3QCTX5ZSGP2KLQAUZVNA5CNFSM4GPRCZPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2OXMYI#issuecomment-513635937>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOVY5ZAU3ZYEDSUJJWRMDTQAUZVNANCNFSM4GPRCZPA>
.
|
#12145 may put the brakes on this PR for awhile. The latest version of Python 3 can't be built with the Intel compilers. Hopefully they will come out with a patch soon. |
Note that we've reached the point where the latest releases of numpy, scipy, matplotlib, pandas, and scikit-learn no longer support Python 2. This will continue to grow rapidly: https://python3statement.org/ |
- no longer support Python 3
+ no longer support Python 2 😉 |
Also note that |
@adamjstewart Elemental is unmaintained. There have been a couple maintenance patches here and there, but the author has explicitly stated he's not working on it anymore, and to the best of my knowledge, no one has stepped up to maintain it. As far as I know, Hydrogen (as in, the Spack package) forks Elemental, but last I checked, Hydrogen strips out everything except BLAS level-1 primitives, and then adds GPU support. (I could be wrong about the specifics, but conversations with Hydrogen maintainers left me with this overall impression.) I think dropping support for Elemental during a migration to Python 3 would be an entirely reasonable position by the Spack maintainers, but I don't know how many people would be affected by such a change, and how much it would affect them. |
Just to clarify, a switch to Python 3 by default won't drop support for anything. Users can still specify |
@tgamblin What do you consider to be a decent subset? Most core Python libraries (numpy, scipy, matplotlib, pandas, sklearn) only support Python 3 at this point. I use all of these in my research and haven't run into any problems so far. I'm willing to test a larger subset if that's what it takes to get this PR merged. |
3d2054c
to
efbe0f4
Compare
Python 3.8.0 was recently released. I've been playing around with it, and it's horribly buggy so far (see #13256). Based on this, and the fact that Anaconda and Homebrew still don't offer Python 3.8 support, I've decided to switch the default to Python 3.7 instead of Python 3. I propose we move in lockstep with Anaconda, as they are kind of the authority on Python distributions these days. |
Sounds good to me
…On Sat, Oct 19, 2019 at 22:34 Adam J. Stewart ***@***.***> wrote:
Python 3.8.0 was recently released. I've been playing around with it, and
it's horribly buggy so far (see #13256
<#13256>). Based on this, and the
fact that Anaconda
<https://www.anaconda.com/distribution/#download-section> and Homebrew
<https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb>
still don't offer Python 3.8 support, I've decided to switch the default to
Python 3.7 instead of Python 3. I propose we move in lockstep with
Anaconda, as they are kind of the authority on Python distributions these
days.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10319?email_source=notifications&email_token=AAOVY53ILXXF5GBID2DIFN3QPO7TJA5CNFSM4GPRCZPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBYA45A#issuecomment-544214644>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOVY53T3DCVFBVF5URJ7UDQPO7TJANCNFSM4GPRCZPA>
.
|
We're finally seeing progress on fixing the Python build for the Intel compilers! python/cpython#16717 If this patch works, we can remove the |
efbe0f4
to
b4148fb
Compare
@adamjstewart: that looks like a decent subset to me. I agree with picking 3.7 instead of 3.8. The only other question, which I had for @scheibelp and I believe he fixed in #13243, is whether things will still continue to work as well as can be expected if you prefer python 2.7 in If you agree, I'm totally fine with this and think it's the right way to go. |
@tgamblin I've been preferring 3.7 in my Let me test python/cpython#16717 first. If that patch works, I'll add it to this PR and we can finally merge this! |
Exactly - I believe this is what #13243 was meant to fix. @scheibelp? I am hoping to have an "experimental" new concretizer in sometime this month so that people can start trying it when they have these issues. |
I don't think so: If you want to support something like
and you want Spack to choose the latest version of
I didn't consider this a major problem since a user could explicitly specify the version of
As for what #13243 fixes: if a package only needs some dependencies for Python 2.x versions, #13243 fixes a bug where such constraints were not respected. I think that was a more serious bug because it led Spack to add dependencies that weren't needed (i.e. the concretization completed without errors but produced an incorrect DAG). So my question is: do we consider it a blocker that users who want |
So my question is: do we consider it a blocker that users who want
py-numpy with python 2.x will have to specify a particular version? I
think if so, we could recommend a configuration that sets preferences on
some py-* packages that allows them to build with Python 2.x
Maybe it's time to use the concretizer workaround I proposed earlier with
the `+python2` variant?
… |
I think you're referring to #11468 and #7926? Some of the changes I see in #7926 e.g.
are resolved by #13243 e.g.
To support |
So you're asking if the fact that this fails: $ spack install py-numpy ^python@:2 should be a blocker to merging this PR? What about the fact that without this PR, the following fails: $ spack install py-numpy I consider that a much more serious issue. |
I agree with you. You made a statement earlier:
I assume you were implying that the following would fail to concretize with this PR:
which I think is true but I also don't think it's a blocker. I was asking if other people thought it was. In particular I wanted to ask because in #10319 (comment) it was asked whether #13243 would resolve this problem; it does not, so the issue you brought up would remain an issue with the PR (but again I don't think it's a blocker). |
Gotcha. I personally don't consider it a blocker, since you already have to specify the correct version of numpy that supports Python 2 with or without this PR. I think we can wait on the new concretizer to resolve that issue. |
I agree completely with:
and:
@adamjstewart: Let's go ahead and merge this. |
b4148fb
to
faf75c9
Compare
The patch worked! I was able to successfully installs Python 3.7.4 with Intel 18.0.3.222 on Cray CNL5. I think this PR is finally ready to merge as soon as Travis passes. |
Thanks for everyone's help in getting this PR merged! If you still rely on packages that require Python 2, please encourage the developers to update to Python 3. If the package should support Python 3 but has build problems, let me know and I'll take a look. If you want to restore the behavior before this PR, make the following change to your packages:
python:
version: [':2'] R.I.P. Python 2, long live Python 3! |
* Default to Python 3 * Fix build with Intel compilers
Closes #7926
Closes #8018
Closes #11468
Apologies for making a PR on such a controversial topic without first opening an issue for discussion, but I wanted to make it clear what I'm proposing. This PR should not be merged without majority approval from several people.
Currently,
spack install python
defaults to Python 2. With this PR, Spack will install Python 3 by default. This PR is motivated by the fact that Python 2 will be retired at the end of the year.Currently, the following packages only support Python 2:
And the following packages only support Python 3:
* The latest version of these packages require Python 3, although older versions can be built with Python 2.
Feel free to update this list as it changes. Many of the packages that only support Python 2 may have already been updated upstream but the Spack package simply contains an old version. It would be good to push the developers of the rest of the packages to support Python 3.
Currently, there are more packages that require Python 2 than there are that require Python 3. But this will continue to change as the countdown clock reaches 2020. In particular, the reason I opened this PR is the
meson
package, which is becoming the default build system for GTK and many GNOME packages. Meson requires Python 3, and trying to build anything with meson anywhere in the spec causes Spack to crash. This could obviously be resolved with better concretization, but I haven't seen any progress made on that.Some possibly biased Python 3 users who would be interested in this topic: @svenevs @citibeth @tgamblin