diff --git a/requirements.txt b/requirements.txt index 26173852..db0d0054 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ cirq-core~=1.0 numpy~=1.16 pybind11 typing_extensions +setuptools \ No newline at end of file diff --git a/setup.py b/setup.py index ed4720c3..f637926c 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,6 @@ from setuptools import setup, Extension from setuptools.command.build_ext import build_ext -from distutils.version import LooseVersion class CMakeExtension(Extension): @@ -27,10 +26,12 @@ def run(self): ) if platform.system() == "Windows": - cmake_version = LooseVersion( + from packaging.version import parse + + cmake_version = parse( re.search(r"version\s*([\d.]+)", out.decode()).group(1) ) - if cmake_version < "3.1.0": + if cmake_version < parse("3.1.0"): raise RuntimeError("CMake >= 3.1.0 is required on Windows") for ext in self.extensions: @@ -116,6 +117,7 @@ def build_extension(self, ext): author_email="devabathini92@gmail.com", python_requires=">=3.7.0,<3.12.0", install_requires=requirements, + setup_requires=["packaging"], extras_require={ "dev": dev_requirements, },