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

Exclude test/* from sdist #131

Open
sverhoeven opened this issue Mar 20, 2023 · 2 comments
Open

Exclude test/* from sdist #131

sverhoeven opened this issue Mar 20, 2023 · 2 comments

Comments

@sverhoeven
Copy link
Member

When I build distros with python3 -m build I get a dist/grpc4bmi-0.4.0.tar.gz which contains the tests like test/test_client.py . The sdist should not contain test files.

The wheel does not contain any test files.

@sverhoeven
Copy link
Member Author

Tried automatic discover, but gave error:

error: Multiple top-level packages discovered in a flat-layout: ['cpp', 'data', 'proto', 'grpc4bmi'].

To avoid accidental inclusion of unwanted files or directories,
setuptools will not proceed with this build.

If you are trying to create a single distribution with multiple packages
on purpose, you should not rely on automatic discovery.
Instead, consider the following options:

1. set up custom discovery (`find` directive with `include` or `exclude`)
2. use a `src-layout`
3. explicitly set `py_modules` or `packages` with a list of names

To find more information, look for "package discovery" on setuptools docs.

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist

Also tried exclude = ["test"] to pyproject.toml:tool.setuptools.packages.find , but test/** still included.

Might need to switch to src-layout or other build tool like hatch.

@BSchilperoort
Copy link
Member

I tried some things, and it turns out that by including a MANIFEST.in file you can exclude the test folder.

MANIFEST.in

prune test

Was enough. It's automatically detected by setuptools.

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

2 participants