Skip to content

Commit 91422fe

Browse files
authored
chore: add dev settings (#299)
1 parent a02bf2e commit 91422fe

File tree

5 files changed

+149
-2
lines changed

5 files changed

+149
-2
lines changed

.vscode/extensions.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"recommendations": [
3+
"ms-python.python",
4+
"ms-python.vscode-pylance",
5+
// "ms-python.debugpy", // to use a debugger
6+
"ms-python.black-formatter",
7+
"ms-python.flake8",
8+
"ms-python.isort",
9+
],
10+
}

.vscode/launch.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0",
5+
"configurations": [
6+
{
7+
"name": "Django example",
8+
"type": "debugpy",
9+
"request": "launch",
10+
"program": "${workspaceFolder}/src/_example/django/django_demo/manage.py",
11+
"args": [
12+
"runserver",
13+
"0.0.0.0:8000",
14+
"--nothreading",
15+
],
16+
"django": true,
17+
// "pythonArgs": ["-Wall"], // to enable all warnings
18+
"justMyCode": false,
19+
"autoReload": {
20+
"enable": true
21+
}
22+
},
23+
{
24+
"name": "fastAPI example",
25+
"type": "debugpy",
26+
"request": "launch",
27+
"module": "uvicorn",
28+
"cwd": "${workspaceFolder}/src/_example/fastapi/src",
29+
"args": [
30+
"main:app",
31+
"--reload",
32+
"--reload-dir=../../../"
33+
],
34+
"envFile": "${workspaceFolder}/src/_example/fastapi/.env",
35+
"justMyCode": false,
36+
},
37+
{
38+
"name": "flask-sqlalchemy_scratch",
39+
"type": "debugpy",
40+
"request": "launch",
41+
"module": "flask",
42+
"cwd": "${workspaceFolder}/src/_example/flask_sqlalchemy_scratch",
43+
"envFile": "${workspaceFolder}/src/_example/flask_sqlalchemy_scratch/.env",
44+
"args": [
45+
"run",
46+
"-h",
47+
"0.0.0.0",
48+
"--reload",
49+
"--without-threads"
50+
],
51+
"justMyCode": false
52+
},
53+
{
54+
"name": "flask-sqlalchemy_package",
55+
"type": "debugpy",
56+
"request": "launch",
57+
"cwd": "${workspaceFolder}/src/_example/flask_sqlalchemy_package",
58+
"module": "flask",
59+
"args": [
60+
"run",
61+
"-h",
62+
"0.0.0.0",
63+
],
64+
"justMyCode": false
65+
},
66+
{
67+
// to enable debug in other packages during tests
68+
"name": "Python: Debug Tests",
69+
"type": "debugpy",
70+
"request": "launch",
71+
"program": "${file}",
72+
"purpose": ["debug-test"],
73+
"console": "integratedTerminal",
74+
"justMyCode": false
75+
}
76+
77+
]
78+
}

.vscode/settings.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"python.analysis.extraPaths": [
3+
"src/",
4+
"src/_example/flask_sqlalchemy_package/",
5+
"src/_example/flask_sqlalchemy_scratch/",
6+
"src/_example/django/django_demo",
7+
"src/_example/fastapi/",
8+
// enable the following when working on test project
9+
// "src/datasource_django/tests/test_project_datasource",
10+
// "src/django_agent/tests/test_project_agent",
11+
],
12+
"python.autoComplete.extraPaths": [
13+
"src/",
14+
"src/_example/flask_sqlalchemy_package/",
15+
"src/_example/flask_sqlalchemy_scratch/",
16+
"src/_example/fastapi/",
17+
"src/_example/django/django_demo",
18+
// enable the following when working on test project
19+
// "src/datasource_django/tests/test_project_datasource",
20+
// "src/django_agent/tests/test_project_agent",
21+
],
22+
"python.testing.pytestArgs": [
23+
"--rootdir=./src/",
24+
"src/agent_toolkit",
25+
"src/datasource_toolkit",
26+
"src/datasource_sqlalchemy",
27+
"src/flask_agent",
28+
"src/fastapi_agent",
29+
// because of test projects, the following cannot be enable at the same time
30+
// "src/datasource_django",
31+
// "src/django_agent",
32+
],
33+
"black-formatter.args": [
34+
"--line-length=120"
35+
],
36+
"flake8.args": [
37+
"--max-line-length=120"
38+
],
39+
"isort.args": [
40+
"--settings-file",
41+
".isort.cfg"
42+
],
43+
"python.analysis.typeCheckingMode": "standard",
44+
"python.testing.pytestEnabled": true,
45+
"python.testing.autoTestDiscoverOnSaveEnabled": true,
46+
"[python]": {
47+
"editor.defaultFormatter": "ms-python.black-formatter",
48+
"editor.formatOnSave": true,
49+
"editor.codeActionsOnSave": {
50+
"source.organizeImports": "explicit",
51+
// "source.unusedImports": "explicit" // this one is disturbing when developping
52+
},
53+
},
54+
"cSpell.words": [
55+
"datauri",
56+
"Dateonly",
57+
"sessionmaker"
58+
],
59+
}

src/_example/django/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ source venv/bin/activate # adapt venv with the path previously used
6565
### Install the dependencies
6666

6767
```bash
68-
poetry install --with dev
68+
poetry install
6969
```
7070

7171
### Init your database

src/_example/django/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ forestadmin-datasource-django = { path = "../../datasource_django", develop = tr
1818
forestadmin-datasource-sqlalchemy ={ path = "../../datasource_sqlalchemy", develop = true }
1919
SQLAlchemy = ">2.0.0"
2020

21-
[tool.poetry.group.dev.dependencies]
21+
# [tool.poetry.group.dev.dependencies]
2222
coverage = "~=6.5"
2323
flake8 = ">=5.0"
2424
freezegun = "~=1.2.0"

0 commit comments

Comments
 (0)