Skip to content
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 is Python 2, but would be nicer if Python 3 #23

Open
matthewfeickert opened this issue May 11, 2020 · 7 comments
Open

Default is Python 2, but would be nicer if Python 3 #23

matthewfeickert opened this issue May 11, 2020 · 7 comments

Comments

@matthewfeickert
Copy link
Collaborator

matthewfeickert commented May 11, 2020

All the Python files in pandamonium start with

#!/usr/bin/env python

which is defaulting to Python 2 for the runtime. However, Python 2 is dead (long live Python 2) and it would be nicer if Python 3 was the default runtime

#!/usr/bin/env python3

This seems like it will be a sticky issue though as many people in the HEP world are still running Python 2 as most of the software on clusters is still defaulting to that and this shows no signs of stopping soon (sadly). @dguest What is a way forward here to provide Python 3 support without breaking pandamonium on physics clusters stuck on Python 2?

@matthewfeickert
Copy link
Collaborator Author

cc @kratsg @cshimmin who may have additional thoughts here.

@dguest
Copy link
Owner

dguest commented May 11, 2020

Just on a historical note: For a while I supported both python 2 and python 3 branches, but all the merge requests came from people using python 2. I don't know if that's still relevant.

What is relevant is that, as you said, python 2 is going to be the default in ATLAS physics analysis for at least another few years. Defaulting to python 3 is going to confuse a lot of already confused people, and they are the people this library is meant to help.

Normally I'd feel sort of icky about using python 2 "because that's what people use": python 2 clearly needs to die, I don't like writing python 2 code, and if this code was don't anything remotely complicated or had any dependencies I'd be making life needlessly hard by using something so deprecated. But python 2 is not dead yet, this code doesn't need much maintenance, and this code was only initially intended as a demo for how awesome CLI and REST APIs are. I hope anyone doing serious work beyond checking their job status just guts this code and incorporates the parts they need into some bigger framework.

That said, it would be unfortunate if someone couldn't use this code because they only had python 3. Has this happened yet? Even worse would be if someone decided not to update to python 2 because of this script, but that seems even less likely.

I think the turning point will come when python 3 is more common in ATLAS than python 2. Any bets as to when that happens?

@matthewfeickert
Copy link
Collaborator Author

matthewfeickert commented May 11, 2020

That said, it would be unfortunate if someone couldn't use this code because they only had python 3. Has this happened yet?

Not yet. A lot of this was also fueled by my assumption that this could be a local machine utility (c.f. Issue #24), and becomes far less relevant if it is regulated to being a LXPLUS utility. If local machine utility happens though, then this will become an issue soon as Ubuntu and new versions of macOS will start shipping with Python 3 only (actually that already happened with Ubuntu 20.04).

I hope anyone doing serious work beyond checking their job status just guts this code and incorporates the parts they need into some bigger framework.

This is somewhat fair, but I'm a huge fan of the little utility that does its job well and earns its place in the toolbox. So I'd like to see pandamonium be useable and contributed to for a long time.

I think the turning point will come when python 3 is more common in ATLAS than python 2. Any bets as to when that happens?

I really have no idea, only secret hopes. I think @lukasheinrich is the person who has the best guess at the moment, but I also don't think that he can even give a clear answer on that.

That being said, now that I've understood the issues of Issue #24 better I actually have a way to make the code fully Python 2 and Python 3 compatible that way very simple. I've opened up PR #25 for it once PR #22 is resolved (either yay or nay).

@afortiorama
Copy link

This seems like it will be a sticky issue though as many people in the HEP world are still running Python 2 as most of the software on clusters is still defaulting to that and this shows no signs of stopping soon (sadly).

the problem is that python2 is still the default on centos7 sites will not change the default. And there has been no request to do it. ATLAS (and the other experiments) will have to take care of it.

@matthewfeickert
Copy link
Collaborator Author

ATLAS (and the other experiments) will have to take care of it.

Thanks for this info, @afortiorama. It is always helpful to better understand where the work actually is. I also didn't mean to put the "blame" on anyone here, so hopefully it didn't come across as me condemning the good compute site people. :)

@afortiorama
Copy link

@matthewfeickert not at all. But it is a problem that has been discussed in ADC for almost 2 years and while ATLAS is slowly phasing out python2 it is still very much in use.

@matthewfeickert
Copy link
Collaborator Author

Note to self, when in the (far) future pandamonium drops Python 2.7 support, the bdist_wheel universal option in setup.cfg

pandamonium/setup.cfg

Lines 30 to 31 in 81b5d59

[bdist_wheel]
universal = 1

should be removed. c.f. scikit-hep/pyhf#1295 for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants