8000 Add PyCharm instructions to README.md · SirGnip/python_template@b1276e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit b1276e0

Browse files
committed
Add PyCharm instructions to README.md
1 parent 8e3037d commit b1276e0

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A template for new Python projects
55

66
# install to current environment (with current dir at top of repo)
77
pip install . # "static" install
8-
pip install -e . # "editable" install
8+
pip install -e . # "editable" install (setup.py handles source being under `src/`)
99

1010
# run app from instal
1111
python -m gnp
@@ -39,3 +39,18 @@ A template for new Python projects
3939
mypy -p gnp
4040
mypy -p gnp.common
4141
mypy -m gnp.common.util
42+
43+
44+
# Running app from PyCharm
45+
46+
## Use Default Python Interpreter from PyCharm
47+
- For `src/`, do "Mark Directory" and set as "Sources Root" (folder turns light blue)
48+
- Right click on `src/gnp/__main__.py` and choose "Run \_\_main\_\_"
49+
- This relies on the Run Configuration having "Add source roots to PYTHONPATH" set to true (the default)
50+
51+
## Use local venv
52+
- Create venv
53+
- Install package into the venv (ex: `pip install -e .`)
54+
- Set venv as the project's Python interpreter in PyCharm
55+
- Right click on `src/gnp/__misc__.py` and choose "Run \_\_main\_\_"
56+
- Note: This does NOT rely on a Sources Root folder being set or PYTHONPATH in the Run Configuration.

0 commit comments

Comments
 (0)
0