Update PyCharm docs (#4389)

* Add .idea.dist

* Update PyCharm docs
This commit is contained in:
Abdo 2025-10-27 15:27:50 +03:00 committed by GitHub
parent 62c950120c
commit d3ca0cd0b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 5 deletions

13
.idea.dist/repo.iml Normal file
View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/out/pylib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/pylib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/qt" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/extra" />
<excludeFolder url="file://$MODULE_DIR$/out/pyenv" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -46,10 +46,14 @@ see and install a number of recommended extensions.
## PyCharm/IntelliJ
If you decide to use PyCharm instead of VS Code, there are somethings to be
aware of.
### Setting up Python environment
### Pylib References
To make PyCharm recognize `anki` and `aqt` imports, you need to add source paths to _Settings > Project Structure_.
You can copy the provided .idea.dist directory to set up the paths automatically:
You'll need to use File>Project Structure to tell IntelliJ that pylib/ is a
sources root, so it knows references to 'anki' in aqt are valid.
```
mkdir .idea && cd .idea
ln -sf ../.idea.dist/* .
```
You also need to add a new Python interpreter under _Settings > Python > Interpreter_ pointing to the Python executable under `out/pyenv` (available after building Anki).