early-toothbrush-63898
01/28/2021, 5:18 PMhundreds-father-404
01/28/2021, 5:38 PMearly-toothbrush-63898
01/28/2021, 5:46 PMfrom numpy.distutils.core import Extension, setup
setup(
packages=find_packages(),
ext_modules=[Extension(name="package.fortran", sources=glob("src/*.f90"))],
)
flat-zoo-31952
01/28/2021, 5:53 PMhundreds-father-404
01/28/2021, 5:54 PMa similar way to the setup.py example in the docsCool, that is what the other user Noah Pederson was using. See https://pantsbuild.slack.com/archives/C01CQHVDMMW/p1602024437005400 and the threads a little after for convos related to Noah's plugin. It looks like this is the latest gist we have https://gist.github.com/chiefnoah/5ef8bf37cbc724a3f2e7216cf858220a That first thread explains a bit how you will be using the codegen plugin hook so that Pants knows how to convert your
.pyx
files into something like a .so
file
Also refer to the plugin docs, starting with https://www.pantsbuild.org/docs/plugins-overview
A couple people have commented that the hardest part of writing a plugin is figuring out what the heck you want it to do - it's really helpful if you know what commands you'd run without Pants to get this done; Pants is more or less an orchestrator for other tools.It's really helpful if you know what commands you'd run without Pants to get this done; Pants is more or less an orchestrator for other tools.We're happy to talk through this, and any later parts. Feel free to start a thread in #plugins I'd probably recommend this workflow: 1. Confirm if you want to stick with setup.py vs. using the CLI. Either are valid. Josh is probably right that CLI may be simpler, but it would mean rewriting your current workflow + Noah's example not being as helpful, so maybe not. 2. Write down how you do this without Pants, including what commands you run 3. check out the basics of writing a plugin. Get an example working with the Target API, which is simpler than the Rules API. This will ensure you have things loading correctly 4. read over the Rules API docs, you don't need to fully understand everything at this point 5. follow that guide + Noah's example to use the codegen hook
early-toothbrush-63898
01/28/2021, 5:58 PM