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

cppimport should put output files in a hidden directory #31

Open
sirwhinesalot opened this issue Mar 7, 2019 · 5 comments
Open

cppimport should put output files in a hidden directory #31

sirwhinesalot opened this issue Mar 7, 2019 · 5 comments

Comments

@sirwhinesalot
Copy link

Perhaps I missed a configuration option to handle this, but currently cppimport puts all the generated files in the same place as the source.

I would much prefer if the files were stored in a .cppimport folder or something of the sort. Would it be possible to add a configuration setting to handle this?

@tbenthompson
Copy link
Owner

This might be partially achievable, but I'm not particularly motivated to implement this. The benefit of putting the generated files in the same place as the source is that we don't need to do anything fancy for Python to find the compiled modules. What do you see as the problem with storing the generated files in the source folder?

@sirwhinesalot
Copy link
Author

It's not a major thing, but in an IDE for example it adds 3 extra files per extension. With only 1 cpp file it's not a big deal, but if there are multiple extensions that means the file tree is now 4x as large. Makes it difficult to navigate.

At the moment I just put each cpp file in its own folder, and then use imp_from_filepath. It works but is suboptimal since having the cpp files in the middle of the python files is not the issue, the generated files are.

This is very much a low priority thing.

@tbenthompson
Copy link
Owner

Yeah. I can understand that. For the module importing to work well, the compiled module (.so, .dylib, .dll depending on platform) needs to be in the same place as the .cpp file. I don't think there's a way around that. But, the other two files could go somewhere else. That wouldn't be too hard to implement if you'd be interested in doing it!

For the IDE, most IDEs have an option to hide files with certain extensions. That might help you.

@tbenthompson
Copy link
Owner

Now that I think about it, putting the compiled module in a sub folder would also be possible but would require a medium sized amount of re-architecting. I'll just leave this issue open in case me or someone else wants to work on this some time in the future.

Thanks for the idea!

@sirwhinesalot
Copy link
Author

No problem 👍

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