Skip to content

vcs-versioning does not register a discover_workdir hook for PKG-INFO #1507

Closed

Description

@tiran

I'm interested to use meson-python based project from setuptools-scm to vcs-versioning.

[build-system]
requires = ["meson-python>=0.17", "meson>=1.6", "vcs-versioning"]
build-backend = "mesonpy"

[project]
name = "pycxxfilt"
dynamic = ["version"]
project(
    'pycxxfilt',
    'c', 'cpp',
    meson_version: '>=1.6.0',
    # Derive the version from the latest git tag via setuptools-scm; it falls
    # back to the sdist's PKG-INFO when building outside a git checkout.
    version: run_command(
        'python3', '-m', 'vcs_versioning',
        check: true,
    ).stdout().strip(),
)

However this approach does not work with version 2.3.1. vcs-versioning does not register a fallback discovery hook for PkgInfoWorkdir. Without the discovery workdir hook, vcs-versioning is unable to get dynamic versions from an sdist, so sdists are broken. The hook is only registered when setuptools-scm is installed as well.

[project.entry-points."vcs_versioning.discover_workdir"]
pkginfo = "setuptools_scm._integration._discover:discover_pkginfo"
egg-info = "setuptools_scm._integration._discover:discover_egg_info_metadata"

Also see mesonbuild/meson-python#845

Activity

  1. added a commit that references this issue on Sep 1, 2026
    74c8aad
  2. tiran commented on Sep 1, 2026

    @tiran
    ContributorAuthor

    Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions