Skip to content

Possible to override pyproject.toml project version? #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alugowski opened this issue Jan 20, 2023 · 4 comments
Closed

Possible to override pyproject.toml project version? #176

alugowski opened this issue Jan 20, 2023 · 4 comments

Comments

@alugowski
Copy link

I'm building Python bindings for a C++ library. The C++ library defines its version and I'd like the Python bindings to have the same version.

Currently have this in my pyproject.toml:

[project]
version = "1.4.0"

Is it possible to override this value on the command-line somehow so my CI can set the value to match the C++ library's?

@henryiii
Copy link
Collaborator

It is invalid to use [project] partially. You must use a build backend (like scikit-build-core) that supports [project]. And you must define at least the name and version (though version can be dynamic).

Eventually, scikit-build-core will support setuptools-scm, which supports setting this via a config variable. It should also support setting it in CMake.

If you are not using the [project] table, then you can mix scikit-build and setuptools_scm, which allows this.

@alugowski
Copy link
Author

Of course I have the entire [project] filled out, but only included the lines I thought were relevant to the question. Complete file here

I do use scikit_build_core, it just now clicked that these are two different projects! Appologies for posting in the wrong place. I'm using only pyproject.toml, so it sounds like this will be possible in the future but not right now?

By the way thank you for building this. Scikit-build-core, pybind11, and cibuildwheel together make building a Python extension a downright joy compared to what it took last time I was down this path 8 years ago.

@henryiii
Copy link
Collaborator

henryiii commented Jan 20, 2023

Ah, makes much more sense. Yep, it will be possible in the not too distant future. I've got some preparatory work in a branch for it, in fact. Just have to work out the design, making it general enough but not too general.

(And these will eventually be much more closely integrated, give it 3-4 months :) )

@henryiii henryiii transferred this issue from scikit-build/scikit-build Jan 20, 2023
@henryiii
Copy link
Collaborator

Cross ref: #172 and #116.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants