early-toothbrush-63898
04/15/2021, 8:19 PMsetup.py
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-404
04/15/2021, 8:32 PMWhat 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
install_requires()
that is used by that subproject. You can still specify most the setup()
kwargs, and you'd mostly copy and paste it from the setup.py
file into the BUILD
file. Check out https://www.pantsbuild.org/v2.4/docs/python-distributions. Is that similar to what you're looking for?early-toothbrush-63898
04/15/2021, 8:46 PMYou 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
from glob import glob
from numpy.distutils.core import Extension, setup
setup(
ext_modules=[Extension(name="my_module", sources=glob("src/*.f90"))],
)
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. Thankshappy-kitchen-89482
04/16/2021, 6:02 PMearly-toothbrush-63898
06/24/2021, 6:48 PMhappy-kitchen-89482
06/25/2021, 1:04 AMsetup
on it? sounds like yes.