Polylith, hatchling, and exclude directives #338
-
I'm working on a monorepo migration with polylith ( and really liking it! ) and am focusing on packaging, with the goal of moving what was previously CI scripts and tools into hatching build hooks; so that developers can build wheels / images locally with as few hoops as possible. This will also make some of the CI processes cleaner as well. One of these steps involves building in-line documentation for services ( which is a RST to markdown conversion process ). Is there a good pattern for using polylith with hatchling & excluding files from a brick? Or should I consider rewriting this entirely as a hatchling hook for finer control over these assets?
pyproject.toml file:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Hi @vEpiphyte! I think that I have missed out on this scenario. The Polylith Hatch hook uses the I'll have a look on how to solve this (it shouldn't be too difficult). Thank you for sharing this and I'm happy that you like Polylith! |
Beta Was this translation helpful? Give feedback.
-
Short update: I am working on a solution for this use case. It seems that the Hatch I am developing a solution to this, by modifying the Polylith hatch hook and the way bricks are copied during packaging. Current work here: https://github.com/DavidVujic/python-polylith/pull/341/files I will test this out, and will notify when there's a new release out! |
Beta Was this translation helpful? Give feedback.
-
Another update 😄 There's a new version out of the hatch hook that will use the exclude patterns. I will continue with adding support for it in EDIT: |
Beta Was this translation helpful? Give feedback.
-
Hi David! I just tested the latest release ( https://pypi.org/project/hatch-polylith-bricks/1.5.1/ ) and it did work! I had to set the excludes like the following:
Noting the |
Beta Was this translation helpful? Give feedback.
Or, if you want to get rid of all ".rst" files in the subfolders of
assets
: