
Set up a reportifyr project without pyro, uv or the network
Source:R/initialize-report-offline.R
initialize_report_project_offline.Rdreportifyr::initialize_report_project() creates the report folders, the
config files and the .report_init.json marker, but only after
pyro::initialize_python() has installed uv (with curl, if it isn't on
PATH) and run uv lock and uv sync against PyPI. This does the other
part on its own: the same folders, the same config.yaml and
standard_footnotes.yaml copied from reportifyr, and the same marker, for a
project whose Python runs from an environment you already have
(python_env, see initialize_quartifyr_project()). Nothing is installed,
no .venv, pyproject.toml or uv.lock is created, and nothing reaches the
network.
Usage
initialize_report_project_offline(
project_dir = ".",
python_env = NULL,
report_dir_name = NULL,
outputs_dir_name = NULL
)Arguments
- project_dir
The project directory (must exist).
- python_env
Path to a Python environment (or a project directory holding a
.venv) withpython-docx,pyyamlandpillow. Verified, not modified. Defaults togetOption("quartifyr.python_env"), then theQUARTIFYR_PYTHON_ENVenvironment variable; with neither, only the project scaffold is created.- report_dir_name, outputs_dir_name
As for
reportifyr::initialize_report_project(); the defaults are"report"and"OUTPUTS".
Details
It is safe to run again: anything that already exists is left as it is, the
marker included. (Running reportifyr::initialize_report_project() on a
project that already has its marker goes back through pyro and the network.)
With a python_env set, render_report() runs reportifyr's pass 2 in that
same environment, so one environment serves both passes. reportifyr still
runs uv to do it, so uv must be installed, but it is told to use that
environment as it is and never syncs, resolves or downloads anything.
Examples
if (FALSE) { # \dontrun{
initialize_report_project_offline(".", python_env = "/opt/envs/report")
initialize_quartifyr_project(".", python_env = "/opt/envs/report")
# Then, with QUARTIFYR_PYTHON_ENV=/opt/envs/report set:
# Rscript "$(Rscript -e 'cat(system.file("scripts", "render.R", package = "quartifyr"))')" \
# --project . --shell report.qmd --strict --json --offline
} # }