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

Scripts optparse to argparse #2864

Merged
merged 60 commits into from
Dec 15, 2016

Conversation

stevepiercy
Copy link
Member

refs: #2842

app = self.get_app(app_spec, self.options.app_name,
options=parse_vars(self.args[2:]))
app = self.get_app(app_spec, self.args.app_name,
options=self.args.config_vars)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing parse_vars

parser = optparse.OptionParser(
usage,
parser = argparse.ArgumentParser(
prog="pviews",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop prog argument

@@ -38,7 +38,8 @@ def _makeConfig(self, *arg, **kw):
def test_good_args(self):
cmd = self._getTargetClass()([])
cmd.bootstrap = (dummy.DummyBootstrap(),)
cmd.args = ('/foo/bar/myapp.ini#myapp', 'a=1')
cmd.args.config_uri = ('/foo/bar/myapp.ini#myapp',)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a tuple

inst = self._makeOne()
inst.args = ['foo', 'a=1', 'b=2']
result = inst.get_options()
inst.args.config_args = ['a=1', 'b=2']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config_vars

@stevepiercy stevepiercy added this to the 1.8 milestone Dec 11, 2016
@stevepiercy stevepiercy self-assigned this Dec 11, 2016
@stevepiercy
Copy link
Member Author

ptweens and pviews are ready for review.

I'm stuck on pshell, and I don't know where to go next. I think I got pshell to run as follows. Using my local project from the starter scaffold, I did pip install -e . to pull in all the latest changes of the p* scripts, then tried to run ../../env35/bin/pshell development.ini. This started an interactive Python shell.

There are probably mistakes in my pshell, too, the latest of which is committed and pushed here.

In the tests (latest also committed and pushed), there's patch_* stuff in _makeOne(). I tried debugging the test, but I could not figure out where to look or what it does, so I don't know how to fix the tests.

@mmerickel
Copy link
Member

You need to fix the _makeOne method to do the right thing. It doesn't match up with all of the changes you're making.

@stevepiercy
Copy link
Member Author

All things pass, except docs continue to fail to build (due to Sphinx/docutils bug), but build locally. Hopefully Sphinx will make a new release with the fix.
https://travis-ci.org/Pylons/pyramid/jobs/183174559#L700

Ready for final review. Can you believe it?

@stevepiercy stevepiercy force-pushed the scripts-optparse-to-argparse branch from 22db456 to ed1764d Compare December 14, 2016 00:01
@digitalresistor digitalresistor self-requested a review December 14, 2016 17:32
@digitalresistor
Copy link
Member

I'll review this in a little bit.

Copy link
Member

@digitalresistor digitalresistor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a simple comment, besides that, LGTM. @mmerickel I'll leave the merging to you in case you have any last minute requests.

@@ -51,11 +51,11 @@ def nothing(*arg):
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'repoze.sphinx.autointerface',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reasoning for the ordering of these? Or can they be alphabetized?

@mmerickel mmerickel merged commit 5b5b20b into Pylons:master Dec 15, 2016
@mmerickel
Copy link
Member

Thanks for powering through @stevepiercy

mmerickel added a commit that referenced this pull request Dec 15, 2016
@stevepiercy
Copy link
Member Author

Thank you for your guidance and patience. Hope the multiple facepalm wounds heal.

@stevepiercy
Copy link
Member Author

Closes #2804

@stevepiercy stevepiercy deleted the scripts-optparse-to-argparse branch December 15, 2016 06:36
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

Successfully merging this pull request may close these issues.

3 participants