diff --git a/.travis.yml b/.travis.yml index 20191d69..4e921986 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,10 +31,10 @@ script: cd docs; make html; cd ..; - python -m doctr deploy --gh-pages-docs . --key-path deploy_key.enc; - python -m doctr deploy --gh-pages-docs docs --key-path deploy_key.enc; - python -m doctr deploy --no-require-master --gh-pages-docs "docs-$TRAVIS_BRANCH" --built-docs docs/_build/html --key-path deploy_key.enc; - python -m doctr deploy --no-require-master --key-path deploy_key.enc --no-sync --command "echo test"; + python -m doctr deploy --key-path deploy_key.enc .; + python -m doctr deploy --key-path deploy_key.enc --gh-pages-docs docs; + python -m doctr deploy --no-require-master --built-docs docs/_build/html --key-path deploy_key.enc "docs-$TRAVIS_BRANCH"; + python -m doctr deploy --no-require-master --key-path deploy_key.enc --no-sync --command "echo test" docs; fi - if [[ "${TESTS}" == "true" ]]; then pyflakes doctr; diff --git a/docs/changelog.rst b/docs/changelog.rst index 6cb3b782..526b58a1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,6 +2,13 @@ Doctr Changelog ================= +Current +======= +- The ``--gh-pages-docs`` flag of ``doctr deploy`` has been deprecated. + Specify the deploy directory like ``doctr deploy .`` or ``doctr deploy docs``. + There is also no longer a default deploy directory. (:issue:`128`) + + 1.4.1 (2017-01-11) ================== - Fix Travis API endpoint when checking if a repo exists. (:issue:`143`) diff --git a/doctr/__main__.py b/doctr/__main__.py index e320576c..6a9a73bf 100644 --- a/doctr/__main__.py +++ b/doctr/__main__.py @@ -50,6 +50,8 @@ def get_parser(): subcommand = parser.add_subparsers(title='subcommand', dest='subcommand') deploy_parser = subcommand.add_parser('deploy', help="""Deploy the docs to GitHub from Travis.""") deploy_parser.set_defaults(func=deploy) + deploy_parser.add_argument('deploy_directory', type=str, nargs='?', + help="""Directory to deploy the html documentation to on gh-pages.""") deploy_parser.add_argument('--force', action='store_true', help="""Run the deploy command even if we do not appear to be on Travis.""") deploy_parser.add_argument('--token', action='store_true', default=False, @@ -60,9 +62,6 @@ 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('--tmp-dir', default=None, help=argparse.SUPPRESS) deploy_parser.add_argument('--deploy-repo', default=None, help="""Repo to @@ -81,6 +80,11 @@ def get_parser(): deploy_parser.add_argument('--no-push', dest='push', action='store_false', default=True, help="Run all the steps except the last push step." "Useful for debugging") + deploy_parser.add_argument('--gh-pages-docs', default=None, + help="""!!DEPRECATED!! Directory to deploy the html documentation to on gh-pages. + The default is %(default)r. The deploy directory should be passed as + the first argument to 'doctr deploy'. This flag is kept for backwards + compatibility.""") configure_parser = subcommand.add_parser('configure', help="Configure doctr. This command should be run locally (not on Travis).") @@ -125,6 +129,17 @@ def deploy(args, parser): if args.tmp_dir: parser.error("The --tmp-dir flag has been removed (doctr no longer uses a temporary directory when deploying).") + if args.gh_pages_docs: + print("The --gh-pages-docs flag is deprecated and will be removed in the next release. Instead pass the deploy directory as an argument, e.g. `doctr deploy .`") + + if args.gh_pages_docs and args.deploy_directory: + parser.error("The --gh-pages-docs flag is deprecated. Specify the directory to deploy to using `doctr deploy