Skip to content
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

Improve dynamic versioning documentation (clarify regarding regex vs. python evaluation)) #1906

Open
nyoma-diamond opened this issue Feb 6, 2025 · 0 comments

Comments

@nyoma-diamond
Copy link

Currently, dynamic versioning is performed by reading the provided file as a raw text file, even if it is a python file (e.g., __about__.py). This means hatch cannot parse the version if it parsed from elsewhere at build-time.

For example, suppose I have a separate YAML file with additional metadata about the project, I may want to parse the version (among other metadata) from that file at build-time. (I recognize this is a very strange case that can be worked around in different ways, but this is nonetheless a functional example to show how the documentation introduces confusion)

This causes confusion in the current versioning documentation (https://hatch.pypa.io/1.13/version/), which suggests referencing python files (e.g., __about__.py or __init__.py) to pull the dynamic version. This makes it somewhat unclear that these files are parsed literally as strings, and not evaluated at build-time. I'd suggest either changing these examples to not be python files, include non-python examples for comparison/clarification, and/or state more explicitly that the file at version.path is parsed as raw text.

@nyoma-diamond nyoma-diamond changed the title Improve dynamic versioning documentation (clarity regarding regex vs. python evaluation)) Improve dynamic versioning documentation (clarify regarding regex vs. python evaluation)) Feb 13, 2025
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

1 participant