What is setuptool's alternative to (the deprecated) distutils `strtobool`?

I am migrating to Python 3.12, and finally have to remove the last distutils dependency. I am using from distutils.util import strtobool to enforce that command-line arguments via argparse are in fact bool, properly taking care of NaN vs. False vs. True, like so: arg_parser = argparse.ArgumentParser() arg_parser.add_argument("-r", "–rebuild_all", type=lambda x: bool(strtobool(x)), default=True) So this… Read More What is setuptool's alternative to (the deprecated) distutils `strtobool`?

How to provide C++ version when extending python

I want to make c++ code callable from python. https://docs.python.org/3/extending/ explains how to do this, but does not mention how to specify c++ version. By default distutils calls g++ with a bunch of arguments, however does not provide the version argument. Example of setup.py: from distutils.core import setup, Extension MOD = "ext" module = Extension("Hello",… Read More How to provide C++ version when extending python