commit | e923f9e86c29dde355ffbef80420e5de843a79e7 | [log] [tgz] |
---|---|---|
author | Cal Jacobson <cj81499@users.noreply.github.com> | Thu Aug 15 15:36:51 2024 -0400 |
committer | GitHub <noreply@github.com> | Thu Aug 15 19:36:51 2024 +0000 |
tree | 4b5bab794ed46b1b85bfe46544f704029bf39256 | |
parent | 0d6d8f303a5d8cbd1f0a94984395725eb5642473 [diff] |
feat: update `compile_pip_requirements` to support multiple input files (#1067) `pip-compile` can compile multiple input files into a single output file, but `rules_python`'s `compile_pip_requirements` doesn't currently support this. With this change, the `requirements_in` argument to `compile_pip_requirements` can now accept a list of strings (in addition to the previously accepted argument types). In order to support a variable number of input files, my coworker (@lpulley) and I updated `dependency_resolver.py` to use the `click` CLI library. We felt this was acceptable since `pip-compile` already requires `click` to run, so we're not adding a new dependency. We also made changes to the script to avoid mutating `sys.argv`, instead opting to build a new list (`argv`) from scratch that'll be passed to the `pip-compile` CLI. While subjective, I feel this improves readability, since it's not immediately obvious what's in `sys.argv`, but it's clear that `argv` begins empty, and is added to over the course of the program's execution. --------- Co-authored-by: Logan Pulley <lpulley@ocient.com> Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com> Co-authored-by: Richard Levasseur <rlevasseur@google.com>
This repository is the home of the core Python rules -- py_library
, py_binary
, py_test
, py_proto_library
, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.