I have been using pytest https://github.com/kensho-technologies/pytest-annotate and have been following the process of:
pip install pytest-annotate
# Generate annotations by running your pytest tests as usual:
pytest --annotate-output=./annotations.json
# Apply those annotations using pyannotate:
pyannotate --type-info ./annotations.json .
But when I run the final step I can see
(base) C:\planner\planner-backend\service\planner>pyannotate -w --type-info ./annotations.json .
No files need to be modified.
The pytest collection step works apperently and a annotations.json was created. Looking something like:
[
{
"path": "app/analyses.py",
"line": 148,
"func_name": "create",
"type_comments": [
"() -> Tuple[database.analysis.Analysis, int]",
"() -> pyannotate_runtime.collect_types.NoReturnType"
],
"samples": 6
},
{
"path": "app/analyses.py",
"line": 171,
"func_name": "update",
"type_comments": [
"(int, int, str) -> Tuple[database.analysis.Analysis, int]"
],
"samples": 1
},
And 8000 lines more
When looking at the current directory both database and app are directories here. So inside /database/analysis.py there is the class Analysis
I'm devloping inside Docker and using pipenv, but I have tried invoking both inside and outside of docker and inside and outside of pipenv shell and nothing helps.
Do you have any suggestions for what to try next?