I've started working on a Pyramid application, which requires setup.py
usage, but as soon as I built the app, my app
folder was marked as library root.
It is not convenient, because when I open a file, it is also opened under External Libraries unfolding it. This can be "fixed" by removing check on Always Select Opened File, but I like this feature, so I don't want to disable it.
I've also tried to tweak Project Structure in settings, but it didn't help.
How to get rid of this _library_root_ mark?
UPD. Contents of setup.py
:
setup(
name='app',
version=0.1,
description='Blog with CMS',
classifiers=[
"Programming Language :: Python",
"Framework :: Pylons",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application"
],
keywords="web services",
author='',
author_email='',
url='',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=['cornice', 'waitress'],
entry_points="""\
[paste.app_factory]
main=app:main
""",
paster_plugins=['pyramid']
)
Content root types A content root is a folder that contains the files that make up your project. Source roots (or source folders; shown as ). These roots contain the actual source files and resources. PyCharm uses the source roots as the starting point for resolving imports.
Open the Project Structure settings. In the Projects pane of the Project Structure page, click the project you want to configure content roots for. In the dialog that opens, locate the desired directory and click OK.
Change the location of IDE directories From the main menu, select Help | Edit Custom Properties. Specify paths with forward slashes /, including Windows paths (for example, C:/idea/system). After you restart PyCharm, it will use the new location of the corresponding directory.
Open File > Settings > Project from the PyCharm menu. Select your current project. Click the Python Interpreter tab within your project tab. Click the small + symbol to add a new library to the project.
The reason why it happens is PyCharm adds sd-blog/app
to the interpreter paths once you pip install -e
in order to be able to provide completion for app
objects. Possible workaround:
remove app
from the interpreter paths
mark sd-blog/app
as a source root to restore the code insight broken in the step 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With