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

Revert to single-line command for doctr invocation. #3578

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ script:
# When we merge a change to SciTools/iris, we can push docs to github pages.
# At present, only the Python 3.7 "doctest" job does this.
# Results appear at https://scitools-docs.github.io/iris/<<branchname>>/index.html
- >
if [[ "${ORG}" == 'SciTools' && "${TRAVIS_EVENT_TYPE}" == 'push' && "${PUSH_BUILT_DOCS}" == 'true' ]]; then
- if [[ "${ORG}" == 'SciTools' && "${TRAVIS_EVENT_TYPE}" == 'push' && "${PUSH_BUILT_DOCS}" == 'true' ]]; then
Copy link
Member

@lbdreyer lbdreyer Dec 4, 2019

Choose a reason for hiding this comment

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

It seems strange the > doesn't work.
Have you tested that this line would now work?

Copy link
Member Author

@pp-mo pp-mo Dec 4, 2019

Choose a reason for hiding this comment

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

The ">" form seems to leave newlines in it (or possibly carriage-returns, if there is a line-end problem??).
So testing with the yaml package, I get...

>>> with open('.travis.yml') as fo:
...   data = yaml.safe_load(fo)
... 
>>> print(data['script'][-1])
if [[ "${ORG}" == 'SciTools' && "${TRAVIS_EVENT_TYPE}" == 'push' && "${PUSH_BUILT_DOCS}" == 'true' ]]; then
  cd ${INSTALL_DIR};
  pip install doctr;
  doctr deploy --deploy-repo SciTools-docs/iris --built-docs docs/iris/build/html
    --key-path .github/deploy_key.scitools-docs.enc
    --no-require-master
    ${TRAVIS_BRANCH:-${TRAVIS_TAG}};
fi

>>> # definitely newlines ...
>>> print(repr(data['script'][-1]))
'if [[ "${ORG}" == \'SciTools\' && "${TRAVIS_EVENT_TYPE}" == \'push\' && "${PUSH_BUILT_DOCS}" == \'true\' ]]; then\n  cd ${INSTALL_DIR};\n  pip install doctr;\n  doctr deploy --deploy-repo SciTools-docs/iris --built-docs docs/iris/build/html\n    --key-path .github/deploy_key.scitools-docs.enc\n    --no-require-master\n    ${TRAVIS_BRANCH:-${TRAVIS_TAG}};\nfi\n'
>>> 

I don't really get this. The ">" form is supposed to "fold" lines + remove newlines, but here we definitely got embedded newlines.

Copy link
Member Author

Choose a reason for hiding this comment

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

Have you tested that this line would now work?

No. It's hard to do unless it's running in the right repository.
In principle, merging to a feature branch might work (which is what Scitools/iris/pushdocs_test was for). I may try that ...

cd ${INSTALL_DIR};
pip install doctr;
doctr deploy --deploy-repo SciTools-docs/iris --built-docs docs/iris/build/html
Expand Down