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

Add support for setting up Python through renv #15

Merged
merged 133 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
476dcea
make tests quieter; report timings of setup
zkamvar Mar 16, 2023
b1d58ab
add test for reference page/glossary
zkamvar Mar 16, 2023
d0a3f81
implement glossary provisioning
zkamvar Mar 16, 2023
22bcc9d
skip reference in resources dropdown
zkamvar Mar 16, 2023
b95a1c2
anchor regex
zkamvar Mar 16, 2023
8d8d8d1
add reference to expected learner files
zkamvar Mar 16, 2023
4beadb2
clean up trailing whitespace
zkamvar Mar 16, 2023
3a6c495
bump version; update NEWS
zkamvar Mar 16, 2023
c42c6ba
explicitly set utils:: for capture.output
zkamvar Mar 16, 2023
22c5d4e
Merge pull request #412 from carpentries/provision-references
zkamvar Mar 16, 2023
fa5daf4
do not ignore references from sidebar
zkamvar Mar 16, 2023
68bcd2a
re-snap tests
zkamvar Mar 16, 2023
dcc2b64
update template default values to include fixmes
zkamvar Mar 16, 2023
a1d0ad9
Merge pull request #413 from carpentries/provision-references
zkamvar Mar 16, 2023
164b0c9
Update DESCRIPTION
jcolomb Mar 16, 2023
c8b911a
Merge pull request #414 from jcolomb/patch-2
zkamvar Mar 16, 2023
37da6f2
add patch for {renv} 0.17.1
zkamvar Mar 17, 2023
1c23603
bump version; add news
zkamvar Mar 17, 2023
7cae6f9
Merge pull request #416 from carpentries/update-cache-reporting
zkamvar Mar 17, 2023
2ee615f
bump version to dev
zkamvar Mar 17, 2023
8a8517c
Merge pull request #417 from carpentries/bump-version
zkamvar Mar 17, 2023
a59ccbf
update function name in the text to match code block
tobyhodges Mar 21, 2023
f48c81d
Update contributing-template.txt
jcolomb Mar 22, 2023
f790b6f
Update inst/templates/contributing-template.txt
zkamvar Mar 22, 2023
984edfb
remove argument from text
zkamvar Mar 22, 2023
5300feb
Merge pull request #419 from jcolomb/main
zkamvar Mar 22, 2023
31926e3
Merge pull request #418 from tobyhodges/patch-2
zkamvar Mar 22, 2023
12ee5cb
update workflows to give explicit permissions
zkamvar Mar 22, 2023
514acae
Merge pull request #421 from carpentries/update-workflows-2023-03
zkamvar Mar 22, 2023
3b22514
move rstudio/renv to Config/Needs/check
zkamvar Mar 23, 2023
d110cde
Merge pull request #422 from carpentries/adjust-dep-source
zkamvar Mar 23, 2023
6358e3b
add workaround for renv
zkamvar Mar 24, 2023
2681fcc
fix number
zkamvar Mar 24, 2023
3670b23
Merge pull request #423 from carpentries/workaround-renv-0.17.2
zkamvar Mar 24, 2023
eed463c
bump version
zkamvar Mar 24, 2023
bd6c0b5
Merge pull request #424 from carpentries/version-bump
zkamvar Mar 24, 2023
652a68e
update templates
zkamvar Apr 4, 2023
0dc532e
update readme template to not use h1
zkamvar Apr 4, 2023
9b790c8
bump version; document; news
zkamvar Apr 4, 2023
13ea6d3
re-add covr
zkamvar Apr 4, 2023
54a527a
Apply suggestions from code review
zkamvar Apr 4, 2023
1e30066
use fixme for repo
zkamvar Apr 4, 2023
73ea0cb
Merge pull request #428 from carpentries/fix-license-contributing
zkamvar Apr 4, 2023
993f187
add 404 page support
zkamvar Apr 4, 2023
59735a2
Merge pull request #429 from carpentries/add404
zkamvar Apr 4, 2023
e726507
add tests for 404 page re relative/absolute links
zkamvar Apr 5, 2023
7e3957e
add function to detect if we are in production
zkamvar Apr 5, 2023
de7f807
allow 404 page to use absolute paths for prod
zkamvar Apr 5, 2023
07384b4
fix path bug in serve
zkamvar Apr 5, 2023
d652cc5
clean white space from yaml utilities
zkamvar Apr 5, 2023
e0f9f53
update NEWS; bump version
zkamvar Apr 5, 2023
5058f20
make sure we are dealing with a single call item
zkamvar Apr 5, 2023
73b087b
fix 404 menu links
zkamvar Apr 5, 2023
8d75ef3
move sidebar function to sidebar file
zkamvar Apr 5, 2023
870fe04
add note for later
zkamvar Apr 5, 2023
8fc6fbb
whoops
zkamvar Apr 5, 2023
3d088c7
Merge pull request #431 from carpentries/update-404-page
zkamvar Apr 5, 2023
882f3b4
add tests that will pass once issue is fix
zkamvar Apr 27, 2023
70027f9
Set dev version
milanmlft Apr 28, 2023
1b6af38
update search to find explicit figures
zkamvar Apr 28, 2023
2efd2df
bump version; update NEWS
zkamvar Apr 28, 2023
51c6995
Add `use_python()` helper
milanmlft May 2, 2023
9623395
Add `py_install()` helpeer to add Python dependencies
milanmlft May 2, 2023
1495f89
Reactivate renv profile after adding Python
milanmlft May 3, 2023
cea48bf
Make sure Python dependencies also get restored by `manage_deps()`
milanmlft May 3, 2023
28425e8
Add option to set up Python in `create_lesson()`
milanmlft May 3, 2023
b729c0c
Set working directory while setting up Python
milanmlft May 3, 2023
5ffacc6
Update documentation for `create_lesson()`
milanmlft May 3, 2023
669141c
Update documentation for `use_python()`
milanmlft May 3, 2023
0b45377
Reoxygenize
milanmlft May 3, 2023
4529311
Add examples for Python usage
milanmlft May 3, 2023
ec2599f
Add unit tests for Python integration
milanmlft May 3, 2023
cc05834
Also test that `manage_deps()` plays nice with Python integration
milanmlft May 3, 2023
1dd787a
Document
zkamvar May 3, 2023
0ffd0d5
apply fix for mysterious serve() errors
zkamvar May 5, 2023
e48a2e6
clean up serve a bit
zkamvar May 5, 2023
7fb0275
bump version and news
zkamvar May 5, 2023
ed786cf
Merge pull request #451 from carpentries/fix-serve
zkamvar May 5, 2023
5501b48
remove test for building markdown via utils-callr
zkamvar May 5, 2023
b871bc3
move shortcut into build_episode_md()
zkamvar May 5, 2023
6989c39
Merge pull request #452 from carpentries/fix-build-location
zkamvar May 5, 2023
63cbcb8
Include break time in timings
bencomp May 12, 2023
cbd4580
allow {renv} to produce no messages
zkamvar May 16, 2023
8a4b2c6
Use default break length of 0 minutes
bencomp May 16, 2023
287c56a
engage verbosity in {renv} for tests
zkamvar May 16, 2023
b63f3f4
fix one last renv error
zkamvar May 16, 2023
ebcbc13
Reference "break" in YAML struct correctly
bencomp May 16, 2023
b142108
bump version; add news
zkamvar May 16, 2023
0de3543
fix withr test for ubuntu
zkamvar May 16, 2023
5549ae4
Merge pull request #458 from carpentries/fix-renv-2023-05
zkamvar May 16, 2023
e628a09
Merge pull request #455 from bencomp/437-break-times
zkamvar May 16, 2023
c5e9a7b
update get_syllabus test; add ben
zkamvar May 16, 2023
46c7ece
Merge pull request #460 from carpentries/add-test-2023-05-16
zkamvar May 16, 2023
692d2b9
allow serve to modify server settings
zkamvar May 16, 2023
09db2f9
Merge branch 'main' into add-servr-options
zkamvar May 16, 2023
d1f7de6
Merge pull request #461 from carpentries/add-servr-options
zkamvar May 16, 2023
0332825
Add Ben's ORCID
bencomp May 17, 2023
694e839
Merge pull request #462 from bencomp/fix/bens-name
zkamvar May 17, 2023
41edc10
Merge branch 'main' into use_python
milanmlft May 17, 2023
d001f84
add date to news; add CRAN skipper in CI test
zkamvar May 17, 2023
e13dd0b
Merge pull request #464 from carpentries/fix-universe-failure
zkamvar May 17, 2023
46b5706
first pass at fixing ids for callouts
zkamvar May 18, 2023
b0ef98d
ensure the same loaded pandoc version is used
zkamvar May 18, 2023
e783ef9
add test for callouts
zkamvar May 18, 2023
42dfaca
Merge pull request #466 from carpentries/use-loaded-pandoc-465
zkamvar May 18, 2023
c36155e
can't run the tests without the test file
zkamvar May 18, 2023
cab90d3
make lua work
zkamvar May 18, 2023
e6f83fa
make callout transformation work
zkamvar May 18, 2023
990bd07
clean up lua again
zkamvar May 18, 2023
51ab216
Merge branch 'main' into fix-div-ids-454
zkamvar May 19, 2023
0989600
bump news
zkamvar May 19, 2023
45e843a
Merge pull request #467 from carpentries/fix-div-ids-454
zkamvar May 19, 2023
ab17243
trim ws
zkamvar May 19, 2023
4631108
add note to utils-aggregate
zkamvar May 19, 2023
872527e
adjust XPath for instructor notes aggregation
zkamvar May 19, 2023
0b46bb6
process instructor note headings to give linkback
zkamvar May 19, 2023
428cc08
Merge pull request #468 from carpentries/add-instructor-note-headings…
zkamvar May 19, 2023
36f9282
Merge branch 'main' into fix-image-processing-445
zkamvar May 19, 2023
b202fd4
make sure figure parsing works for pandoc 3
zkamvar May 19, 2023
d797e34
add test for classes
zkamvar May 19, 2023
aae5485
add figure class to all images
zkamvar May 19, 2023
cda5f68
makesure to process lonely HTML figures
zkamvar May 19, 2023
738f1bd
update image aggregation to retain behaviour
zkamvar May 19, 2023
4b9d0c5
Merge pull request #446 from carpentries/fix-image-processing-445
zkamvar May 19, 2023
7a39a28
bump version; add news
zkamvar May 19, 2023
04ec2b3
add date of release
zkamvar May 19, 2023
e5f367b
Merge pull request #469 from carpentries/release-0.12.0
zkamvar May 19, 2023
df07005
Refactor: move reticulate installation to separate helper
milanmlft May 22, 2023
7deb07d
Improve tests, add helpers to manage renv during testing
milanmlft May 22, 2023
ac15e6c
Use `requireNamespace()` instead of `require()`
milanmlft May 22, 2023
76c814d
Merge branch 'main' into use_python
milanmlft May 22, 2023
2df6d49
Set dev version
milanmlft May 22, 2023
d096467
Skip `manage_deps()` tests on Windows
milanmlft May 22, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: "Set up pandoc"
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.11'
pandoc-version: '2.11'

