Skip to content

Commit 8319acd

Browse files
authored
Move setup requirements out of setup.py and into pyproject.toml and dev-requirements.txt (#950)
Changes: * Move what was in the `setup_requires` field of `setup.py` into `pyproject.toml`. * Update the version of `setuptools` needed, to address a [recent security scan warning](https://github.com/quantumlib/qsim/security/code-scanning/86), about a vulnerability in [setuptools versions before 78.1.1](GHSA-5rjg-fvgr-3xxf). * Move the setuptools and Pybind requirements from `requirements.txt` to `dev-requirements.txt`. * Remove unused `typing_extensions` from `requirements.txt. I also made a drive-by addition to `.editorconfig` to add an indentation rule for `.toml` files.
1 parent 97eea6a commit 8319acd

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,8 @@ max_line_length = 88
5656
[*.sh]
5757
indent_size = 4
5858

59+
[*.toml]
60+
indent_size = 2
61+
5962
[{*.yaml,*.yml}]
6063
indent_size = 2

dev-requirements.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
cmake~=3.28.1
2-
black==25.9.0
2+
black~=25.9.0
3+
flynt~=1.0
34
isort[colors]~=6.0.1
5+
# The global option to pybind11 makes it include CMake files in a location where
6+
# CMake will find them. It makes a crucial difference in some environments.
7+
pybind11[global]
48
pylint~=4.0.2
59
pytest
610
pytest-xdist
711
py-cpuinfo
12+
setuptools>=78.1.1

pyproject.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
[build-system]
16+
requires = [
17+
"packaging",
18+
"setuptools>=78.1.1",
19+
"pybind11[global]",
20+
# "pip install" from sources needs to build Pybind, which needs CMake too.
21+
"cmake~=3.28.1",
22+
]
23+
build-backend = "setuptools.build_meta"
24+
1525
[tool.cibuildwheel]
1626
test-extras = "dev"
1727
dependency-versions = "latest"

requirements.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
absl-py
22
cirq-core~=1.0
33
numpy>=1.26.0
4-
# The global option to pybind11 makes it include CMake files in a location where
5-
# CMake will find them. It makes a crucial difference in some environments.
6-
pybind11[global]
7-
typing_extensions
8-
setuptools>=75.2.0

setup.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,6 @@ def build_extension(self, ext):
146146
maintainer_email="[email protected]",
147147
python_requires=">=3.10.0",
148148
install_requires=requirements,
149-
# "pip install" from sources needs to build Pybind, which needs CMake too.
150-
setup_requires=[
151-
"packaging",
152-
"setuptools>=75.2.0",
153-
"pybind11[global]",
154-
"cmake~=3.28.1",
155-
],
156149
extras_require={
157150
"dev": dev_requirements,
158151
},

0 commit comments

Comments
 (0)