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

Context formatting doesn't work in custom build hook dependencies #1199

Open
oddfacade opened this issue Jan 4, 2024 · 4 comments · May be fixed by #1472
Open

Context formatting doesn't work in custom build hook dependencies #1199

oddfacade opened this issue Jan 4, 2024 · 4 comments · May be fixed by #1472

Comments

@oddfacade
Copy link

Here is the configuration in my pyproject.toml:

[tool.hatch.build.hooks.custom]
dependencies = [
    "mydependencypackage @ {root:parent:uri}",
]

I get this error when I run hatch build:

ERROR: Invalid requirement: 'mydependencypackage @ {root:parent:uri}'

It seems like the context formatting just isn't being applied.

For what it's worth, it also doesn't work in the build-system.requires but does work in project.dependencies and env dependencies.

@oddfacade
Copy link
Author

I'm willing to submit a fix for this if it's just an oversight. Mostly making this report to confirm that the behavior isn't intentional.

@ofek
Copy link
Collaborator

ofek commented Jan 4, 2024

I didn't think this would be useful, sure, I would gladly accept a PR!

@oddfacade
Copy link
Author

The motivation in my case is I have a documentation package containing pre-rendered html docs. It is separate from my main package, but has the main package as a build dependency. Both packages are in the same repo and meant to be kept in perfect sync.

@dvirtz
Copy link

dvirtz commented Feb 8, 2024

It would also be useful to support context formatting in build system requirements

[build-system]
requires = [
  "hatch-custom-publisher @ {root:parent:uri}/hatch-custom-publisher",
]

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 a pull request may close this issue.

3 participants