citymania-org / grf-py

A Python framework for making NewGRFs for OpenTTD
GNU General Public License v2.0
15 stars 5 forks source link

setup.py: use glob to include submodules. #18

Closed ahyangyi closed 11 months ago

ahyangyi commented 11 months ago

I think I understand setup(includes=blablabla) now: it searches for all python modules under the current directory, represent each as a python module name (e.g. grf.lib).

Then, each of the supplied glob in includes is used to match the said module names, and anything that matches is included in the wheel. So, to match both grf and grf.lib, a single grf* suffices, but it also risks accidentally including stuff like grf_resources. On the other hand, using both grf and grf.* makes sure to exclude any other top-level directories while still being future-proof enough to include anything under grf/ recursively.

See also #17, which is an alternative.