cool-easter-32542
11/18/2024, 8:28 PMpants export \
--resolve=python-default \
--export-py-generated-sources-in-resolve=python-default
Fails with:
Traceback (most recent call last):
File "/Users/achrafmamdouh/GitHub/hera/dist/export/python/virtualenvs/python-default/3.12.7/__pants_codegen__/codegen_setup.py", line 15, in <module>
os.rename(os.path.join(codegen_dir, item), os.path.join(site_packages_dir, item))
OSError: [Errno 66] Directory not empty: '/Users/achrafmamdouh/GitHub/hera/dist/export/python/virtualenvs/python-default/3.12.7/__pants_codegen__/google' -> '/Users/achrafmamdouh/GitHub/hera/dist/export/python/virtualenvs/python-default/3.12.7/lib/python3.12/site-packages/google'
Why is it failing?
My protos depend on Google's well-known types & common types. Those protos are checked in into my codebase directly.
All Google proto packages start with google.. That's why pants tries to export the generated code under site-packages/google. At the same time, I have many Google python 3rd deps which are also written under site-packages/google. Hence the conflict.
The faulty line of code.
pantsbuild/pantscool-easter-32542
11/21/2024, 8:48 AM