Hide files *only* from Project view

Answered

I love Python because of it's simplicity, but I hate the deicion to require __init__.py-files in every package folder. I always leave them empty, and it's annoying me that these empty files are stealing real-estate on my screen and making my project structures more cluttered when browsing for a file.

The only way I know to hide files is in the "File Types"-dialog, but this also hides them from the parser, so I get errors on all the libraries and modules that uses __init__.py-files. Is there a way to hide them only from the Project viewer?

12 comments
Comment actions Permalink

Hello Preben,

Right now PyCharm doesn't support such exclusions.

I love Python because of it's simplicity, but I hate the deicion to

require __init__.py-files in every package folder. I always leave them

empty, and it's annoying me that these empty files are stealing

real-estate on my screen and making my project structures more

cluttered when browsing for a file.

The only way I know to hide files is in the "File Types"-dialog, but

this also hides them from the parser, so I get errors on all the

libraries and modules that uses __init__.py-files. Is there a way to

hide them only from the Project viewer?

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

Has this changed in more recent versions of PyCharm (like the 2.0 version)?  I, too, would love to hide __init__.py files!

0
Comment actions Permalink

No. (And given that __init__.py files often contain code, we don't think it's a really good idea to hide them.)

0
Comment actions Permalink
Is it possible to only hide the __init__.py files when they are empty? This would be super useful and solve the problem
0
Comment actions Permalink
There is no such feature in PyCharm at the moment. (And implementing it would make it very difficult for a user to add code to __init__.py which was previously empty.)
0
Comment actions Permalink
In Python 3.3 you will not have to create an empty __init__.py file in order to mark a directory as a Python package. Any directory on your PYTHONPATH will be a Python package. See PEP-420 for more info. Note that this language change is not backwards compatible.
0
Comment actions Permalink
FWIW, I'd like this feature as well. I don't want to hide __init__.py files, but Eclipse project files.
0
Comment actions Permalink
Adam,
You can add the Eclipse project files to Settings | File Types | Files and folders to ignore. (This wouldn't work for __init__, but for the Eclipse projects this won't cause any issues.)
2
Comment actions Permalink

That's now Settings | Editor > File Types > Ignore files and folders (for those coming here from google).

 

2
Comment actions Permalink

I agree that it's a bad idea to hide `__init__.py` files as they are essential in Python...

But, I would love it if PyCharm could highlight/indicate when a file is empty so that I know that I don't have to open it to check whether it contains code.

1
Comment actions Permalink

I know why PyCharm can't implement hide specify files feature. This will not only effect which files you see but also effect python packages while indexing project tree.

For example: Try add virtualenv (eg. .env directory). You will not get any suggestions from 3rd library that installed via pip.

0

Please sign in to leave a comment.