(Note) Python workflow

Posted on Sat 14 July 2018 in Blog

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

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

  2. Check Hynek's post why use src/ directory

  3. As the post says, modify setup.py

Example of executing tox

$ pyenv install 3.5.5 3.6.5 3.7.0
$ pyenv virtualenv -p Python3.7 3.7.0 my_env
$ pip install tox tox-pyenv
$ pyenv local my_env 3.5.5 3.6.5 3.7.0

write code and tests then

$ pipreqs .
$ pip install -e .
$ tox