You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+37-2Lines changed: 37 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,14 +78,49 @@ When adding a new feature, add tests for it in the appropriate file.
78
78
If the feature is a UI element, add an e2e test for it.
79
79
If it is an API endpoint, add an app integration test for it.
80
80
If it is a function or method, add a unit test for it.
81
-
Use mocks from conftest.py to mock external services.
81
+
Use mocks from tests/conftest.py to mock external services. Prefer mocking at the HTTP/requests level when possible.
82
82
83
83
When you're running tests, make sure you activate the .venv virtual environment first:
84
84
85
-
```bash
85
+
```shell
86
86
source .venv/bin/activate
87
87
```
88
88
89
+
To check for coverage, run the following command:
90
+
91
+
```shell
92
+
pytest --cov --cov-report=annotate:cov_annotate
93
+
```
94
+
95
+
Open the cov_annotate directory to view the annotated source code. There will be one file per source file. If a file has 100% source coverage, it means all lines are covered by tests, so you do not need to open the file.
96
+
97
+
For each file that has less than 100% test coverage, find the matching file in cov_annotate and review the file.
98
+
99
+
If a line starts with a ! (exclamation mark), it means that the line is not covered by tests. Add tests to cover the missing lines.
100
+
89
101
## Sending pull requests
90
102
91
103
When sending pull requests, make sure to follow the PULL_REQUEST_TEMPLATE.md format.
104
+
105
+
## Upgrading dependencies
106
+
107
+
To upgrade a particular package in the backend, use the following command, replacing `<package-name>` with the name of the package you want to upgrade:
To check Python type hints, use the following command:
116
+
117
+
```shell
118
+
cd app/backend && mypy . --config-file=../../pyproject.toml
119
+
```
120
+
121
+
```shell
122
+
cd scripts && mypy . --config-file=../pyproject.toml
123
+
```
124
+
125
+
Note that we do not currently enforce type hints in the tests folder, as it would require adding a lot of `# type: ignore` comments to the existing tests.
126
+
We only enforce type hints in the main application code and scripts.
-[Python 3.9, 3.10, or 3.11](https://www.python.org/downloads/)
134
+
-[Python 3.10, 3.11, 3.12, 3.13, or 3.14](https://www.python.org/downloads/)
135
135
-**Important**: Python and the pip package manager must be in the path in Windows for the setup scripts to work.
136
136
-**Important**: Ensure you can run `python --version` from console. On Ubuntu, you might need to run `sudo apt install python-is-python3` to link `python` to `python3`.
0 commit comments