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

Explicitly specify package for setuptools #81

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Explicitly specify package for setuptools #81

merged 1 commit into from
Apr 23, 2024

Conversation

lkiesow
Copy link
Member

@lkiesow lkiesow commented Apr 23, 2024

This patch explicitly specifies the package for setuptools so that additional folders in the current workspace are not picked up by accident.

For example, here I still had a folder rpm in my workspace while running setup.py:

✦ ❯ python setup.py sdist
error: Multiple top-level packages discovered in a flat-layout: ['rpm', 'occameracontrol'].

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.

This patch explicitly specifies the package for setuptools so that
additional folders in the current workspace are not picked up by
accident.

For example, here I still had a folder `rpm` in my workspace while
running `setup.py`:

```
✦ ❯ python setup.py sdist
error: Multiple top-level packages discovered in a flat-layout: ['rpm', 'occameracontrol'].

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.
```
@lkiesow lkiesow merged commit 019eb80 into main Apr 23, 2024
15 checks passed
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.

1 participant