File: uv_run_tool.Rd

package info (click to toggle)
r-cran-reticulate 1.41.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,088 kB
  • sloc: cpp: 5,154; python: 620; sh: 13; makefile: 2
file content (85 lines) | stat: -rw-r--r-- 3,593 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/py_require.R
\name{uv_run_tool}
\alias{uv_run_tool}
\title{uv run tool}
\usage{
uv_run_tool(
  tool,
  args = character(),
  ...,
  from = NULL,
  with = NULL,
  python_version = NULL
)
}
\arguments{
\item{tool, args}{A character vector of command and arguments. Arguments are
not quoted for the shell, so you may need to use \code{\link[=shQuote]{shQuote()}}.}

\item{...}{
  Arguments passed on to \code{\link[base:system2]{base::system2}}
  \describe{
    \item{\code{stdout,stderr}}{where output to \file{stdout} or
    \file{stderr} should be sent.  Possible values are \code{""}, to the \R
    console (the default), \code{NULL} or \code{FALSE} (discard output),
    \code{TRUE} (capture the output in a character vector) or a
    character string naming a file.}
    \item{\code{stdin}}{should input be diverted?  \code{""} means the default,
    alternatively a character string naming a file.  Ignored
    if \code{input} is supplied.}
    \item{\code{input}}{if a character vector is supplied, this is copied one
    string per line to a temporary file, and the standard input of
    \code{command} is redirected to the file.}
    \item{\code{env}}{character vector of name=value strings to set environment
    variables.}
    \item{\code{wait}}{a logical (not \code{NA}) indicating whether the \R
    interpreter should wait for the command to finish, or run it
    asynchronously.  This will be ignored (and the interpreter will
    always wait) if \code{stdout = TRUE} or \code{stderr = TRUE}. When
    running the command asynchronously, no output will be displayed on
    the \code{Rgui} console in Windows (it will be dropped, instead).}
    \item{\code{timeout}}{timeout in seconds, ignored if 0.  This is a limit for the
    elapsed time running \code{command} in a separate process.   Fractions
    of seconds are ignored.}
    \item{\code{receive.console.signals}}{a logical (not \code{NA}) indicating whether
    the command should receive events from the terminal/console that \R runs
    from, particularly whether it should be interrupted by \kbd{Ctrl-C}. This
    will be ignored and events will always be received when
    \code{intern = TRUE} or \code{wait = TRUE}.}
    \item{\code{minimized,invisible}}{arguments that are accepted on Windows but
    ignored on this platform, with a warning.}
  }}

\item{from}{Use the given python package to provide the command.}

\item{with}{Run with the given Python packages installed. You can also
specify version constraints like \code{"ruff>=0.3.0"}.}

\item{python_version}{A python version string, or character vector of python
version constraints.}
}
\value{
Return value of \code{\link[=system2]{system2()}}
}
\description{
Run a Command Line Tool distributed as a Python package. Packages are automatically
download and installed into a cached, ephemeral, and isolated environment on the first run.
}
\details{
\subsection{Examples}{

\if{html}{\out{<div class="sourceCode r">}}\preformatted{uv_run_tool("pycowsay", shQuote("hello from reticulate"))
uv_run_tool("markitdown", shQuote(file.path(R.home("doc"), "NEWS.pdf")), stdout = TRUE)
uv_run_tool("kaggle competitions download -c dogs-vs-cats")
uv_run_tool("ruff", "--help")
uv_run_tool("ruff format", shQuote(Sys.glob("**.py")))
uv_run_tool("http", from = "httpie")
uv_run_tool("http", "--version", from = "httpie<3.2.4", stdout = TRUE)
uv_run_tool("saved_model_cli", "--help", from = "tensorflow")
}\if{html}{\out{</div>}}
}
}
\seealso{
\url{https://docs.astral.sh/uv/guides/tools/}
}