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

setuptools 69 includes type information by default #160

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Feb 14, 2025

Closes #112

assert pkg_data.package_data == (
{"singlefilepkg-stubs": ["__init__.pyi", "METADATA.toml", "py.typed"]}
)
assert pkg_data.package_data == ({"singlefilepkg-stubs": ["METADATA.toml"]})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests were checking for strings in package_data, but I don't think there's any test to ensure that the right files are actually collected.

package_data[pkg_name + SUFFIX] = [*stub_files, META]
pkg_data = PackageData(base_path, package_data)
for package in pkg_data.top_level_non_namespace_packages:
pkg_data.add_file(package, "py.typed")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, this is the only call of PackageData.add_file(), so we can remove that method.

Comment on lines -233 to -234
elif file == "py.typed":
result.append(os.path.relpath(os.path.join(root, file), top))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By removing this, I'd expect this function to crash, as the build directory will have py.typed files and the next elif branch checks for unknown files.

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

Successfully merging this pull request may close these issues.

setuptools v69 includes type information by default
2 participants