Skip to content

Commit 4242c63

Browse files
committed
Move most setup.py content into pyproject.toml
The modern approach is to put more things into `pyproject.toml`. This moves most things out of `setup.py`, with the exception of the native code extensions parts, and the version number. (Still to do: figure out how to move the version number too.)
1 parent 0a9613d commit 4242c63

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

pyproject.toml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
[build-system]
16+
build-backend = "setuptools.build_meta"
1617
requires = [
1718
"packaging",
1819
"setuptools>=78.1.1",
@@ -21,15 +22,20 @@ requires = [
2122
# "pip install" from sources needs to build Pybind, which needs CMake too.
2223
"cmake~=3.28.1",
2324
]
24-
build-backend = "setuptools.build_meta"
2525

2626
[project]
2727
name = "qsimcirq"
2828
version = "0.23.0.dev0"
29-
description = "Schrödinger and Schrödinger-Feynman simulators for quantum circuits."
29+
description = "High-performance quantum circuit simulator for C++ and Python."
30+
authors = [
31+
{ name = "The qsim/qsimh Developers", email = "[email protected]" }
32+
]
33+
maintainers = [
34+
{ name = "Google Quantum AI", email = "[email protected]" }
35+
]
36+
license = "Apache-2.0"
37+
requires-python = ">=3.10.0"
3038
readme = "README.md"
31-
authors = [{ name = "The qsim/qsimh Developers", email = "[email protected]" }]
32-
license = { text = "Apache-2.0" }
3339
classifiers = [
3440
"Development Status :: 5 - Production/Stable",
3541
"Environment :: GPU :: NVIDIA CUDA",
@@ -71,16 +77,12 @@ keywords = [
7177
"state vector simulator",
7278
"software development kit",
7379
]
74-
requires-python = ">=3.10.0"
7580
dependencies = [
7681
"absl-py",
7782
"cirq-core~=1.0",
7883
"numpy>=1.26.0",
7984
]
8085

81-
[project.urls]
82-
Homepage = "https://github.com/quantumlib/qsim"
83-
8486
[project.optional-dependencies]
8587
dev = [
8688
"cmake~=3.28.1",
@@ -95,6 +97,13 @@ dev = [
9597
"setuptools>=78.1.1",
9698
]
9799

100+
[project.urls]
101+
homepage = "https://quantumai.google/qsim"
102+
documentation = "https://quantumai.google/qsim"
103+
source = "https://github.com/quantumlib/qsim"
104+
download = "https://pypi.org/project/qsimcirq/#files"
105+
tracker = "https://github.com/quantumlib/qsim/issues"
106+
98107
[tool.setuptools]
99108
packages = ["qsimcirq"]
100109
package-data = {"qsimcirq" = ["py.typed"]}
@@ -120,3 +129,11 @@ skip = "*musllinux*"
120129
[tool.black]
121130
target-version = ['py310', 'py311', 'py312', 'py313']
122131
extend-exclude = 'third_party'
132+
133+
[tool.isort]
134+
profile = 'black'
135+
order_by_type = false # Sort alphabetically, irrespective of case.
136+
skip_gitignore = true
137+
combine_as_imports = true
138+
known_first_party = ["cirq*"]
139+
extend_skip = ["__init__.py"]

setup.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
from setuptools import Extension, setup
2424
from setuptools.command.build_ext import build_ext
2525

26-
# This file is largely based on the setup.py file at
27-
# https://github.com/pybind/cmake_example/blob/master/setup.py
28-
2926
__version__ = "0.23.0.dev0"
3027

3128

0 commit comments

Comments
 (0)