<#18254 Depending on `python_distribution` nets a ...
# github-notifications
q
#18254 Depending on `python_distribution` nets a dependency on all it's files and not just the wheel generated from it. Issue created by jsirois The use case that brought this fact to attention is demonstrated here: https://github.com/tgolsson/pants-pex-readme-collision-repro The short of it is that a target depends on 2
python_distribution
targets. Each
python_distribution
has its own
README.md
which gets included in the generated sdist but not the generated wheel - which is as things should be. The issue comes from Pants going further than just adding the wheel as a dependency. Instead it goes the extra mile to add in all sources depended on by the
python_distribution
that are not included by the wheel itself: pants/src/python/pants/backend/python/util_rules/pex_from_targets.py Lines 495 to 507 in </pantsbuild/pants/commit/9f2acf3387a6356286b04088744dc804cc1523e6|9f2acf3> This has ill-effects in this case since there are two README.md files, each with different content:
Copy code
$ pants package cmd:main
08:06:34.40 [ERROR] 1 Exception encountered:

Engine traceback:
  in `package` goal

Exception: Can only merge Directories with no duplicates, but found 2 duplicate entries in :

`README.md`: 1.) file digest=96d7f2c61ad10f92e449136b94433c482ad88ef52f8d9513dd1426c4fb3ea17e size=44:

# B's README

Dummy placeholder lorem ipsum


`README.md`: 2.) file digest=028373478b36dc388b32c231aacb2962b6530618c38ae32af9aad1e7ace29323 size=44:

# A's README

Dummy placeholder lorem ipsum
pantsbuild/pants