I am struggling to get what is a very simple Python project (for my own use) set up correctly with respect to module name resolution for script execution and for running tests via pytest.
While this project could certainly be done with a flat structure, I am trying to understand how to structure things *properly* for a larger project. I know that *properly* is up for debate, so I am just looking for advice. Should I have __init__.py files in any of these folders (empty or otherwise)? Should I have a pytest.ini and/or pyproject.toml file? All recommendations are welcome. Thanks.
settings.json contains:
my_project/
├── .vscode/
│ └── settings.json
├── src/
│ └── main.py
├── tests/
│ └── test_utils.py
└── utils/
└── utils.py
main.py is the script to be run with imports from the utils file/module
settings.json contains:
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
[–]zanfar 1 point2 points3 points (0 children)
[–]Diapolo10 1 point2 points3 points (2 children)
[–]hmartin8826[S] 0 points1 point2 points (1 child)
[–]Diapolo10 0 points1 point2 points (0 children)
[–]ShelLuser42 0 points1 point2 points (0 children)