Hello all, wondering if this is the right channel ...
# general
b
Hello all, wondering if this is the right channel to ask the following: In evaluating Pants I'm wondering if it is feasible to have build artifacts that come from the scientific python stack (e.g. Numpy/Scipy). Some of our projects will wrap Fortran or C code. Is Pants going to be friend or foe here? ** For Fortran, we'll be using numpy's
f2py
module
h
Hmm, interesting. Depends on the details. For example, If these are built as Python extensions then Pants can handle that by building a local dist from your setup.py (or equivalent)
Or, you may be able to invoke relevant tools via the new adhoc_tool functionality
b
We do currently have everything in setup.py. Here is a snippet of the setup.py file with the interesting bits:
Copy code
from numpy.distutils.core import (setup, Extension)

my_c_extension = Extension('my_c_module', sources=['my_c_code.c'])
my_fortran_extension = Extension('my_fortran_module', sources=['my_fortran_code.f'])

setup(
    ...
    ext_modules=[my_c_extension, my_fortran_extension],
    ...
)
Are you familiar with this workflow?
As I'm typing this, I'm referencing some Numpy docs and I'm seeing a deprecation warning for this workflow, due to distutils... 😄
h
So if you have a
python_distribution
target for this setup.py and have
python_sources
targets with (inferred or explicit) dependencies on that
python_distribution
then Pants will build the wheel from the setup.py and ensure that it's on the sys.path when you run tests etc.
b
Will do, thanks!
Was hoping to switch everything over to pyproject.toml. I'll investigate whether this is possible.