Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py.typed marker file not included in published wheel #257

Open
jamesdow21 opened this issue Feb 26, 2025 · 1 comment
Open

py.typed marker file not included in published wheel #257

jamesdow21 opened this issue Feb 26, 2025 · 1 comment

Comments

@jamesdow21
Copy link
Contributor

Related to #223

The changes from #224 should have resulted in the py.typed marker file being included in the published wheel (following the instructions in the setuptools docs and the example package included in PEP561

When I build the package locally, the file is included; however, the layout I get in the locally built wheel is slightly different than the published version, so there is definitely some configuration or setuptools/wheel version difference.

@jamesdow21
Copy link
Contributor Author

TL;DR: potential fix is to just change package_data={"redshift-connector": ... in setup.py to package_data={"redshift_connector": ...

What might be happening is that it is due to the "-" vs "_" in the package name at

https://github.com/aws/amazon-redshift-python-driver/blob/master/setup.py#L97

setup(
    name="redshift_connector",
    version=__version__,  # type: ignore

and
https://github.com/aws/amazon-redshift-python-driver/blob/master/setup.py#L131

    include_package_data=True,
    package_data={"redshift-connector": ["*.py", "*.crt", "LICENSE", "NOTICE", "py.typed"]},
    packages=find_packages(exclude=["test*"]),

I'm not all that familiar with using setuptools, so I'm not sure if the difference there matters (even though those normalize to the same name)

The setuptools docs include this section on how the different package data configuration options interact

To include some data file into the .whl:

(not exclude-package-data) and ((include-package-data and MANIFEST.in) or package-data)
In other words, the file should not be excluded by exclude-package-data (highest priority), AND should be either:

  1. selected by package-data; or
  2. selected by MANIFEST.in AND use include-package-data = true.

The current setup is trying to add any .crt files as well as the LICENSE, NOTICE, and py.typed files using the package_data option, but I don't see anything except the .crt files included in the published wheel

The MANIFEST.in is

include redshift_connector/files/*
recursive-include files *.crt

Since include_package_data is set to True, it seems that the package_data configuration is not being included (i.e. rule 1 is never true) and the only extra files being added are those from rule 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant