- Poetry
src
layout- Flake8 + Black
- pytest
- config file for logging
With the venv
module:
python3 -m venv venv
source venv/bin/activate
With the pyenv
pyenv virtualenv 3.8.3 my-venv
pyenv local my-venv
Note that running poetry install
is to install dependencies, but it's also to recognize src
directory.
pip install -U pip
poetry install # to install dependencies, recognize src directory, and update scripts
poetry hello
pytest
poe my_script
poe hello
poe main
python src/main.py
settings.json
:
{
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.pylintEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestArgs": [
"tests"
],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false
}
- https://python-poetry.org/
- https://github.com/nat-n/poethepoet
- https://medium.com/@cjolowicz/hypermodern-python-d44485d9d769
- https://medium.com/@cjolowicz/hypermodern-python-2-testing-ae907a920260#0435
- https://medium.com/@cjolowicz/hypermodern-python-3-linting-e2f15708da80
- https://hynek.me/articles/testing-packaging/