Post

(Note) Tox workflow

What do I need to install

  • tox : virtualenv for testing
  • tox-pyenv : pyenv plugin for tox
  • pytest : testing framework
  • pipreqs : generates requirements.txt

What do I need to do

  1. Checkout cookiecutter

  2. create virtualenv using pyenv

1
2
3
$ pyenv install "some versions"
$ pip install tox tox-pyenv
$ pyenv local "my_env" "some versions"
  1. create src directory and change some settings

    • Why I use src/ directory?
      • Check Hynek’s post
  2. As the post says, modify setup.py

Example of executing tox

1
2
3
4
$ pyenv install 3.8.2
$ pyenv virtualenv -p Python3.8 3.8.2 my_env
$ pip install tox tox-pyenv
$ pyenv local my_env 3.8.2

write code and tests then

1
2
3
$ pipreqs .
$ pip install -e .
$ tox
This post is licensed under CC BY 4.0 by the author.