Skip to content

Commit

Permalink
Remove cmake version check from setup.py (#408)
Browse files Browse the repository at this point in the history
There is a cmake version is already specified in `CMakeLists.txt` and
this Windows-specific check in setup.py isn't required (and wasn't
accurate anyway)
  • Loading branch information
emlowe authored Jan 23, 2024
1 parent 8816486 commit 8e2aa34
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/usr/bin/python3
import os
import re
import sys
import platform
import subprocess

from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion


class CMakeExtension(Extension):
Expand All @@ -19,21 +17,14 @@ def __init__(self, name, sourcedir=""):
class CMakeBuild(build_ext):
def run(self):
try:
out = subprocess.check_output(["cmake", "--version"])
subprocess.check_output(["cmake", "--version"])
except OSError:
raise RuntimeError(
"CMake must be installed to build"
+ " the following extensions: "
+ ", ".join(e.name for e in self.extensions)
)

if platform.system() == "Windows":
cmake_version = LooseVersion(
re.search(r"version\s*([\d.]+)", out.decode()).group(1)
)
if cmake_version < "3.1.0":
raise RuntimeError("CMake >= 3.1.0 is required on Windows")

for ext in self.extensions:
self.build_extension(ext)

Expand Down

0 comments on commit 8e2aa34

Please sign in to comment.