read_py_requirements: Read an app's Python requirements

View source: R/dependencies-python.R

read_py_requirementsR Documentation

Read an app's Python requirements

Description

Reads requirements.txt, or pyproject.toml when there is no requirements.txt, and sorts each entry by whether pip can install it by name from a package index. Warns as detect_py_dependencies() describes.

Usage

read_py_requirements(appdir)

Arguments

appdir

Character string. Path to the app directory.

Value

A list with

  • packages: the package names, sorted and unique.

  • requirements: the requirement specs to install from an index, in file order, with their versions and environment markers.

  • direct: the entries that point at a URL, a version control repository or a path, which an index install cannot reach.

  • ignored: the pip option lines of requirements.txt, which are not read.

  • indexed: the names of the uv indexes that ⁠[tool.uv.sources]⁠ takes packages from, named by package.


shinyelectron documentation built on Dec. 3, 2026, 9:07 a.m.