/
Preparing Python Code for Distribution via PIP

Preparing Python Code for Distribution via PIP

  1. Add a __version__ = '0.0.1' line to the __init__.py  file.
  2. Add a setup.py file at the top level.
    1. This should include a piece of code as follows:

      with open('tpckd/__init__.py', 'r') as f:
          version = re.search(
              r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
              f.read(),
              re.MULTILINE
          ).group(1)
    2. The call to setup() contains at least

        

      setup(
      	name='tpckd-pdfgen',
      	version=version
      )