Update scripts: add usage message; use argparse #36

Closed
cdeil opened this Issue Sep 10, 2012 · 7 comments

Projects

None yet

3 participants

@cdeil
the rootpy project member

All scripts should have a short usage message what they do. @ndawe Can you do that? It's not obvious to me with a few what their purpose is.

And they should use from rootpy.extern import argparse instead of import optparse or import argparse. I'd be happy to do that part.

@ndawe
the rootpy project member

Sure. One thing though: argparse is already in the install_requires in the setup.py, so is downloaded and installed automatically. Maybe we don't need a copy of it in extern?

@cdeil
the rootpy project member

I would say it's worth keeping argparse in extern:

  • It's one small pure-python file
  • Every user will need it to run a rootpy script and it should be easy to install and start using rootpy for new users. E.g. on the machines at work we don't even have pip installed and actually figuring out how to install and use pip can be a bit complicated.
@ndawe
the rootpy project member

Sure, we can keep it in, although python setup.py install should download and install argparse automatically if it isn't already (no pip required).

@cdeil
the rootpy project member

Oh, I didn't know python setup.py install would automatically install argparse. I tried it in a virtualenv and it works perfectly, also with pip. In that case I agree we should remove it.

Should I simply make a new commit (which would leave it in our repo history) or try one of those methods?
http://stackoverflow.com/questions/1338728/how-to-delete-a-git-commit

@ndawe
the rootpy project member

Leaving it in the history is fine. Let's just remove it and change the imports in the scripts. I still need to convert several of them over to argparse...

@ndawe ndawe was assigned Oct 12, 2012
@pwaller
the rootpy project member

Where are we at with this one? Is it essentially done?

@ndawe
the rootpy project member

Done

@ndawe ndawe closed this Feb 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment