Skip to content

Commit 3482622

Browse files
committed
build: Move build config to pyproject.toml
A warning says: .../setuptools/config/pyprojecttoml.py:72: _ExperimentalConfiguration: `[tool.setuptools.ext-modules]` in `pyproject.toml` is still *experimental* and likely to change in future releases. Let's be adventurous! :)
1 parent 1640b3b commit 3482622

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

.readthedocs.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ build:
44
os: ubuntu-24.04
55
tools:
66
python: "3.14"
7+
apt_packages:
8+
- libzbar-dev
79

810
sphinx:
911
configuration: docs/conf.py

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,11 @@ disable = [
9292
"unused-argument",
9393
"wrong-import-order",
9494
]
95+
96+
97+
[[tool.setuptools.ext-modules]]
98+
name = "zbarlight._zbarlight"
99+
sources = ["src/zbarlight/_zbarlight.c"]
100+
extra-compile-args = ["-std=c99"]
101+
libraries= ["zbar"]
102+
# optional = FIXME: we don't want to build on ReadTheDocs

setup.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
11
#!/usr/bin/env python
2-
import os
3-
4-
from setuptools import Extension
52
from setuptools import setup
63

7-
setup(
8-
package_dir={ # FIXME: wait for https://github.com/pypa/setuptools/issues/1136
9-
"": "src",
10-
},
11-
ext_modules=[
12-
Extension(
13-
name=str("zbarlight._zbarlight"),
14-
sources=[str("src/zbarlight/_zbarlight.c")],
15-
extra_compile_args=["-std=c99"],
16-
libraries=["zbar"],
17-
optional=os.environ.get(
18-
"READTHEDOCS", False
19-
), # Do not build on Read the Docs
20-
),
21-
],
22-
)
4+
setup()

0 commit comments

Comments
 (0)