Querying Requested Extras in build_ext
See original GitHub issueHi,
I am building an external CMake extension with
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
self.sourcedir = os.path.abspath(sourcedir)
class CMakeBuild(build_ext):
def run(self):
# ...
for ext in self.extensions:
self.build_extension(ext)
def build_extension(self, ext):
# ...
# ...
setup(
# ...
ext_modules=[CMakeExtension('openpmd_api')],
extras_require={
'mpi': ['mpi4py'],
},
# ...
)
and would like to query the user-requested extras
during the build_extension
step, in order to find out if the extra 'mpi'
was requested (via pip install .[mpi]
) or not. Is there a way to query this?
Full example: setup.py
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
QUERY/COLLECTION/SQL/OTHER FOR ALL COMPLIANCY
Hi,. I need a way of getting 5 columns out: Hostname, Last Logon Timestamp, Latest CU in SCCM, Installed CU, Compliant (true/false).
Read more >distutils: How to pass a user defined parameter to setup.py?
Generally speaking I would suggest providing a bit more information what exactly your extra parameter should do, maybe there is a better solution...
Read more >What is BEP and what is EIR? What is CDE? - BuildEXT
What is CDE? ; Workflow Management, Ability to automate, manage and report; Request for Information (RFI) Management ; Model Management, Version ...
Read more >[#ARROW-2269] [Python] Cannot build bdist_wheel for Python - ASF ...
I am trying current master. I ran: {{{{ python setup.py build_ext --build-type=$ARROW_BUILD_TYPE --with-parquet --with-plasma --bundle-arrow-cpp bdist_wheel } ...
Read more >[Solved]-Debugging ExtJS errors after build-ext.js - appsloveworld
There is no easy way on debugging ExtJS (or any other Javascript) application after you have minified the code, although there are a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s my (late) response as posted in the Gitter inquiry (I haven’t read the thread above).
@ax3l I do not think that “extras” are intended to control additional functionality in the build, they are intended to allow you to specify dependencies for optional runtime features (see the documentation). I could certainly be wrong because I don’t know much about the history of the “extras” feature, but it’s really about declaring metadata for the front-end.
At least the way the build tools currently work, the idea is that at build time you would build everything you support, and at install time those features would only actually be usable if you had specified the extra options. This means that either you make a hard build-time requirement of
mpi
, regardless of the extra options, but make it optional at install time, or you separate out the parts that requirempi
into a separate package that itself has a hard requirement ofmpi
.