From 8151420e51b048f6e438362d66b8b3f07290386a Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 2 Jun 2023 05:59:41 +0000 Subject: [PATCH] docs(compile_pip_requirements): Add note on requirements.txt VC The documentation is currently ambiguous on whether or not to check requirements.txt into version control. This has raised some confusion in other projects (e.g., https://github.com/google/gematria/pull/3). This makes it clear that requirements.txt files produced by this rule should be checked into version control in an easy to find place to avoid confusion. --- docs/pip.md | 3 +++ python/pip_install/requirements.bzl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/pip.md b/docs/pip.md index e4c3f21b79..8ad5b6903a 100644 --- a/docs/pip.md +++ b/docs/pip.md @@ -45,6 +45,9 @@ It also generates two targets for running pip-compile: - validate with `bazel test [name]_test` - update with `bazel run [name].update` +If you are using a version control system, the requirements.txt generated by this rule should +be checked into it to ensure that all developers/users have the same dependency versions. + **PARAMETERS** diff --git a/python/pip_install/requirements.bzl b/python/pip_install/requirements.bzl index 7594471897..86fd408647 100644 --- a/python/pip_install/requirements.bzl +++ b/python/pip_install/requirements.bzl @@ -42,6 +42,9 @@ def compile_pip_requirements( - validate with `bazel test [name]_test` - update with `bazel run [name].update` + If you are using a version control system, the requirements.txt generated by this rule should + be checked into it to ensure that all developers/users have the same dependency versions. + Args: name: base name for generated targets, typically "requirements". extra_args: passed to pip-compile.