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

python: specify packages to install for each module #1246

Conversation

james-rms
Copy link
Collaborator

@james-rms james-rms commented Oct 9, 2024

Changelog

Docs

Description

Rely on setuptools' auto-discovery mechanism to find the python packages we're trying to expose while auto-excluding tests, which were previously being included into users' install directories.

Testing

  • Inspected wheel contents using python -m zipfile --list mcap_protobuf_support-0.5.2-py3-none-any.whl to ensure that the whole library content is present and no test directories are present.

@james-rms james-rms force-pushed the james/fg-8817-python-mcap-and-mcap-protobuf-support-create-tests-outside branch from cc644ca to 6b03885 Compare October 9, 2024 00:41
Copy link
Contributor

@indirectlylit indirectlylit left a comment

Choose a reason for hiding this comment

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

According to the docs:

Automatic discovery will only be enabled if you don’t provide any configuration for packages and py_modules. If at least one of them is explicitly set, automatic discovery will not take place.

And, during automatic discovery, tests is part of FlatLayoutPackageFinder.DEFAULT_EXCLUDE and FlatLayoutModuleFinder.DEFAULT_EXCLUDE.

So if I'm understanding all of that correctly, it might suffice to simply delete these config lines and let the flat-layout/adhoc discovery take place, and tests will be automatically excluded.

It sounds like this is a different codepath from find:, which is documented under custom discovery.

All that said, I think the change you made here is also good because being explicit is safe and straightforward.

@james-rms james-rms merged commit 2789ad4 into main Oct 9, 2024
23 checks passed
@james-rms james-rms deleted the james/fg-8817-python-mcap-and-mcap-protobuf-support-create-tests-outside branch October 9, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants