hello guys, maybe a stupid a question, but I'm try...
# general
r
hello guys, maybe a stupid a question, but I'm trying to install a third-party package from Github (with some Cuda/c++ that need to be built), is there a way to add it to the BUILD file of 3rdparty? I've seen the example of
custom_tensorflow_op
, but that is just for wrapping and loading the .so file (the repo I want to add : https://github.com/facebookresearch/maskrcnn-benchmark)
a
not at all a stupid question!!! that backend is still quite new -- but i'd love to help you make this work out!
is your goal to make changes to the
maskrcnn-benchmark
source code, and test those out? or just to consume the released version of the library in your python code?
you can also feel free to make an issue at https://github.com/pantsbuild/pants/issues/new describing what you'd like to do and tagging @aloof-angle-91616
i've been waiting for an excuse to jump back into that code :) but i hope the native backend will be able to do what you want already
also feel free to message me on slack anytime about this
r
sure thanks @aloof-angle-91616 🙂
looked a bit in the already created issues, maybe it's a duplicate of this one ? https://github.com/pantsbuild/pants/issues/4740
but yes, my goal is to be able to consume a
maskrcnn-benchmark
source code (and define the version with commit/tag/ branch)
a
ah ok, great. we allow building
setup.py
-based projects vendored into the codebase (e.g. with a submodule) by adding a BUILD file declaring a
python_dist()
target in that directory. i can make a quick example repo for you today. sorry for the delayed response! i'm still here and would like to help you with this!
i added this to my TODO list for today
it's literally just putting a
python_dist()
target in a BUILD file and then you can depend on it as a python library basically so you can try it yourself probably
we used to support a special compile/link toolchain for
python_dist()
but we moved it to another workflow. pants actually provides gcc and llvm compile/link toolchains on osx and linux so you don't have to (and will pull them down from the internet if necessary). so we could add that back to
python_dist()
if that's a use case you need.
but in addition to the above, will put up a working example repo with pants consuming
maskrcnn-benchmark
later today, just a hectic day atm
r
cool , yeah I was looking at using
python_dist
, an example would be appreciated, thanks 🙂
a
ok, spending some time on this right now!
ok, i have a working example, but it requires a fix to pants :) will push a PR with this and tell you how to make it work before we make the next release
@rapid-crayon-8232 see https://github.com/pantsbuild/pants/pull/8442, the
Result
section links to my example repo at https://github.com/cosmicexplorer/example-pants-python-dist -- we'll need to merge this and then release it before you can use it in your repo normally, but before then you can use the instructions to run pants from source after checking out that PR
r
cool @aloof-angle-91616, I'll check that out , thanks a lot for the help
a
please ping me if you can't get this working
np!
r
was able to make it work, thanks @aloof-angle-91616
👍 1
a
awesome!!!
please let us know if we can help you set up anything else!