Skip to content

Commit d98f74b

Browse files
authored
Slightly enhance setup.py (#38)
Changes: * Add `cmake` to `setup_requires` in `setuptools.setup`. This helps ensure that builds get a known version of `cmake` even if it's not installed on the host system. * Add more fields to setuptools.setup(), including classifiers and keywords for greater discoverability. * Add the usual license header at the top of the file. * Fix a linter complaint about the call to `open`.
1 parent cc8798e commit d98f74b

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

setup.py

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
import glob
216
import os
317
import pathlib
@@ -73,7 +87,7 @@ def build_extension(self, ext):
7387

7488
__version__ = '1.2.dev0'
7589

76-
with open("README.md", "r", encoding="utf-8") as f:
90+
with open("README.md", encoding="utf-8") as f:
7791
long_description = f.read()
7892

7993
# HACK: Workaround difficulties collecting data files for the package by just making a directory.
@@ -91,13 +105,16 @@ def build_extension(self, ext):
91105
version=__version__,
92106
author="Craig Gidney",
93107
url="https://github.com/quantumlib/chromobius",
94-
description="A fast implementation of the mobius color code decoder.",
108+
description="A fast implementation of the Möbius color code decoder.",
95109
long_description=long_description,
96110
long_description_content_type='text/markdown',
111+
maintainer="Google Quantum AI open-source maintainers",
112+
maintainer_email="quantum-oss-maintainers@google.com",
113+
license="Apache-2.0",
97114
ext_modules=[CMakeExtension("chromobius", sourcedir=".", sources=RELEVANT_SOURCE_FILES)],
98115
cmdclass={"build_ext": CMakeBuild},
99116
python_requires=">=3.10",
100-
setup_requires=['ninja', 'pybind11~=2.11.1'],
117+
setup_requires=['ninja', 'pybind11~=2.11.1', 'cmake>=3.13'],
101118
install_requires=['numpy', 'stim'],
102119

103120
# Needed on Windows to avoid the default `build` colliding with Bazel's `BUILD`.
@@ -111,4 +128,25 @@ def build_extension(self, ext):
111128
package_dir={'chromobius': package_data_dir.name},
112129
package_data={'chromobius': [str(e) for e in package_data_dir.iterdir()]},
113130
include_package_data=True,
131+
classifiers=[
132+
"Operating System :: MacOS :: MacOS X",
133+
"Operating System :: Microsoft :: Windows",
134+
"Operating System :: POSIX :: Linux",
135+
"Programming Language :: Python :: 3",
136+
"Programming Language :: Python :: 3.10",
137+
"Programming Language :: Python :: 3.11",
138+
"Programming Language :: Python :: 3.12",
139+
"Programming Language :: Python :: 3.13",
140+
"Programming Language :: Python :: 3.14",
141+
"Topic :: Scientific/Engineering :: Quantum Computing",
142+
],
143+
keywords=[
144+
"algorithms",
145+
"color code",
146+
"fault-tolerant quantum computing",
147+
"möbius decoder",
148+
"quantum computing",
149+
"quantum error correction",
150+
"quantum",
151+
],
114152
)

0 commit comments

Comments
 (0)