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

Add support for context formatting in builder dependencies. #1472

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthewwardrop
Copy link

@matthewwardrop matthewwardrop commented May 6, 2024

closes: #1199

Hi @ofek !

Thanks for this great tool. I (like @oddfacade) want to be able to use local dependencies in my build configuration (for custom version schemes in setuptools_scm, which cannot directly import modules at the project root because they do not want to include the project root in the Python path during build; see my previous attempt to solve my problem in PR to that project). This is my stab at a quick PR to enable support in Hatch for inserting a local module into the build environment, but I understand there is some discussion in #1331 about scaling back support for this context formatting, so if this is no longer desired feel free to reject it.

I have not added any unit tests yet, but feel free to suggest where and how many tests you think are required (or to simply add them if you prefer).

Copy link
Sponsor Collaborator

@ofek ofek left a comment

Choose a reason for hiding this comment

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

Thanks!

backend/src/hatchling/builders/config.py Outdated Show resolved Hide resolved
backend/src/hatchling/builders/config.py Outdated Show resolved Hide resolved
@matthewwardrop matthewwardrop force-pushed the add_context_formatting_for_builder_deps branch from d116be8 to ba95c39 Compare May 7, 2024 16:50
@matthewwardrop matthewwardrop requested a review from ofek May 7, 2024 16:51
@matthewwardrop
Copy link
Author

@ofek Will get this tidied up and add some unit tests today. Thanks for your prompt review!

@matthewwardrop matthewwardrop force-pushed the add_context_formatting_for_builder_deps branch from ba95c39 to fc8a5a8 Compare May 7, 2024 22:28
@matthewwardrop
Copy link
Author

@ofek Should be good to go, including the new unit tests.

@matthewwardrop
Copy link
Author

@ofek Any updates here?

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.

Context formatting doesn't work in custom build hook dependencies
2 participants