Skip to content

make deploy directory required argument#157

Merged
asmeurer merged 10 commits into
masterfrom
deploy
Mar 9, 2017
Merged

make deploy directory required argument#157
asmeurer merged 10 commits into
masterfrom
deploy

Conversation

@gforsyth

@gforsyth gforsyth commented Feb 7, 2017

Copy link
Copy Markdown
Member

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

asmeurer commented Feb 7, 2017

Copy link
Copy Markdown
Member

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

@gforsyth

gforsyth commented Feb 7, 2017

Copy link
Copy Markdown
Member Author

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

Comment thread doctr/__main__.py
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nargs= '?'

@asmeurer

asmeurer commented Feb 7, 2017

Copy link
Copy Markdown
Member

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

gforsyth commented Feb 7, 2017

Copy link
Copy Markdown
Member Author

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

asmeurer commented Feb 7, 2017

Copy link
Copy Markdown
Member

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

asmeurer commented Feb 7, 2017

Copy link
Copy Markdown
Member

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

@scopatz

scopatz commented Feb 7, 2017

Copy link
Copy Markdown
Contributor

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

gforsyth commented Feb 8, 2017

Copy link
Copy Markdown
Member Author

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

asmeurer commented Feb 9, 2017

Copy link
Copy Markdown
Member

I pushed a change to the deprecation message.

@asmeurer

asmeurer commented Feb 9, 2017

Copy link
Copy Markdown
Member

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

gforsyth commented Feb 9, 2017

Copy link
Copy Markdown
Member Author

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

gforsyth commented Mar 2, 2017

Copy link
Copy Markdown
Member Author

This is ready for another look.

Comment thread docs/changelog.rst Outdated

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
Copy Markdown
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

asmeurer commented Mar 5, 2017

Copy link
Copy Markdown
Member

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

gforsyth commented Mar 5, 2017

Copy link
Copy Markdown
Member Author

@asmeurer

asmeurer commented Mar 6, 2017

Copy link
Copy Markdown
Member

I will fix sympy.

@asmeurer

asmeurer commented Mar 6, 2017

Copy link
Copy Markdown
Member

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

@Carreau

Carreau commented Mar 9, 2017

Copy link
Copy Markdown
Collaborator

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

@gforsyth

gforsyth commented Mar 9, 2017

Copy link
Copy Markdown
Member Author

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

Carreau commented Mar 9, 2017

Copy link
Copy Markdown
Collaborator

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

asmeurer commented Mar 9, 2017

Copy link
Copy Markdown
Member

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