Resolves the current branch HEAD SHA of every core PIP package and writes a `PIP_LOCK.csv` manifest with columns `package`, `branch`, `sha`. Teams can commit this file to version control to make installs deterministic across all members.
The lock is read by [init_metapip()] and refreshed by [update_pip_packages()].
Tolerance
Packages whose SHA cannot be resolved (e.g., network error, missing branch) are skipped with a warning; the lock is still written for the successfully resolved packages.
Workflow
1. Run `pip_snapshot()` after confirming that all packages are at the desired versions. 2. Commit the resulting `PIP_LOCK.csv`. 3. Team members run `init_metapip()` to install at the recorded SHAs.
Examples
if (FALSE) { # \dontrun{
# Write to the default location
pip_snapshot()
# Write to a custom path
pip_snapshot(path = "path/to/my/PIP_LOCK.csv")
# Write to a temp file (for testing)
pip_snapshot(path = tempfile(fileext = ".csv"))
} # }