Bikeshed: `build-support/bin/` is getting unwield...
# development
h
Bikeshed:
build-support/bin/
is getting unwieldy: it started as a place for some shell scripts, but it now contains Python code that imports other Python code from the same dir, which is not namespaced under anything Pants-specific. I want to move that python code under the regular
src/python
root. The bikeshed question is, should this go under: 1)
src/python/pants/release
(
from pants.release.common import die
) 2) a new top-level package
src/python/pants_release
(
from pants_release.common import die
) In either case we would have visibility rules to prevent the Pants client from depending on this release code. Same as how we prevent test code from ending up in the distribution.
3️⃣ 1
1️⃣ 1
2️⃣ 4
Please vote via icon, and feel free to chime in in the thread
c
how about option 3️⃣
build-support/bin/pants/..
?
from pants import ..
although Pants can handle 1️⃣ just fine (and guarantee no mistakes) I think helps my mental image to not have directly under
src/python/pants
p
I often search code under
src/python/pants
to understand how to use something in a repo that uses pants or to see what is possible. With 1️⃣ would
pants.release
be included in the distributed artifact(s)?
h
@curved-television-6568 #3 adds peril due to possible name collisions between the source roots.
I would oppose that
c
fair enough
h
@proud-dentist-22844 In neither case would the code be in the distributed artifact
c
I like to explore options, with 3️⃣ out, I’m slightly in favour of 2️⃣ but wouldn’t mind 1️⃣ too much either…
p
Since it’s not distributed, and therefore not available at runtime, I would rather it go in something other than
src/python/pants
so it doesn’t mess with my habit of searching
src/python/pants
. 🙂
src/python/pants_build_support
👍 2
h
Other things under
src/python/pants
aren't available at runtime, e.g., tests
FWIW
I find it nicer to not have to think about that
but YMMV
p
but I don’t expect to be able to import from test files.
c
I agree with keeping it out, but you’d learn quick enough that you can’t import it from regular code
due to visibility rules 😉
p
The visibility backend only helps within the pants repo - not for me scanning through code while I’m writing pants plugins in other repos 😉
👍 1
c
same, hence I agree with keeping it out.. 🙂
h
OK, sounds like the 2's have it! So I will merge https://github.com/pantsbuild/pants/pull/19297 as-is
💥 1