Skip to content

Refactor package configuration parsing in ls_modules and pkgdb_to_bzl#1457

Merged
mergify[bot] merged 3 commits intomasterfrom
ls-modules
Jan 5, 2021
Merged

Refactor package configuration parsing in ls_modules and pkgdb_to_bzl#1457
mergify[bot] merged 3 commits intomasterfrom
ls-modules

Conversation

@aherrmann
Copy link
Contributor

Closes #1453
Closes #1396

The package configuration parsing code in ls_modules did not handle line wrapped fields correctly. As pointed out in #1169 (comment) we already have code handling wrapped fields in pkgdb_to_bzl.py. This PR factors this code out into a standalone Python module and uses that same module for package configuration parsing in both ls_modules and pkgdb_to_bzl.py. The former is a regular py_binary target, i.e. the library dependency is handled by Bazel. The latter is executed in a repository rule by invoking the Python interpreter directly. In that case the module import works because the package_configuration.py module is placed in the same directory as pkgdb_to_bzl.py.

This PR also adds a Python test suite for the new Python module. This includes a regression test for #1453 .

@mboes mboes added the merge-queue merge on green CI label Jan 5, 2021
@mergify mergify bot merged commit d58e231 into master Jan 5, 2021
@mergify mergify bot deleted the ls-modules branch January 5, 2021 10:05
@mergify mergify bot removed the merge-queue merge on green CI label Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ls_modules fails with multi-line id: entry

2 participants