1

Given the following folder structure:

-folder1
    -folder2
        -folder3
            -a.py
        -pyproject.toml
    -xyz.txt

And pyproject.toml

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "folder2"
version = "0.0.1"
description = "asd"

[tool.hatch.build.targets.wheel.force-include]
"../xyz.txt" = "folder3/xyz.txt"

Enter folder2 and run python -m build. According to https://hatch.pypa.io/latest/config/build/#forced-inclusion , it should generate a wheel file that contains folder2 with 2 files in it: a.py and xyz.txt, since

The force-include option allows you to select specific files or directories from anywhere on the file system that should be included and map them to the desired relative distribution path.. However, xyz.txt is not included. If I specify an absolute path to xyz.txt it works. However, relative path should also work according to the example shown at the forced-inclusion section: "../artifacts" = "pkg".

Ereghard
  • 119
  • 4

0 Answers0