Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3745c24

Browse files
authoredJul 25, 2024··
Create project-set-up.md
1 parent 81d0ef5 commit 3745c24

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
 

‎python/project-set-up.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Project set-up
2+
3+
## Setting a project with Git, Poetry and Pycharm
4+
5+
1) Initialize a Git Repository something like the Github Desktop App or using Git by running:
6+
7+
```
8+
$ git init your_project_name
9+
```
10+
11+
2) Create a `.gitignore` file and add all relevant exclusions. You can use something like [toptal.com/developers/gitignore](https://www.toptal.com/developers/gitignore). Here is an example `.gitignore` for [Python, Pycharm, and Windows](https://www.toptal.com/developers/gitignore/api/windows,pycharm,jupyternotebooks,python).
12+
13+
14+
3) Set up Poetry:
15+
16+
```
17+
$ cd your_project_name
18+
$ poetry init
19+
```
20+
21+
Follow the prompts to set up your project. This will create a `pyproject.toml` file.
22+
23+
4) Install Dependencies:
24+
25+
For example, to add requests as a dependency:
26+
27+
```
28+
$ poetry add requests
29+
```
30+
31+
To create a Virtual Environment: `$ poetry shell`.
32+
33+
5) Pycharm
34+
35+
Open Pycharm and open the project folder.
36+
Then, configure the Python interpreter by selecting the one create by Poetry.

0 commit comments

Comments
 (0)
Please sign in to comment.