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

[KED-1076] Add open flag to build-docs that opens the documentation on build #107

Merged
merged 12 commits into from
Oct 2, 2019
Merged

[KED-1076] Add open flag to build-docs that opens the documentation on build #107

merged 12 commits into from
Oct 2, 2019

Conversation

mzjp2
Copy link
Contributor

@mzjp2 mzjp2 commented Sep 28, 2019

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

  • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.

  • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.

  • I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.

Motivation and Context

Why was this PR created?
Closes #86

How has this been tested?

What testing strategies have you used?
Similar testing strategy as kedro.cli with docs.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes
  • Assigned myself to the PR

@mzjp2
Copy link
Contributor Author

mzjp2 commented Sep 29, 2019

Turns out the issue was using pathlib's resolve, in Python3.5 if the filepath doesn't exist (as it doesn't when being mocked), an error is thrown, necessitating the use of mocking that method on the Path object.

Incidentally, whilst researching this issue, I came across a few articles about the smell and danger of using .assert_called_once which the existing Kedro test that mocks webbrowser uses (and nowhere else) here:

https://github.com/quantumblacklabs/kedro/blob/d2c9648794cdda5ad28ea99cfc2661c076876932/tests/cli/test_cli.py#L185-L188

I think this would be better if patched_browserr.assert_called_once() was replaced with patched_browser.call_count == 1 (I didn't think raising an issue or a PR was necessary for such a a tiny thing).

@mzjp2
Copy link
Contributor Author

mzjp2 commented Sep 29, 2019

@mzjp2 mzjp2 changed the title Feature/open docs option [KED-1054] Add open flag to build-docs that opens the documentation on build Sep 29, 2019
@921kiyo 921kiyo changed the title [KED-1054] Add open flag to build-docs that opens the documentation on build [KED-1076] Add open flag to build-docs that opens the documentation on build Oct 1, 2019
Copy link
Contributor

@lorenabalan lorenabalan left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for picking this up! 🎉 I've left a couple of comments, happy to approve once they are addressed! :)

tests/template/test_kedro_cli.py Outdated Show resolved Hide resolved
kedro/template/{{ cookiecutter.repo_name }}/kedro_cli.py Outdated Show resolved Hide resolved
kedro/template/{{ cookiecutter.repo_name }}/kedro_cli.py Outdated Show resolved Hide resolved
@mzjp2 mzjp2 requested a review from lorenabalan October 1, 2019 16:19
@lorenabalan
Copy link
Contributor

Not sure it's worth editing the documentation (https://github.com/quantumblacklabs/kedro/blob/develop/docs/source/03_tutorial/05_package_a_project.md or https://github.com/quantumblacklabs/kedro/blob/develop/docs/source/06_resources/01_faq.md) so I haven't, but if you think it should - I'm happy to.

Just saw this, sorry. Maybe a note in 05_package_a_project.md would be nice ("to quickly inspect this, run my awesome command"), but I wouldn't worry about it, it's far from being a blocker on merging this.

@lorenabalan
Copy link
Contributor

Maybe a note in 05_package_a_project.md would be nice

Actually template/{{cookieutter.repo_name}}/README.md would be more relevant.

Copy link
Contributor

@lorenabalan lorenabalan left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

Copy link
Contributor

@DmitriiDeriabinQB DmitriiDeriabinQB left a comment

Choose a reason for hiding this comment

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

Nice! 👏

@DmitriiDeriabinQB DmitriiDeriabinQB merged commit 8bdb1b5 into kedro-org:develop Oct 2, 2019
@mzjp2 mzjp2 deleted the feature/open-docs-option branch October 2, 2019 17:31
njgerner referenced this pull request in FoundryAI/kedro Oct 10, 2019
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.

[KED-1054] Add option to kedro build-docs which also opens the documentation
3 participants