Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support for hatchling and pdm (implement hook API) #401

Copy link
Copy link
@kiyoon

Description

@kiyoon
Issue body actions

Nowadays, it is becoming popular to use a modern build system. Versioneer is my favourite of all versioning tools I've used, but unfortunately it is limited to setuptools, which is limiting me to move onto different build systems. I tried versioneer with hatch as follows:

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "code"
path = "src/my_project/_version.py"
expression = "get_versions()['version']"

This was very straightforward so far. But the real problem is that versioneer doesn't provide a hook API to use for building sdist etc. and the _version.py needs to be replaced to a file with a constant when building!

This should be very easy to do with hooks:

https://hatch.pypa.io/latest/plugins/build-hook/reference/#hatchling.builders.hooks.plugin.interface.BuildHookInterface--hookspy

I appreciate your work on this project!

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    build toolsSuggestions for extending beyond setuptoolsSuggestions for extending beyond setuptools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.