Description
Building @typespec/http-client-python with current setuptools reports warnings that the data-only template directories are absent from the package configuration:
Package 'pygen.codegen.templates' is absent from the `packages` configuration.
Package 'pygen.codegen.templates.packaging_templates' is absent from the `packages` configuration.
generator/setup.py uses find_packages() with include_package_data=True, while generator/MANIFEST.in recursively includes the Jinja templates. Since the template directories do not contain __init__.py, find_packages() does not discover them, but recent setuptools versions treat them as importable packages and warn about the ambiguous configuration.
Reproduction
From packages/http-client-python:
The warnings are emitted while building the pygen wheel.
Current behavior
The wheel currently appears complete: pygen-0.1.0-py3-none-any.whl contains all 44 .jinja2 template files, including the seven files under pygen/codegen/templates/packaging_templates. This is therefore a packaging-configuration warning rather than a known missing-artifact bug.
Expected behavior
The pygen package configuration should explicitly and unambiguously include its template data, and building the wheel should not emit the missing-package warnings.
Acceptance criteria
- Building the pygen wheel does not report that
pygen.codegen.templates or pygen.codegen.templates.packaging_templates is absent from the package configuration.
- All existing Jinja templates remain present in the built wheel.
jinja2.PackageLoader("pygen.codegen", "templates") and the packaging-template loader continue to work from an installed wheel.
- Add or update a packaging test that verifies the required template files are included in the wheel.
Description
Building
@typespec/http-client-pythonwith current setuptools reports warnings that the data-only template directories are absent from the package configuration:generator/setup.pyusesfind_packages()withinclude_package_data=True, whilegenerator/MANIFEST.inrecursively includes the Jinja templates. Since the template directories do not contain__init__.py,find_packages()does not discover them, but recent setuptools versions treat them as importable packages and warn about the ambiguous configuration.Reproduction
From
packages/http-client-python:The warnings are emitted while building the pygen wheel.
Current behavior
The wheel currently appears complete:
pygen-0.1.0-py3-none-any.whlcontains all 44.jinja2template files, including the seven files underpygen/codegen/templates/packaging_templates. This is therefore a packaging-configuration warning rather than a known missing-artifact bug.Expected behavior
The pygen package configuration should explicitly and unambiguously include its template data, and building the wheel should not emit the missing-package warnings.
Acceptance criteria
pygen.codegen.templatesorpygen.codegen.templates.packaging_templatesis absent from the package configuration.jinja2.PackageLoader("pygen.codegen", "templates")and the packaging-template loader continue to work from an installed wheel.