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

If the module to build is name as "build", the flit-core may run some mistake exception #648

Open
desert-sailor opened this issue Jun 1, 2023 · 1 comment

Comments

@desert-sailor
Copy link

desert-sailor commented Jun 1, 2023

the log is blow:

[   27s]     File "/usr/lib/python3.10/site-packages/flit_core/common.py", line 54, in __init__
[   27s]       raise ValueError(
[   27s]   ValueError: Multiple files or folders could be module build: /home/abuild/rpmbuild/BUILD/build-0.10.0/build, /home/abuild/rpmbuild/BUILD/build-0.10.0/src/build
@takluyver
Copy link
Member

Flit doesn't create a build directory itself - I can clone build and run flit build on it fine. So the general problem here is that if you have a project with a src/X package, then you create an X folder (or X.py file) next to the src/ folder, Flit refuses to build because it doesn't know whether X or src/X is the package you want. Presumably you've hit this on build because some other piece of infrastructure creates a build directory.

This is by design - Flit can do the right thing for 4 different basic layouts automatically:

pkg_dir = directory / name_as_path
py_file = directory / (name_as_path+'.py')
src_pkg_dir = directory / 'src' / name_as_path
src_py_file = directory / 'src' / (name_as_path+'.py')

But it expects that you'll resolve ambiguities by getting rid of the 'wrong' files and re-running it, which presumably isn't practical in whatever larger build process you're doing. Maybe we need an environment variable or something to tell Flit 'this is the location of the module'.

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