early-toothbrush-6389804/15/2021, 8:19 PM
rather than BUILD files? I could probably build a wheel of the subproject and have pants treat it is an external dependency, but would appreciate if pants could automate this for me.
hundreds-father-40404/15/2021, 8:32 PM
What is the current status of support for compiling extension modules w/ numpy distutils?I want to make sure I'm understanding. You have a native extension module that uses NumPy, and you want to distribute via distutils instead of setuptools? Something else?
Can pants support arbitrary subprojects which use setup.py rather than BUILD files?It does support arbitrary subprojects with each being their own setuptools distribution. However, Pants auto-generates the setup.py file for you, e.g. to include only the
that is used by that subproject. You can still specify most the
kwargs, and you'd mostly copy and paste it from the
file into the
file. Check out https://www.pantsbuild.org/v2.4/docs/python-distributions. Is that similar to what you're looking for?
early-toothbrush-6389804/15/2021, 8:46 PM
You have a native extension module that uses NumPy, and you want to distribute via distutils instead of setuptools?Sort of. I am using f2py via numpy.distutils to build the extension module like this
I am open to compiling the fortran code in another way, but pants didn’t have much support for non-python projects last time i recalled. Perhaps we should abstract the problem I bit. I have a PEP-517/518 compatible python project that I would like to manage in the same monorepo as the rest of my source code. For some reason or other, I don’t want to use pants for this subproject, but instead want to treat it as if it were a third-party dependency. If this subproject were in a separate repo and pushed to pypi, I could treat it as a third-party dependency. My question is if I can do this with a local source tree. Thanks
from glob import glob from numpy.distutils.core import Extension, setup setup( ext_modules=[Extension(name="my_module", sources=glob("src/*.f90"))], )
happy-kitchen-8948204/16/2021, 6:02 PM
early-toothbrush-6389806/24/2021, 6:48 PM
happy-kitchen-8948206/25/2021, 1:04 AM
on it? sounds like yes.