- name: "Install sysreqs"
id: run-apt
Expand Down
29 changes: 19 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
Package: sandpaper
Title: Create and Curate Carpentries Lessons
Version: 0.11.9
Version: 0.12.0.9000
Authors@R: c(
person(given = "Zhian N.",
family = "Kamvar",
role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "0000-0003-1458-7108")),
person(given = "François",
family = "Michonneau",
person(given = "Julien",
family = "Colomb",
role = c("ctb"),
email = "[email protected]"),
comment = c(ORCID = "0000-0002-3127-5520")),
person(given = "Ben",
family = "Companjen",
role = c("ctb"),
comment = c(ORCID = "0000-0002-7023-9047")),
person(given = "Toby",
family = "Hodges",
role = c("ctb"),
email = "[email protected]"),
person(given = "François",
family = "Michonneau",
role = c("ctb"),
email = "[email protected]"),
person())
Description: We provide tools to build a Carpentries-themed lesson repository
into an accessible standalone static website. These include local tools and
Expand All @@ -23,7 +31,7 @@ Description: We provide tools to build a Carpentries-themed lesson repository
License: MIT + file LICENSE
Imports:
pkgdown (>= 1.6.0),
pegboard (>= 0.2.3),
pegboard (>= 0.5.1),
cli (>= 3.4.0),
commonmark,
fs (>= 1.5.0),
Expand All @@ -47,27 +55,28 @@ Imports:
tools
Suggests:
testthat (>= 3.0.0),
covr,
markdown,
brio,
xml2,
xslt,
covr,
withr,
jsonlite,
sessioninfo,
mockr,
varnish (>= 0.2.1),
mockr
reticulate
Additional_repositories: https://carpentries.r-universe.dev/
Remotes:
ropensci/tinkr,
carpentries/pegboard,
carpentries/varnish,
rstudio/renv
SystemRequirements: pandoc (>= 1.11.4) - http://pandoc.org
carpentries/varnish
SystemRequirements: pandoc (>= 2.11.4) - https://pandoc.org
Encoding: UTF-8
LazyData: true
Config/testthat/edition: 3
Config/testthat/parallel: false
Config/Needs/check: rstudio/renv
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
URL: https://carpentries.github.io/sandpaper/, https://github.com/carpentries/sandpaper/, https://carpentries.github.io/workbench/
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export(move_episode)
export(no_package_cache)
export(package_cache_trigger)
export(pin_version)
export(py_install)
export(renv_diagnostics)
export(reset_episodes)
export(reset_site)
Expand Down Expand Up @@ -54,10 +55,12 @@ export(update_cache)
export(update_github_workflows)
export(update_varnish)
export(use_package_cache)
export(use_python)
export(validate_lesson)
export(work_with_cache)
importFrom(assertthat,validate_that)
importFrom(rlang,is_interactive)
importFrom(tools,file_ext)
importFrom(tools,md5sum)
importFrom(utils,modifyList)
importFrom(utils,read.table)
Expand Down
149 changes: 143 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,150 @@
# sandpaper 0.11.9 (in development)
# sandpaper 0.12.0 (2023-05-19)

