Skip to content

Conversation

@millsks
Copy link

@millsks millsks commented Aug 27, 2025

Description

We use hatch-vcs in all of our projects. There is a specific version format that they push to us on our build pipeline to align with their SCM reporting. The HATCH_VERSION_OVERRIDE variable will allow me to set that prior to our build so that their requirement is being used.

If this variable is not set then then default behavior takes over.

@millsks
Copy link
Author

millsks commented Aug 27, 2025

@ofek ready for review.

Copy link
Collaborator

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should mirror the env vars setuptools_scm has for overrides/pretend versions

…sion

Support SETUPTOOLS_SCM_PRETEND_VERSION and SETUPTOOLS_SCM_PRETEND_VERSION_FOR_<DIST_NAME> for version override, aligning with setuptools_scm conventions as requested in PR review. Also update tests to verify override precedence and compatibility.
Switch override environment variables from SETUPTOOLS_SCM to HATCH_VCS for version control, as requested in PR review. Tests updated to match new variable names and precedence.
@millsks
Copy link
Author

millsks commented Aug 28, 2025

Thank you for the feedback @RonnyPfannschmidt. Do the changes that I made align with your suggestion? Let me know if it should be altered even further.

@millsks millsks changed the title feat(version-source): support HATCH_VERSION_OVERRIDE env var feat(version-source): mirror setuptools_scm override env vars for version Aug 28, 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

Successfully merging this pull request may close these issues.

2 participants