@@ -20,6 +20,7 @@ All project-level options live under
2020| --------| --------------| -------------| ---------|
2121| ` conanfile-path ` | ` [tool.conan-py-build] ` | Path to the Conan recipe, relative to project root | ` "." ` |
2222| ` extra-profile ` | ` [tool.conan-py-build] ` | Extra Conan profile composed on top of the active one | (none) |
23+ | ` extra-arguments ` | ` [tool.conan-py-build] ` | Extra Conan CLI flags appended to ` conan build ` and ` conan export-pkg ` | ` [] ` |
2324| ` version.file ` | ` [tool.conan-py-build.version] ` | Python file with ` __version__ ` | (none) |
2425| ` version.provider ` | ` [tool.conan-py-build.version] ` | ` "setuptools_scm" ` for version from git tags | (none) |
2526| ` packages ` | ` [tool.conan-py-build.wheel] ` | Paths to Python packages in the wheel | ` ["src/<name>"] ` |
@@ -29,6 +30,10 @@ Variants for extra profiles: `extra-profile-host`,
2930` extra-profile-build ` , ` extra-profile-all ` .
3031Paths relative to project root.
3132
33+ For one-off Conan overrides without shipping a separate
34+ profile file, use ` extra-arguments ` (see * Extra Conan
35+ arguments* below).
36+
3237Default ` packages ` is ` src/<normalized_project_name> `
3338(hyphens → underscores).
3439
@@ -119,6 +124,47 @@ or `CONAN_HOME` / `.conanrc`). Set
119124` CONAN_PY_BUILD_PROFILE_AUTODETECT=1 ` to autodetect
120125the profile instead of requiring ` default ` .
121126
127+ ## Extra Conan arguments
128+
129+ CLI flags appended to ` conan build ` and
130+ ` conan export-pkg ` . Symmetric with ` extra-profile ` ,
131+ with higher precedence — CLI flags win against any
132+ profile entry.
133+
134+ Bump ` compiler.cppstd ` to match a transitive dep
135+ (e.g. ` gdal/3.12.1 ` requires C++17, MSVC defaults
136+ to 14):
137+
138+ ``` toml
139+ [tool .conan-py-build ]
140+ extra-arguments = [" -s=compiler.cppstd=17" ]
141+ ```
142+
143+ Disable an optional dep feature and pin parallelism:
144+
145+ ``` toml
146+ [tool .conan-py-build ]
147+ extra-arguments = [
148+ " -o=gdal/*:with_arrow=False" ,
149+ " -c=tools.build:jobs=4" ,
150+ ]
151+ ```
152+
153+ For values with embedded double quotes (dict / list
154+ ` [conf] ` literals), use TOML literal strings (` '...' ` ):
155+
156+ ``` toml
157+ extra-arguments = [
158+ ' -c=tools.build:cflags+=["-O2", "-fPIC"]' ,
159+ ' -c=tools.cmake.cmaketoolchain:extra_variables={"FOO": "bar"}' ,
160+ ]
161+ ```
162+
163+ Any Conan CLI flag works: ` -s ` / ` -o ` / ` -c ` (host),
164+ ` -s:b ` / ` -o:b ` / ` -c:b ` (build context),
165+ ` --build=... ` , ` --lockfile=... ` . Pair-form
166+ (` ["-s", "compiler.cppstd=17"] ` ) is also accepted.
167+
122168## Entry points (PEP 621)
123169
124170` [project.scripts] ` , ` [project.gui-scripts] ` and
0 commit comments