BUG FIX
-------
## NEW FEATURES

* Aggregate instructor notes now have headings that link back to the source
instructor note (reported: @tobyhodges, #463; fixed: @zkamvar, #468)
* The internal function `sandpaper:::render_html()` now explicitly sets the
pandoc version before running the subprocess. This allows lesson developers to
use the {pandoc} package to set their pandoc versions. (reported: @zkamvar,
#465; fixed: @zkamvar, #465)

## BUG FIX

* Callout block anchor links now point to the correct ID of the block derived
from the title of the block (as opposed to the generic ID).
(reported: @debpaul,
https://github.com/datacarpentry/OpenRefine-ecology-lesson/issues/292 and
@bencomp, #454; fixed: @zkamvar, #467).
* Inline images no longer automatically transform to figure blocks
(reported: @ostephens, #445; fixed: @zkamvar, #446). This bug was preventing
image links (e.g. MyBinder badges) from being rendered as links with images
in them. This fixes that issue. It also helps distinguish inline images
between figures in the DOM.

# sandpaper 0.11.17 (2023-05-16)

## NEW FEATURES

* `sandpaper::serve()` gains the `quiet` argument, defaulting to `TRUE` for
interactive sessions and `FALSE` for command line sessions
* `sandpaper::serve()` gains the `...` argument to pass options to
`servr::server_config()` for setting ports and hosts (reported:
@twrightsman, https://github.com/carpentries/workbench/issues/50 and #459;
fixed: @zkamvar, #461).

## BUG FIX

* Break timing is now included in the overall schedule. (reported: @karenword,
#437; fixed: @bencomp, #455).


## TEST SUITE

* An upstream feature in {renv}, forcing it to be silent when testing caused
some expectations to fail. This has been fixed in specific tests by turning
verbosity on in those tests (reported: @zkamvar, #457; fixed: @zkamvar, #458)

# sandpaper 0.11.16 (2023-05-05)

## BUG FIX

* A failure to incrementally build the lesson with `sandpaper::serve()` has been
fixed (reported: @zkamvar, #450; fixed: @zkamvar, #451)

## MISC

* Lessons with markdown documents no longer use `callr::r()` as an intermediary
(reported: @zkamvar, #442, fixed: @zkamvar, #452)

# sandpaper 0.11.15 (2023-04-05)

## BUG FIX

* The 404 page will now have proper styling applied when the site is deployed
via one of the `ci_` functions (reported: @zkamvar, #430; fixed: @zkamvar,
#431).
* `sandpaper::serve()` will no longer error if a different directory is used.

# sandpaper 0.11.14 (2023-04-04)

## BUG FIX

* A 404 page has been added (reported: @fmichonneau, #268; fixed:
@zkamvar, #429)

## DEPENDENCIES

* The minimum version of {pegboard} has been set to 0.5.1

## TEMPLATES

* The README, LICENSE, CONTRIBUTING, and SETUP templates have been fixed to work
with {pegboard} version 0.5.1
* The LICENSE and CONTRIBUTING templates now refer to The Carpentries as a
whole and provides correct links to community forums.

# sandpaper 0.11.13 (2023-03-25)

## WORKAROUND

* Fix an issue for {renv} version 0.17.2 where it was unable to provision
packages that were being used in the parent environment. This was a problem
in environments where the version of {sandpaper} was controlled by {renv}.
(reported: https://github.com/rstudio/renv/issues/1177, @zkamvar; fixed
#423, @zkamvar). Note that this fix is ONLY applicable to {renv} 0.17.2
and will be fixed with newer versions of {renv}.

# sandpaper 0.11.12 (2023-03-22)

## CONTINUOUS INTEGRATION

* workflow files now have explicit permissions to comment on pull requests or
create new branches when called. This fixes an issue where new lessons would
not have the ability to preview pull requests or update workflows.
(reported: #420, @zkamvar; fixed #421, @zkamvar)
* the `create-pull-request` action is now coming from a fork in The Carpentries
organisation for security.

## MISC

* A typo has been fixed in the package cache vignette
- The CONTRIBUTING boilerplate has been updated to fix formatting issues

# sandpaper 0.11.11 (2023-03-17)

## BUG FIX

* `update_cache()` will now work with {renv} version 0.17.1, which lost a
print method for the `renv_updates` class (reported: @zkamvar, #415;
fixed: @zkamvar, #416 and
https://github.com/zkamvar/vise/commit/ee4798701a958ee48429980eb970266885f8265b

# MISC

* @jcolomb has been added as a contributor in the DESCRIPTION.

# sandpaper 0.11.10 (2023-03-16)

## BUG FIX

* New lessons will now provision `learners/resources.md`, which will allow the
glossary link to work (reported: @elichad, #404 and
@ManonMarchand,
https://github.com/carpentries/workbench-template-md/issues/20;
fixed: @zkamvar, #410)
- default CONTRIBUTING file is better suited to The Workbench and no longer
references the now-defunct lesson-example repository (reported and fixed:
@jcolomb, #407)

# sandpaper 0.11.9 (2023-03-14)

## BUG FIX

* Links to assets in instructor view no longer render a 404. (reported:
@brownsarahm, #404; fixed: @zkamvar, #408)
@brownsarahm, #404; fixed: @zkamvar, #409)

CONTINUOUS INTEGRATION
----------------------
## CONTINUOUS INTEGRATION

* Lessons with files that have spaces in their names (e.g as a learning tool)
no longer fail to comment on pull request previews (reported: @zkamvar, #399;
Expand Down
39 changes: 39 additions & 0 deletions R/build_404.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
build_404 <- function(pkg, quiet) {
page_globals <- setup_page_globals()
calls <- sys.calls()
is_prod <- in_production(calls)
if (is_prod) {
url <- page_globals$metadata$get()$url
page_globals$instructor$set(c("site", "root"), url)
page_globals$learner$set(c("site", "root"), url)
}
path <- root_path(pkg$src_path)

fof <- fs::path_package("sandpaper", "templates", "404-template.txt")
html <- xml2::read_html(render_html(fof))
if (is_prod) {
# make sure index links back to the original root
lnk <- xml2::xml_find_first(html, ".//a[@href='index.html']")
xml2::xml_set_attr(lnk, "href", url)
# update navigation so that we have full URL
nav <- page_globals$learner$get()[c("sidebar", "more", "resources")]
for (item in names(nav)) {
new <- gsub("href='", paste0("href='", url), nav[[item]])
page_globals$learner$set(item, new)
page_globals$instructor$set(item, new)
}
}
fix_nodes(html)

this_dat <- list(
this_page = "404.html",
body = html,
pagetitle = "Page not found"
)
page_globals$instructor$update(this_dat)
page_globals$learner$update(this_dat)
page_globals$meta$update(this_dat)

build_html(template = "extra", pkg = pkg, nodes = html,
global_data = page_globals, path_md = "404.html", quiet = quiet)
}
Loading