I'm struggling to get pants to build a wheel that ...
# general
p
I'm struggling to get pants to build a wheel that includes a pth file; I have this in my //sdk/python/BUILD file
Copy code
resource(
    name="patch.pth",
    source="patch.pth",
)

python_distribution(
    name="dist",
    dependencies=[
        "//sdk/python/package/__init__.py",
        "//sdk/python:patch.pth"
    ],
)
but patch.pth does not end up in the generated whl
I tried a file target too for the pth target, which also did not get included; I also tried to have it be a python source, but pants was unhappy with it not ending in .py(i)
I have a feeling I need to make my own setup.py since I need to set data_files which pants does not set nor allow setting
making my own setup.py with
Copy code
data_files=[
        ("../../", ["patch.pth"]),
    ],
Fixed this
h
Yeah, presumably the generated
setup.py
just ignores that
.pth
file…
That whole area needs some work, it’s quite old now
p
My cursory glance at this made it seem like there was no particular reason that data_files could not be removed from the deny list: https://github.com/pantsbuild/pants/pull/22185
I didn't see pants actually setting the data_files param at all