Globs as Sources in Extension Modules #3384
-
Hi, I just noticed that while configuring extension modules with Setuptools, we cannot use glob patterns in the list of For example, if we have a package like this
and then in from setuptools import setup, Extension
foobar_ext = Extension(
name='foobar',
sources=['*.c'])
setup(ext_modules=[foobar_ext]) Now if we run
and it seems this goes only when we explicitly list out the C source code files: foobar_ext = Extension(
name='foobar',
sources=['foo.c', 'bar.c']) Would like to understand this better. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @codeandfire, I am not familiar with this part of the code yet, but I think this is originally intentional. Since right now to add extensions you need to use In the future we might want to add extensions support to |
Beta Was this translation helpful? Give feedback.
Hi @codeandfire, I am not familiar with this part of the code yet, but I think this is originally intentional.
Since right now to add extensions you need to use
setup.py
, the assumption might have been that if the user need to expand globs, they can do it themselves using the standard library.In the future we might want to add extensions support to
pyproject.toml
, and then have globs expanded in the case of config via TOML, but I haven't arrived there yet...