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
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.



1.4.1 (2017-01-11)
==================
- Fix Travis API endpoint when checking if a repo exists. (:issue:`143`)
Expand Down
7 changes: 3 additions & 4 deletions doctr/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
help="""Directory to deploy the html documentation to on gh-pages. The
default is %(default)r.""")
deploy_parser.add_argument('deploy_directory', type=str,
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= '?'

help="""Directory to deploy the html documentation to on gh-pages.""")
deploy_parser.add_argument('--tmp-dir', default=None,
help=argparse.SUPPRESS)
deploy_parser.add_argument('--deploy-repo', default=None, help="""Repo to
Expand Down Expand Up @@ -251,7 +250,7 @@ def configure(args, parser):
- set -e
- # Command to build your docs
- pip install doctr
- doctr deploy{options}
- doctr deploy{options} {deploy_directory}

to the docs build of your .travis.yml. The 'set -e' prevents doctr from
running when the docs build fails. Use the 'script' section so that if
Expand Down