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

make deploy directory required argument #157

Merged
merged 10 commits into from
Mar 9, 2017
Merged

make deploy directory required argument #157

merged 10 commits into from
Mar 9, 2017

Conversation

gforsyth
Copy link
Member

@gforsyth gforsyth commented Feb 7, 2017

as per discussion in #128, changing the deploy directory to a required
argument. the new usage for doctr on the travis side of things would
be

doctr deploy .

to deploy to the root directory on the gh-pages branch.

as per discussion in #128, changing the deploy directory to a required
argument. the new usage for doctr on the travis side of things would
been
```
doctr deploy .
```

to deploy to the root directory on the ``gh-pages`` branch.
@asmeurer
Copy link
Member

asmeurer commented Feb 7, 2017

Let's check all known users of doctr to make sure this doesn't break them.

@gforsyth
Copy link
Member Author

gforsyth commented Feb 7, 2017

I think it will break all users -- I guess we could PR appropriate changes to them?

@@ -60,9 +60,8 @@ def get_parser():
deploy_parser.add_argument('--built-docs', default=None,
help="""Location of the built html documentation to be deployed to
gh-pages. If not specified, Doctr will try to automatically detect build location""")
deploy_parser.add_argument('--gh-pages-docs', default='docs',
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could keep and deprecate this option for backwards compatibility.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking of that, but I'm not sure how to go about having a default argument not be required if a certain non-default option is passed.

Copy link
Member

Choose a reason for hiding this comment

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

Does argparse let you set a default for positional arguments? You'd have to do the flag logic manually (use parser.error to print the error).

Copy link
Contributor

Choose a reason for hiding this comment

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

nargs= '?'

@asmeurer
Copy link
Member

asmeurer commented Feb 7, 2017

I guess we could deprecate it with some custom argparse logic (require the argument if the flag isn't there, and if the flag is used print a deprecation warning). OTOH, deprecation warnings will be ignored, so at best it would just make a transition possible without a period of non-building docs.

@gforsyth
Copy link
Member Author

gforsyth commented Feb 7, 2017

There's definitely a benefit to having a period in which to help people transition, I guess I'll see how difficult it is to implement the custom argparse stuff

@asmeurer
Copy link
Member

asmeurer commented Feb 7, 2017

Yeah, even if we PR everyone, they would all have to merge their PRs exactly when we release, or else their docs will fail.

@asmeurer
Copy link
Member

asmeurer commented Feb 7, 2017

I was thinking it might work by setting a default value. I didn't test it, though.

@scopatz
Copy link
Contributor

scopatz commented Feb 7, 2017

Well, you have to set a default value, but it will still require the argument to be present. You need both IIRC.

to make sure that both methods still work on travis, keeping one of
these deploy calls using the old syntax.
@gforsyth
Copy link
Member Author

gforsyth commented Feb 8, 2017

Ok -- this is ready for another look. @scopatz was (unsurprisingly) right about nargs='?' -- I've also updated doctrs .travis.yml to use both the deprecated and the new deploy format so we can check that both are working for now.

@asmeurer
Copy link
Member

asmeurer commented Feb 9, 2017

I pushed a change to the deprecation message.

@asmeurer
Copy link
Member

asmeurer commented Feb 9, 2017

Am I missing something, or does this not actually use the deploy_directory variable? It should use it, or gh_pages_docs if it isn't there (and neither and both should be an error).

@gforsyth
Copy link
Member Author

gforsyth commented Feb 9, 2017

Am I missing something, or does this not actually use the deploy_directory variable? It should use it, or gh_pages_docs if it isn't there (and neither and both should be an error).

Nope -- mea culpa. That's a bit of an oversight. I'll add that in later tonight.

@gforsyth
Copy link
Member Author

gforsyth commented Mar 2, 2017

This is ready for another look.

@@ -2,6 +2,11 @@
Doctr Changelog
=================

Current
=======
- Change deploy directory to required argument. This is a backwards incompatible change. Default deploy without arguments should now read ``doctr deploy .`` (:issue:`128`)
Copy link
Member

Choose a reason for hiding this comment

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

This should be reworded a bit. The default used to be docs, but now there is no default. Maybe something like

There is no longer a default deploy directory. Specify the deploy directory like doctr deploy . or doctr deploy docs.

@asmeurer
Copy link
Member

asmeurer commented Mar 5, 2017

The code looks good. Maybe we should test that it works in Travis?

Either way, let's check which known repos using doctr need to be updated.

@gforsyth
Copy link
Member Author

gforsyth commented Mar 5, 2017

@asmeurer
Copy link
Member

asmeurer commented Mar 6, 2017

I will fix sympy.

@asmeurer
Copy link
Member

asmeurer commented Mar 6, 2017

We should make a new issue about the updates. We can't do it until this is merged and released.

@Carreau
Copy link
Collaborator

Carreau commented Mar 9, 2017

gallantlab/pycortex#205 will switch to doctr (not merged yet) , they should be warned also.

@gforsyth
Copy link
Member Author

gforsyth commented Mar 9, 2017

Ok, anything left on this? We're tracking the people we need to notify about the usage changes.

This will also require a few changes to @Carreaus' #137 if this is merged first, but those should be trivial.

@Carreau
Copy link
Collaborator

Carreau commented Mar 9, 2017

Ok, anything left on this? We're tracking the people we need to notify about the usage changes.

+1

This will also require a few changes to @Carreaus' #137 if this is merged first, but those should be trivial.

No problem, I can take care of that.

@asmeurer
Copy link
Member

asmeurer commented Mar 9, 2017

I think we should try to get the other PRs in before we release. But this looks good.

@asmeurer asmeurer merged commit 1bf636f into master Mar 9, 2017
@gforsyth gforsyth deleted the deploy branch March 9, 2017 22:12
bryanwweber added a commit to bryanwweber/thermostate that referenced this pull request Apr 13, 2017
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.

4 participants