pypa / hatch

Modern, extensible Python project management
https://hatch.pypa.io/latest/
MIT License
5.74k stars 280 forks source link

[Hatchling] Interpolate variable `version` in section `tool.hatch.build.targets.wheel.force-include` somehow? #1408

Open hartwork opened 3 months ago

hartwork commented 3 months ago

Hello Hatch, :wave:

thanks for sharing this PEP 517 backend and adding custom hooks to it! :pray:

In context of a non-trivial conversion towards pyproject.toml with Hatchling I've been trying to make a wheel install man pages to where Linux distros would expect them, and technically it seems I succeeded judging by the wheel content…

# unzip -l dist/latex_rubber-1.6.5-py3-none-any.whl | grep man | awk '{print $NF}' | sort
latex_rubber-1.6.5.data/data/share/man/fr/man1/rubber.1
latex_rubber-1.6.5.data/data/share/man/fr/man1/rubber-info.1
latex_rubber-1.6.5.data/data/share/man/fr/man1/rubber-pipe.1
latex_rubber-1.6.5.data/data/share/man/man1/rubber.1
latex_rubber-1.6.5.data/data/share/man/man1/rubber-info.1
latex_rubber-1.6.5.data/data/share/man/man1/rubber-pipe.1

…but the way I got there makes me keep wondering:

If this is too much in one ticket, I can split things up, I just wasn't sure how and if I should.

Would be great to understand what I'm missing, thanks in advance for you reply! :pray:

Best, Sebastian

CC @Flowdalic @hannob

ofek commented 3 months ago

Hey there!

hartwork commented 2 months ago

Hi @ofek, thanks a lot for your reply and help!

Thanks for that pointer! I first copied from there, expected to see failure, and then found that the feature is indeed working and just what I was looking for — awesome! — , but ignoring errors silently (which seems like a dangerous default, e.g. because every typo leads to a missing file in the archive).

I have created upstream pull request https://gitlab.com/latex-rubber/rubber/-/merge_requests/36/diffs now applying your idea.

  • It's [..] something Python installers are supposed to support and that won't ever change

That's good to know.

  • I don't quite understand the ask, can you explain what you mean?

With the situation changed now, I think it would be great if

What do you think?

CC @flowdalic @hannob