Skip to content

Supporting setuptools-git-version as a version provider #1257

@ktbarrett

Description

@ktbarrett

I would like to scikit-build-core and setuptools-git-version together in projects.

setuptools-git-version is similar to setuptools-scm, but is less opinionated and more configurable, only concerns itself with including the git version, and better supports shallow clones.

I see there is support in this repo for setuptools-scm, but comments mention that ideally it should not live in this repo. So for supporting setuptools-git-version, I will add support in setuptools-git-version. So this is more of a question of "what is the API of a version provider that scikit-build-core requires?"

I see:

def dynamic_metadata(
    field: str,
    settings: dict[str, object] | None = None,
) -> str:
    ...


def get_requires_for_dynamic_metadata(
    _settings: dict[str, object] | None = None,
) -> list[str]:
    ...

The first function takes a field from the list of dynamic fields from pyproject.toml and a settings object. What is passed to the settings arguments? I doubt I'll use it, but I'm curious. And the second one is dependencies for this plugin's function with that same settings object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions