-1

I've created a C++ extension -- specifically a project built in MS 2017 and Python 3.x and using pybind11 v2.11 -- following this tutorial: https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2017/python/working-with-c-cpp-python-in-visual-studio?view=vs-2017

I'm trying to configure setup.py in a way so that it requires MSVC 2017 or newer to install. The options that I know of use Python package names to determine requirements/dependencies.

Is there an equivalent way to ensure that MSVC 2017+ exists on the user's machine, and if it doesn't, just don't install the module?

For example, something like:

# Require MS 2017+ to build the extension
module = Extension(
    ...,
    extra_compile_args=['MSVC>1910']
)

# Require MS 2017+ to install?
setup(
    ...,
    setup_requires=['MSVC>1910']
)

Or maybe create a pyproject.toml / requirements.txt file that specifies it?

adriyens
  • 39
  • 4

0 Answers0