1515import os
1616import platform
1717import re
18- import runpy
1918import shutil
2019import subprocess
2120import sys
2423from setuptools import Extension , setup
2524from setuptools .command .build_ext import build_ext
2625
26+ __version__ = "0.23.0.dev0"
27+
2728
2829class CMakeExtension (Extension ):
2930 def __init__ (self , name , sourcedir = "" ):
@@ -67,6 +68,8 @@ def build_extension(self, ext):
6768 "-DCMAKE_CUDA_COMPILER=nvcc" ,
6869 ]
6970
71+ # Append additional CMake arguments from the environment variable.
72+ # This is e.g. used by cibuildwheel to force a certain C++ standard.
7073 additional_cmake_args = os .environ .get ("CMAKE_ARGS" , "" )
7174 if additional_cmake_args :
7275 cmake_args += additional_cmake_args .split ()
@@ -110,9 +113,7 @@ def build_extension(self, ext):
110113
111114 env = os .environ .copy ()
112115 cxxflags = env .get ("CXXFLAGS" , "" )
113- env ["CXXFLAGS" ] = (
114- f'{ cxxflags } -DVERSION_INFO=\\ "{ self .distribution .get_version ()} \\ "'
115- )
116+ env ["CXXFLAGS" ] = f'{ cxxflags } -DVERSION_INFO=\\ "{ __version__ } \\ "'
116117 if not os .path .exists (self .build_temp ):
117118 os .makedirs (self .build_temp )
118119 subprocess .check_call (
@@ -124,42 +125,7 @@ def build_extension(self, ext):
124125 )
125126
126127
127- with open ("requirements.txt" ) as f :
128- requirements = [
129- line .strip () for line in f if line .strip () and not line .strip ().startswith ("#" )
130- ]
131- with open ("dev-requirements.txt" ) as f :
132- dev_requirements = [
133- line .strip () for line in f if line .strip () and not line .strip ().startswith ("#" )
134- ]
135-
136- description = "Schrödinger and Schrödinger-Feynman simulators for quantum circuits."
137-
138- # README file as long_description.
139- with open ("README.md" , encoding = "utf-8" ) as f :
140- long_description = f .read ()
141-
142- __version__ = runpy .run_path ("qsimcirq/_version.py" )["__version__" ]
143- if not __version__ :
144- raise ValueError ("Version string cannot be empty" )
145-
146128setup (
147- name = "qsimcirq" ,
148- version = __version__ ,
149- url = "https://github.com/quantumlib/qsim" ,
150- author = "The qsim/qsimh Developers" ,
151- author_email = "qsim-qsimh-dev@googlegroups.com" ,
152- maintainer = "Google Quantum AI" ,
153- maintainer_email = "quantum-oss-maintainers@google.com" ,
154- python_requires = ">=3.10.0" ,
155- install_requires = requirements ,
156- extras_require = {
157- "dev" : dev_requirements ,
158- },
159- license = "Apache-2.0" ,
160- description = description ,
161- long_description = long_description ,
162- long_description_content_type = "text/markdown" ,
163129 ext_modules = [
164130 CMakeExtension ("qsimcirq/qsim_avx512" ),
165131 CMakeExtension ("qsimcirq/qsim_avx2" ),
@@ -170,49 +136,5 @@ def build_extension(self, ext):
170136 CMakeExtension ("qsimcirq/qsim_decide" ),
171137 CMakeExtension ("qsimcirq/qsim_hip" ),
172138 ],
173- cmdclass = dict (build_ext = CMakeBuild ),
174- zip_safe = False ,
175- packages = ["qsimcirq" ],
176- package_data = {"qsimcirq" : ["py.typed" ]},
177- classifiers = [
178- "Development Status :: 5 - Production/Stable" ,
179- "Environment :: GPU :: NVIDIA CUDA" ,
180- "Intended Audience :: Developers" ,
181- "Intended Audience :: Science/Research" ,
182- "Operating System :: MacOS :: MacOS X" ,
183- "Operating System :: Microsoft :: Windows" ,
184- "Operating System :: POSIX :: Linux" ,
185- "Programming Language :: C++" ,
186- "Programming Language :: Python :: 3" ,
187- "Programming Language :: Python :: 3.10" ,
188- "Programming Language :: Python :: 3.11" ,
189- "Programming Language :: Python :: 3.12" ,
190- "Programming Language :: Python :: 3.13" ,
191- "Topic :: Scientific/Engineering :: Quantum Computing" ,
192- "Topic :: Software Development :: Libraries :: Python Modules" ,
193- "Typing :: Typed" ,
194- ],
195- keywords = [
196- "algorithms" ,
197- "api" ,
198- "application programming interface" ,
199- "cirq" ,
200- "google quantum" ,
201- "google" ,
202- "nisq" ,
203- "python" ,
204- "quantum algorithm development" ,
205- "quantum circuit simulator" ,
206- "quantum computer simulator" ,
207- "quantum computing" ,
208- "quantum computing research" ,
209- "quantum programming" ,
210- "quantum simulation" ,
211- "quantum" ,
212- "schrödinger-feynman simulation" ,
213- "sdk" ,
214- "simulation" ,
215- "state vector simulator" ,
216- "software development kit" ,
217- ],
139+ cmdclass = {"build_ext" : CMakeBuild },
218140)
0 commit comments