https://pantsbuild.org/ logo
#general
Title
# general
g

gentle-guitar-84783

03/10/2022, 8:06 PM
is there any way to automatically strip the whole working directory in a
relocated_files
target, meaning I want to set
src='{cwd}', dest=''
rather than having to write out the boilerplate myself
I assume since they're just python files (technically) there's prob a way to do this
h

hundreds-father-404

03/10/2022, 8:15 PM
There is not atm. In v1 there was with
buildfile_path
, but it didn't make it to v2. (It also used absolute paths which aren't useful) https://github.com/pantsbuild/pants/pull/12746/files I think this would be useful to add back though, and
cwd()
is a good name imo! Would you be willing to please open a ticket at https://github.com/pantsbuild/pants/issues/new/choose? Some of these APIs are changing very soon, so we'll need to do a little thinking of the best way to implement Lmk also if you are interested in getting this working in your repo today. It's only copying and pasting a little of the PR above. But disclaimer, this might stop working in Pants 2.12 when we are able to make the API changes we want
g

gentle-guitar-84783

03/10/2022, 8:19 PM
nah, it's not that big of a deal, I was just wondering if there was either a) something undocumented or b) I wasn't able to find the documentation
I'll open a ticket
ticket: https://github.com/pantsbuild/pants/issues/14757 let me know if anything is unclear or needs to be edited
❤️ 1
h

hundreds-father-404

03/17/2022, 4:34 AM
@gentle-guitar-84783 good news, this was super easy to implement and it's safe with the upcoming changes we're making to that old macro system. This will be in Pants 2.11.0rc0, which we hope to release today https://github.com/pantsbuild/pants/issues/14757
💯 1
g

gentle-guitar-84783

03/18/2022, 5:53 PM
That's awesome, thanks so much Eric!