Skip to content

Use bookdown 2 23 - #390

Merged
WardBrian merged 8 commits into
masterfrom
use-bookdown-2-23
Sep 2, 2021
Merged

WardBrian merged 8 commits into
masterfrom
use-bookdown-2-23

Conversation

@mitzimorris

Copy link
Copy Markdown
Member

Submission Checklist

  • Builds locally
  • Declare copyright holder and open-source license: see below

Summary

Updated _output.yml files for all docs so that docs will build with bookdown 2.23. Unfortunately, bookdown 2.23 introduced a breaking change for the yaml headers w/r/t search engine config.

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Columbia University

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

@mitzimorris
mitzimorris requested a review from WardBrian August 27, 2021 20:10
@mitzimorris

mitzimorris commented Aug 27, 2021 •

Copy link
Copy Markdown
Member Author

this isn't quite ready to go. need to figure out how to address need for bookdown 2.23 - suggestions welcome.

@bob-carpenter bob-carpenter changed the title Use bookdown 2 23 [WIP] Use bookdown 2 23 Aug 27, 2021
@bob-carpenter
bob-carpenter marked this pull request as draft August 27, 2021 20:25
@bob-carpenter

Copy link
Copy Markdown
Member

I converted this to a draft (button under the Reviewers list) and added [WIP] to the title. Let us know when it's ready to review.

@mitzimorris mitzimorris changed the title [WIP] Use bookdown 2 23 Use bookdown 2 23 Aug 27, 2021
@mitzimorris
mitzimorris marked this pull request as ready for review August 27, 2021 23:47
@mitzimorris

Copy link
Copy Markdown
Member Author

Improved build.py script and added more info to README.md.

In order to check for bookdown 2.23 or greater, usingsubprocess.run which requires Python 3.5 or higher.

@mitzimorris

Copy link
Copy Markdown
Member Author

this is ready for review.

@WardBrian

Copy link
Copy Markdown
Member

I get an error straight off:

(r-env) [brian@FlatTop bookdowntest on use-bookdown-2-23] $ python build.py 2 27
Traceback (most recent call last):
  File "/home/brian/Dev/integration/bookdowntest/build.py", line 125, in <module>
    main()
  File "/home/brian/Dev/integration/bookdowntest/build.py", line 77, in main
    check_bookdown_2_23()
  File "/home/brian/Dev/integration/bookdowntest/build.py", line 39, in check_bookdown_2_23
    check = subprocess.run(command, capture_output=True, text=True)
  File "/home/brian/miniconda3/envs/r-env/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/home/brian/miniconda3/envs/r-env/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/home/brian/miniconda3/envs/r-env/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/Rscript'

The reason seems to be the hard coding of the Rscript path:

(r-env) [brian@FlatTop bookdowntest on use-bookdown-2-23] $ which Rscript
/home/brian/miniconda3/envs/r-env/bin/Rscript

Comment thread README.md Outdated
**`build.py`**

The program `build.py` convert the markdown files under `src` to html and pdf and populates the `docs` dir with the generated documentation.
Requires Python 3.5 or higher, due to call to `subproces.run`.

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.

While subprocess.run was added in 3.5, the capture_output kwarg wasn't until 3.7 -- I think that's probably fine, but we should correct the minimum version here.

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.

also checking in script itself.

Comment thread build.py Outdated
raise Exception(returncode)

def check_bookdown_2_23():
command = ["/usr/local/bin/Rscript", "-e", "utils::packageVersion(\"bookdown\") > 0.22"]

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.

Suggested change
command = ["/usr/local/bin/Rscript", "-e", "utils::packageVersion(\"bookdown\") > 0.22"]
command = ["Rscript", "-e", "utils::packageVersion(\"bookdown\") > 0.22"]

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.

doh! done!

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.

3 participants