First time here? Check out the FAQ!
1

Visually distinguish/protect files in site-packages?

Is there a way to visually distinguish or protect files that are in site-packages as opposed to the project directory?

Sometimes I will be editing a module and a bug is exposed in a different module. However, that other module hasn't been added to the environment in editable mode and instead is in site-packages. Sometimes I don't notice this, fix the bug, and sometime later get confused when the fix has disappeared because I didn't fix it in the development location.

Ideally, I'd like to optionally set the background of the editor for source files in site-packages/* to a different colour than files in my project's directory.

Thinking about it further, perhaps it'd also be useful to be able to (optionally) set files in site-packages/* to read-only as well/alternatively. Or at least a warning pop-up letting you know when you save a file that the file is in site-packages.

AnthonyFloyd's avatar
11
AnthonyFloyd
asked 2024-10-22 10:55:00 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

There's no way to do this now, but I think it's a good idea. A work-around, obviously, would be to actually change site-packages files on disk to be read-only, but that very possibly will break package management. I don't know why Python package managers tend to leave installed files writable since that does set people up for this problem and defeats the advantage of supposedly working with a known set/version of packages.

If you right-click on the notebook tabs and select Hide Notebook Tabs you will get a popup menu instead of tabs and that does put a star icon next to files that are in the project, which maybe would also help a bit with this.

We'll try to address this better somehow, probably by warning immediately when a non-project file is edited and adding a way to disable that for the one file or all files. The issue with this is likely going to be that lots of people don't add their source files to the project, but failing to do that can defeat some of Wing's features anyway so it may not be a bad thing to warn about it.

Thanks for the suggestion!

Wingware Support's avatar
4.1k
Wingware Support
answered 2024-10-23 08:00:49 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer