pypa / hatch

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

hatch should not include tests in sdist by default #1659

Closed Ravencentric closed 1 month ago

Ravencentric commented 3 months ago

The size of tests can get pretty big (especially if you have some test data like I did) and the sdist ended up as big as 2MB while the wheel was only 8KB.

[tool.hatch.build.targets.sdist]
only-packages = true
exclude = [
  "tests/",
]

Adding the above got the sdist down to almost the same size as the wheel.

I would also propose defaulting to only-packages = true but it's not a hill I'll die on

Ravencentric commented 1 month ago

Bit of researching later, other build backends like the pypa/build and flit also include everything, so I guess that's the recommended practice.