commit | d8f6881931a63f40f6519ee077678215da6872af | [log] [tgz] |
---|---|---|
author | Richard Levasseur <rlevasseur@google.com> | Mon Dec 18 15:50:57 2023 -0800 |
committer | GitHub <noreply@github.com> | Mon Dec 18 23:50:57 2023 +0000 |
tree | 08e725b7d06a6ceb75dd95814ead91e61491e9c4 | |
parent | f9d6189b6320c1852078a16434846e69268d187e [diff] |
fix(bzlmod pip.parse): allow requirements with duplicate package lines (#1620) Requirements files are permitted to have duplicate lines for the same package. An example of this is having separate lines for a package and its extras. When we parse requirements, the parser discards the "extra" portion of the entry and returns a list of all the packages as-is. When a repository is created for each entry, this means the same name is used for multiple repositories. Under WORKSPACE builds, duplicate repository names aren't an error. It appears that last defined repo takes affect. Under bzlmod, duplicate repo names are an error. To fix, mimic the last-defined-wins behavior in bzlmod by using a map to dedupe the package names. Fixes https://github.com/bazelbuild/rules_python/issues/1615
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.
Currently, the core rules build into the Bazel binary, and the symbols in this repository are simple aliases. However, we are migrating the rules to Starlark and removing them from the Bazel binary. Therefore, the future-proof way to depend on Python rules is via this repository. SeeMigrating from the Bundled Rules
below.
The core rules are stable. Their implementation in Bazel is subject to Bazel's backward compatibility policy. Once migrated to rules_python, they may evolve at a different rate, but this repository will still 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.