Does anyone know if there's way to package a pytho...
# general
n
Does anyone know if there's way to package a python_distribution in a sub directory so that the subdirectory path isn't included in the final distribution? E.g. In my repo i have python source files under
lib/my_package
and in the .tar.gz it is packaged as
lib/my_package/...
and when I install it, under
site_packages/lib/my_package
. How can I get rid of
lib
? BUILD file currently:
Copy code
resources(name="build_files", sources=["LICENSE", "README.md"])

python_sources(name="my_package")

python_distribution(
    name="my_package_dist",
    dependencies=[":build_files", ":my_package"],
    provides=python_artifact(
        name="my_package",
        version="0.0.1",
    ),
    interpreter_constraints=[">=3.11.0"],
    wheel=False
)
p
I think you want to make lib a source root
n
I can't believe it was that simple. Thank you!