Allow the version to be specified on the command line when building a wheel
Issue Kind
Change in current behaviour
Description
The existing --config-settings option seems to filter out version and ignores overriding it from the CLI
--config-settings local-version is insufficient to integrate with a CI/CD pipeline (and is more suitable for local builds.)
Impact
Almost everything is built in a CI/CD pipeline today and versioning is generated automatically according to a set of CI/CD rules (post commits, git tag, branch name, et. al.)
As the pyproject.toml file is a source-controlled file, updating the version in it makes the build dirty. Pushing a changeset to update an automatically calculated version is unnecessary noise and pushing a changeset changes the post/dev version ... Further this is contrary to a primary objective we created the CI/CD tools for, back in 1999, to achieve non-repudiation in versioning.
Other tools, such as dart or cmake among a litany, allow you to specify the version on the CLI or pass it in via environment variables.
A rule could be made that the version must be unset or set to some specific "Allowed to override" or "Must override" value in the .toml to allow the CLI to override the version without altering the source-controlled pyproject.toml file.
Workarounds
You could capture the version, change it, then put it back ...
old_ver=$(poetry version) poetry version $version poetry build ... poetry version $old_ver
... but this still causes a dirty-build and creates a race-condition with other tasks that check for it that are executed in parallel.
The full-work-around is even more obnoxious, source-control pyproject.toml.template and generate pyproject.toml so that it is no longer source-controlled and poetry version may not alter it without creating a dirty build. Local developers then must [sym]ink pyproject.toml.template to pyproject.toml and then add a pre-commit hook to ensure the version is set to something obnoxious like "0.0.0+UNCONTROLLED" to prevent someone from checking in a legit-looking version.
Or build dirty and hope all other tools used have "ignore dirty" overrides.
I believe you can find plugins that do this sort of thing, I doubt that it will become a part of poetry itself